#development
1 messages ยท Page 1118 of 1
just wondering approximately how long it takes for bots to get approved?

3+ weeks
@wanton anvil want me to show u?
about that webhook thingy
its possible and an example is #bids
how do i make a vote command where the two choices don't get mixed together?
how am i supposed to seperate it basically
@finite bough yes please
hey @lusty quest have u applied for bot whitelisting?
nvm
u are a verified bot
sry for ping
What are the odds of my bot being rejected
for bot whitelisting
thanks
can you say me how can I send messages in specific channel @finite bough
it is outdated
is there any way for the bot to react in discord emojis and not just iwndows 10 emojis
cus i cant get the bot to react with number emojis
thats not the point
@wanton anvil using webhooks?
\1๏ธโฃ
yes
What are the odds of my bot being rejected
for bot whitelisting
@wanton anvil search for the channel then send a message in it
same thing
What are the odds of my bot being rejected
for bot whitelisting
which kind of bots get rejected
by discoed
discord
for bot verifications
np
@finite bough what you've sent is js guide
Or just make an alt
@delicate shore bot whitelistening?
;vote "choice 1" "choice 2"
how can i add a seperate feature to seperate the two choices like above
split where " is
split the string with "
hmm
pchoice2 = args[2] || str.split("\""); this work?
what are main rules
that if my bot does this it cannot be approved
there was a problem with gif command
that it could give NSFW
since i removed gif command
i don't think there is any thing like this
its not workin
about a month ago for me
i just got verified
in the context just is not a time constrain
need any help? or just here to dotpost?
What
anyways, is there any way i can cut out all spaces in a string?
hey
regex
regex.
i had one query
i found a npm package
but idk what object it povides
they have no docs as well
package name?
yea they break YT TOS
oh
All do
you are not allowed to Scrape Google Pages
All of them do
s!searchyt OOOP
then it will say
VIDEO NAME : OOOP
BY: FSF
LENTH
LINK
like this
not play it in a vc
@lusty quest pretty much all music bots break tos
not if you go throu the Pain with the Google API
but i also dont care about Music bots.
if i want to play Music i have my Plex Server, Spotify and my PC
also yt doesnt care really much
Does anyone know any good translating api's that work with discord.js
pchoice2 = message.content.split('"').slice(2).join(' ') does this work for splitting the choices
oh yes it worked
@still merlin any api works with d.js
just search for one
?
realize im not talking to u
anyway
yandex has translations iirc
or just use plain google translate 
@mild flower i recommend u use | as the splitter
k
You can do \n for a new line
what
@knotty steeple like i wanna tell app name so it is object.name
so what should i replace object with
they didn't mention it anywhere
how do i use regex in .match()
@misty sigil"yo yo".match(/yo/g);
ty
Any web developers using flask in here? I wanna ask some question
what do u want to do, search for app via name?
yeyeye
u can await gplay.search
ok but
;;----;-;;;;
i mean to say
in embed
for name
it will be gplay.title?
no
that's what im asking
okkk
anyway then u can do results[0].whatever
;-;
ok
error @knotty steeple
if(command === "playstore"){
var gplay = require('google-play-scraper');
gplay.search({
term: "panda",
num: 2
})
const [results] = await gplay.search()
console.log(results[0])
msg.channel.send(results[0].title)
(console.log, console.log);
}
but search term is there
;-;
put the search term????
no
no

ok sorry
no
no sorry lol
mb
yikes dude
you'll be gone in a sec 
how to make flip coin game if he got heads he will recive 2* his money
array or something
if (math.random > 0.5) win
else lose
oh
if (math.random > 0.5) win
else lose
is this the code?
its a function
i was thinking that he wanted the user to choose

it's pseudocode
how to make flip coin game if he got heads he will recive 2* his money
how to make this
apply that logic and create your code
ok
I told you how ๐
Don't expect ready made code XD
if so, you have an array ["head", "tail"] and you get random, and compare with what the user put in
just saying since they will copypaste alone
@misty sigil no that doesn't make sense
yea
How do I make my discord.py bot automatically update a voice channel with the member count of my guild. And I need to limit to my support server only.
discord.py tasks!
also mind the ratelimits because they're stricter for channel updates now
In the task itself, you'll get your support server through get_guild and guild.get_channel
or just bot.get_channel
Does anyone know why the first word in this embed is cut out?
https://pastebin.com/6wuJpqmR
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
if(command === "playstore"){
var gplay = require('google-play-scraper');
const [results] = await gplay.search({
term: "panda",
num: 1
})
console.log(results[0])
msg.channel.send(results[0].title)
}```
then @pale vessel @knotty steeple will thi work
^
try it and see?
yes you can
how can u not
^
you do realize there's runkit that lets you test it online right?
I'd suggest using wait_until_ready in the task itself instead of before
Hey, I'm trying to write some code inverts the colors of an image in golang... I have this code but my images are coming out looking weird:
Code: https://gist.github.com/SinistreCyborg/13ce03a9cc13180bb12e2800cb094f11
example run trying to invert the colors of my avatar image
but yeah you get the overall idea
@delicate shore
@slender thistle why is guild red?
i wanted to post a slap emoji but all the ones that showed up were nsfw
nvm i fixed my issue
@summer torrent ```(node:12422) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'title' of undefined
i did
results[0].title
nvm
i found problem
(node:7044) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '0' of undefined
can anyone help me
?
whatever you're trying to call 0 on is undefined
โจ ๐ read your errors ๐ โจ
The emojis made that statement so much better
For Example,
const arrayThing = undefined; //why would you do this, please don't do this
arrayThing[0];
//OOPSY IT IS UNDEFINED
what
if i send fc 5
then the bot send 10
reply to and reply with have entirely different meanings
you want to multiply that by 2?
@opal plank y
you using d.js?
ok
if (isNaN(args[0]))
return message.channel.send("Please input a Valid number");
if (args[0] > 100)
return message.channel.send("Insert The Number less Than 500.");
if (args[0] < 2)
return message.channel.send("Insert the number more Than 1.");
how
here
use this method
ty for helping
isNaN returns a bool if that's what you're saying
no problemo
You can isNaN anything
isNaN(undefined)
if i have problem i will ask here
Oh I see
isNan for me its work
if (args.length > 0)
the isNaN is fine
becuz i have make delete command before
If you want to be sure
the thing you need is parseInt the arguments
ok
does it not have an integer cast?
or rather than a comparator
Could I have some help please, My bot ignores the first word of my command thing- https://pastebin.com/6wuJpqmR
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
just do if (args[0])
what is radix
remove embed pls @still merlin
just do if (args[0])
ok
@still merlin are you aware of what slice does
cuts like butter?
edit: butter doesn't cut
pretty much
Yeah, That was a old pastebin its const pollMsg = args.join(" ");
you could've diagnosed the issue yourself
also, recommendation, use a dynamic command handler and stop using embed builders
Well my code is args.join I removed the splice a while ago, I didnt make a new Pastebin though ๐คฆ
your code is diagnosed with depression
dansgame
Problems:
- PASTEBING

- Prob a good idea to add a command handler
- Embed builders are fine but bad, its unecessary processing power. Sending an object is better
i mean does it matter
will it work without you completely ignoring my recommendations? 100%
it's a few ns of difference
pastebin is where you post your tokens and secrets right?
ik but its completely useless
pastebin aka give us money for something that should be free, also we steal your data
rather than making an object yourself you're calling methods and making new vars
this is the same as this
i'm aware but it doesn't matter as much
its much more pratical to just send it right away on the .send() method
Okay thanks
it's not a performance impact
Image how many things would break if imgur went down
rather than creating a new variable, calling methods, building it, then sending
you right, there is barely any impact, its just prettying it a bit
I changed my embed and its fixed, Thanks!
I tried out embeds recently
I don't think I can go back to my bot replying with text
there are definetly instances where you'd want raw text
Mhmm, I can see that
crossing my fingers i dont get ratelimited for doing this...
michael reeves is wifey
if(command === "playstore"){
// code
let currency = results.currency
if(currency == undefined) {
currency === "It's Free App Lmao"
}
const result = new Discord.MessageEmbed()
//code
.addField('PRICE' ,`${results.price}${currency}`)
//code
console.log(results)
msg.channel.send(result)
}```
why doesn't it says it's free lmao
anyone
0DEFINED
I'm guessing currency is not unidentified to begins with
u know what
So it's not using the string
im using discordpy and the on_message event, how would i make it so the script doesnt detect messages sent by any bot
any help would be great
message.author.bot return a boolean indicating whether the author of a message is a bot or not
simply return if that's true
so: ```if message.author.bot:
return```
if (message.author.bot) return
mhm
ye
python gang
alr thanks, i wasnt sure if i needed anything else for it
i found a stack overfflow answer for discordjs and converted it
but im not good with js
so
thanks
C# gang:
if (context.Messsage.Author.IsBot)
{
return;
}
inconsistent use of tabs and spaces in indentation (<unknown>, line 138)```
exactly what it says
what is the meaning of this
you're mixing tabs and spaces in indentation
Python is whitespace sensative
you ahve an incosisten use o tabs and spaces
only thing i dislike python
ok @slender thistle
bc its so sensetive with whitespaces
A good IDE will help you avoid that
i am using vs code
it should have a feature to replace tabs with spaces and vice versa
You know... C# ignores whitespace ๐
i know in thonny if you open a file with broken whitespaces it fixes it for you
that's uglier than my Brainfuck code
I can see that. It's pretty bad
File "main.py", line 134
embed.add_field(name="Humans:", value= len(list(filter(lambda m: not m.bot, ctx.guild.members))), inline = False)
^
TabError: inconsistent use of tabs and spaces in indentation
``` How do i fix it please help
It's right after that line it highlighted
Eeeey it works fine
my problem is solved thankx everyone
ah remove okay
So I finally managed to write the birthdays in a json file. Now I gotta go through all of them and compare them to the current date, how would I do that?
(well more or less the command to write them in the json file)
i wouldn't suggest using json files to store data like that
hmm yeah I thought about a db as well but urgh then I would need to switch hosting since my current discord bot host doesnt allow dbs
need to switch to a vps in the future anyways
but for now I'd like to get the command done
mongodb and mongoose is fine
(node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined
send code
I have no experience with mongodb/mongoose so yeh gotta figure out what the hell to do lol
undefined.length
thats your error @surreal notch
i started without any experience got it setup like 2 weeks ago
so how to fix that
oh okay ๐ so it aint that hard?
@narrow folio
lmao
oh okay ๐ so it aint that hard?
@cerulean venture no it aint
are there any beginner friendly guides for that?
i can link you something in dms
@narrow folio const { MessageEmbed } = require("discord.js"); module.exports = { name: "8ball", description: "There is a big chance I insult you!", category: "fun", run: async (bot, message, args) => { let question = message.content.slice(bot.prefix.length + 6); if (!question) return message.channel.send(`You did not specify your question!`); else { let responses = [ "Yes", "No", "Definetly", "Absoloutely", "Not in a million years", ]; let response = responses[Math.floor(Math.random() * responses.length - 1)]; let Embed = new MessageEmbed() .setTitle(`8Ball!`) .setDescription(`Your question: ${question}\nMy reply: ${response}`) .setColor(`RANDOM`); message.channel.send(Embed); } }, };
Help me to figure out
responses[Math.floor(Math.random() * responses.length - 1)];```
Maybe this line
wouldnt it be -1 instead of - 1 ?
wot
@narrow folio can you help me regarding webhooks
How I am going to help with webhooks when you don't tell what's your problem
i want to add a webhook for my youtube channel
@surreal notch give the full stack error in a sourcebin
i want to add a webhook for my youtube channel
@earnest phoenix discord says that webhooks do not totally work properly with youtube
@earnest phoenix (node:24) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'length' of undefined at Object.run (/home/container/commands/info/8ball.js:7:53) at Client.<anonymous> (/home/container/server.js:47:17) at Client.emit (events.js:327:22) at MessageCreateAction.handle (/home/container/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14) at Object.module.exports [as MESSAGE_CREATE] (/home/container/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32) at WebSocketManager.handlePacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31) at WebSocketShard.onPacket (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22) at WebSocketShard.onMessage (/home/container/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10) at WebSocket.onMessage (/home/container/node_modules/ws/lib/event-target.js:125:16) at WebSocket.emit (events.js:315:20) (node:24) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:24) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Hastebin not saving the file
Also, idk how to do that :/
Only time I messed with webhooks was to create a github updates webhook
what is bot.prefix defined as?
then define it
that isn't the issue..?
u wot m8
since the prefix isnt defined
that's where the issue is and the issues is that bot.prefix isn't defined
which is also what the error says
so it is the issue, unless there is more problems in the file
my prefix is in config.json
Yes
ik
wait
let me show
will it work const {prefix} = require("./config.json")
yes
should be working yes
Assuming that's the correct path to the config file
lol let's just assume that it is
i used this let question = message.content.slice(config.prefix.length + 6);
Now how to define config
??

just put prefix.length
will it work
const {prefix} = require("./config.json")
@surreal notch you defined prefix here
Oof
If you're going to use the prefix a lot in your code then it would be easier to import it into your main file and then just do
const { prefix } = require('./config.json');
// Other logic here
bot.prefix = prefix;
Then you'll be able to access it from bot.prefix in any command
cuz i saw you had a /commands folder
yeah make sure you're requiring the file in the right path
Yes i use cmd handler
so it'd be a folder up
uwu
also are you passing client?
Require stack:
- /home/container/commands/info/8ball.js
- /home/container/handlers/command.js
- /home/container/server.js```
Ultron, you wanna learn basic js?
I suggest it
respect ur suggestion
lol
These are basic concepts
Node Relative Pathing
its kinda sad because all he had to do was just type a few dots and some slashes
this should give an idea
i would get the Node Docs but they are a pain to find
ngl, i did not think a script would work to access Twitch Api
wym
i can also do that
with a script?
I use cron
dude, the loop isnt the big deal here
the fact that twitch is accepting bs64 images on a buffer to stream is
its not the presence that im looping, its the stream itself
hello
-needdev
DBL is not a place to find developers for jobs. You can try and put a request on Fiverr or Freelancer. Please do not post the request again. Doing so may result in punishment.
i got pinged here?
Check your mentions
I have someone in my DMs (which due to verification reasons can't send messages in the server) who heard that v11 from discord.js will stop working/be discontinued October. Does anyone know whether that is true or not?
It's true
yes it is true
Alright thanks
@weak parrot https://discordjs.guide/ just switch to v11 version. It will show a warning
Thanks
Djs v11 has been deprecated for awhile then. Didn't even realize it was already
october will be a fun month for this channel here.
Let's hope we get a public command and slow mode right when it happens
Like a -v11 or something
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1596635515, 0, 0, 0, '399868039484538884', 'scripter', '(true false ) Prima intr' at line 1
https://alex.is-bad.com/9U9wkZa.png
the heck is wrong with this
Syntax errors with sql sometimes is so annoying.
INSERT INTO scripter (at, status, pros, cons, userId, type, questions, answers) (1596635634, 0, 0, 0, '399868039484538884', 'scripter', '(true false ) Prima intrebare s ฤรฎศศรข | (false true Introdu aici \\(adica\\) ) A doua intrebare s', 'sa | ')
ik but anyone know what causes it?
you forgot VALUES
yikes
aah
sql injection heaven
i'm a dumbass
yes you are, sanitize your input
atleast mysql tells you there is something wrong
i'm already escaping the strings
or prepared statements 
with mongoose i have the issue i need to litterally pull it out of my ass to get an error
lol
I think all VALUES also should still be wrapped in '
@sudden geyser thanks
what do you use then?
OK, this is .setTimestamp(). I looking for this a long time
It's all in the docs
I know, I just couldn't keep my eyes on it
i'm already escaping the strings
@wheat jolt no
no what
I don't see any (direct) user input in that sql statement
it more looks like the result of one
@pale vessel ?
what is the file exstension that is similair to json
like
{
{
"something": "something",
"a": b"
}
}
sorry lol
JSON, but custom filename.. and with Syntax error in it
nice
@hybrid roost why did you choose me? Lol
I was just flipping through testing-1
I saw your embed and I was like, " wow, how did he do it?. I want that too"
what is the file exstension that is similair to json
yaml?
doesn't look anything like the example you gave
but json and yaml are pretty similar
Looking around, I cant find any standard format that supports what was given.
Looks like json inside extra brackets to me
scuffed array
in discord.py, is there a way to have a different status for every server? or is it just one global one
I had no idea shards had their own status.
i mean they're different instances are they not?
Essentially
Yeah, I just assumed each one would share statuses for some reason
what do you use then?
@cerulean venture
Plain objects probably
^^
Oh MySQL
i do
yeh kinda forced to use it due to my hoster <.<
Piece of cake
If the cake as made of acid
could I dm you real quick?
can't u say here
I mean I can, just gonna be kinda a wall of text
Yea more people who aren't me because I'm nosql
im not like a mysql expert
tfw sql page indexes are 99% fragmented
Okay following: I'm still working on the birthday thing that I was talking about like a few hours ago.
I made some regex stuff to make sure it's actually a date (dd/mm). So far so good, writing to json worked without a issue. Writing to mysql tho tells me it's the wrong format (in terms of dd/mm)
It's probably something like
rowName.forEach(r => r.delete())
just tried to keep it short
that's not how sql works-
wait listen xD
sql need queries
You need a key for it
I know
lemme just try to explain somehow
mostly using the same command except for doing this
"INSERT INTO `birthday` (`bdUser`, `bdDate`) VALUES ('"+message.author.username+"','"+ editedmessage+"')";
instead of fs.writeFileSync ("./birthday.json", JSON.stringify (bday, null, 4))
- so everything is kinda the same
I can use queries without any issues but when I try to keep the (dd/mm) format it tells me it's the wrong
even tho it's the same message that I'm trying to query
like I don't think it's an issue with mysql to be honest, I feel like something else is going wrong
since editedmessage stays the same, json or mysql but regex is like: yeah nah wrong
i dunno how to explain it lmao
now imagine if my username was ', ''); DROP TABLE birthday;--
rip
prepared statements prepared statements
okay so:
editedmessage = message.content.slice(10);
bdDate was for json that part:
"Lysec": {
"bDate": "01/02"
}
or just use id
and what type of data is bdDate
text
rewrite your sql code, you're vulnerable to sql injection in multiple places
but that shouldnt matter since I didnt even check if it's the right data for mysql
yeah I noticed sadly
was just trying to figure out how it works in general and after that working out the sqli's
What I just dont get is why my regex (/^[0-9]{2}[/]{1}[0-9]{2}$/) tells me the date is fine when I check it in my json version (which is basicaly the same thing except for not using mysql) but on the mysql version it tells me it's not a date kinda
that's what my issue is right now
99/99 lol
Does mysql support that format?
Halo
wait
unless he put timestamp
/^[0-9]{2}/[0-9]{2}$/ dont think you need /{1}
I could literally post both commands since they're rather short
are you trying to store a date in the table by parsing it from discord
cause if so, literally parse it in your code and store the unix timestamp
im trying to store a date in the table when someone says
$birthday 01/01 for example
$birthday 99/99
exactly
$birthday 00/00
you don't even need regex to parse those date properly
Gotta be a bit more explicit
Explicit is a correct term
Okay so the plan currently:
Command: (prefix)birthday date
The date + author name should get into the mysql table
doesn't he store it as text?
yeah I do
since apparently most people in the discord hate using dd-mm-yy or whatever
You can turn
99/99 into a dd-mm-yy
hm true
why not
[0-9]{4}-[0-1][0-9]-[0-3][0-9] and it still feels not good enough
how about parse it without regex
how would I do that?
split, moment, etc. idk
DateTime.Parse() 
also, new Date()
Oh yeah, JS has a date datatype. You're covered
I might be dumb or just overthinking stuff but how would I use that since that still wouldnt check if it is actually a date, right?
Covert it back to a string in the format you want
The new Date() will verify it's valid on construction
yeah nah I don't get it anymore, might need to take a break from coding for today I think
So some psudo code:
var bday = "04/20/97"
var bDate = new Date(bday)
return bDate // 1997-04-20T00:00:00.000Z I think that's how JS works
so bday would be my current editedmessage I guess
new Date("00/00") or new Date("99/99") would throw an exception you could catch
wouldnt I still need to add the year n stuff?
Does anyone know how you splice stuff in discord.js? I tried args.join.splice but
:\Users\ewe0 name /Desktop\SpiderBot Project\index.js:192
const messageContent = args.join.splice((prefix + "say"))
^
TypeError: args.join.splice is not a function```
also .splice() takes in a number
Read the docs, I think it assumes this year, but wouldn't be hard for you to check and concatenate that to the end if that wasn't the case
@cerulean venture
Lol
well im making a command handler and i need make a command restriction(no cooldown) like, restriction: 'owner', or 'member', i need edit the bot.js file and the discord.js guide& docs dont say anithing abaut command handler restrictions
uff
Is there no way to check the message senders Id?
I check if they are in the array of admin ids
if i use MessageEmbed.toJson() how can i turn it back to MessageEmbed object?
Is there no way to check the message senders Id?
I check if they are in the array of admins
@faint prism well actually yes, like at the start of the module make: id (msg.author.id !== 'ur id') return;
wait ill see some examples on the same file
hmmmm maybe
if (command.ownerOnly && message.author.id !== 'my id') {
return message.reply('you cant execute this command');
}
So for instance, one of my admin commands looks like this (C#)
[Command("info")]
public async Task Info()
{
if (Context.User.Id == _config.AdminId && Context.IsPrivate)
{
await ReplyAsync("", false, _commandRepository.InfoCommand(Context.Client));
}
}
Alt accounts
(not from here)
you should probably offload that if check to a precondition @faint prism
equivalent of filters in asp.net core
Can you elaborate?
damn it
There are so many preconditions I am already checking for
like is the guild this, or is the user in that guild, etc
Ugh, I should read docs more
I'm getting closer Auger, trying to use moment currently but it's kinda weird
it tell's me it's a valid date but when I log it, it just says "2" instead of "01-02"
JavaScript doesn't have a date literal, and for this reason JSON serializes dates as strings rather than real JavaScript dates. In this post I show how JSON date serialization works, a few approaches how you can manage dates and how to automate the process of converting JSON d...
That might help, since I don't know JS myself, and my code snippet was psudocode
json stringify sounds like what was missing
hmm
JavaScript doesn't have a date literal, and for this reason JSON serializes dates as strings rather than real JavaScript dates
json stringify sounds like what was missing
@faint prism
That's what I used before but just with regex
and it worked it just didnt want to work as soon as I tried using the date in mysql
whhich i still don't get
With regex you're doing a lot of the heavy lifting yourself, like verifying if the date is valid
Well that's what I tried to explain earlier
fs.writeFileSync ("./birthday.json", JSON.stringify (bday, null, 4))
message.channel.send(`Added: **${editedmessage}** as birthday for **${message.author.username}**`)
}```
That was the part for my json
and I just changed the fs.writeFileSync to the normal mysql stuff
but then it tells me that the regex is wrong
so I still don't get why
since it shouldn't really matter if it's json or mysql since it doesn't even get that far anymore
JSON.stringify ( is that space there important?
^
nah I just got used to doing that
Can you send the error output?
sure gimme a sec
Well thing is, there is not really an error lol
was just making sure that nobody wanted to add "awuid8ujfhas" as their birthday
urgh it's hard to explain
You want input validation, I get that
yeah and it works
my code
const commandsFolder = fs.readdirSync(path.join(__dirname, "/commands"));
for (var folder of commandsFolder) {
const files = fs
.readdirSync(path.join(__dirname, "/commands", folder))
.filter((filename) => /^.*\.(t|j)s$/.test(filename));
for (var filename of files) {
const command = require(`./commands/${folder}/${filename}`).default;
bot.commands.set(command.name, command);
}
}
my error
`
C:\Users\rmota\Documents\Ambiente\bot\src\index.js:19
bot.commands.set(command.name, command);
^
TypeError: Cannot read property 'name' of undefined
`
Great
it just doesnt work as soon as I change to mysql
works great with json
but I don't get what the issue is since it's still checking for the same regex
sql doesnt like the stringifyied date?
not really apparently
lemme just pastebin that stuff real quick and maybe you get why that's happening since I can't find the reason behind it
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
my bot comes first then Autjja on top bot list
return message.channel.send('Not a valid date (DD/MM)');
}```
This part works in the json version but not in the mysql version for some reason
my comes on page 30 and auttja comes on page 31
like it works it just tells me that it isnt a valid date lmao
I got a question myself. How do you inline 2 fields for an embed, but add a break between that and another 2 inline fields?
huh?
just add ,true
.addField('**Stuff**', Stuff, true) ```
That would put them next to eachother
or what did you mean?
I want those 2 inline, but a newline seperating another 2 inlines
ohh uhm probably just add a filed and leave it empty or just use ' ' ? dunno
add a field with a zero-width space
\u200B
^
good to know tho lmao was looking for that as well a few weeks ago
in between these quotes 'โ'
yeh
If I use GitHub Actions in a repo owned by an organization and I need to add in my github token as a secret, can collaborators see that secret too?
builder.AddField("\u200B", "\u200B"); gonna try that
builder.AddField('\u200B', '\u200B');
Accepts strings only
not chars
But, that's okay because the escape \ escape takes care of it
hm nice
overwrite the css
get fancy
overwrite the css
@earnest phoenix do i need to do it in long descr
where else
ok
Next to the bot id ofc
The real question is. How do you all implement that embed with page flipping reactions?
I'm so friggin mad. I can't figure out how to use emoji regex to identify if a message is an emoji or not
learn how to use html
The real question is. How do you all implement that embed with page flipping reactions?
@faint prism https://github.com/foxbot/Discord.Addons.Interactive
latest version of interactive should be on fox's myget
give me a sec i'll grab the feed url for you
Deleting every message?
Is anyone here very familiar with regex?
You're fast Cry, ngl
Just deleting any message that isn't an emoji
add this to your package sources on vs
The regex for that would be pretty straightforward
js has .match(regex)
Google regex nodejs
I have been trying
there's a fuckton of prebuilt emoji regexes online, you can find one within 20 seconds
Its like the first result
Especially Cry, he's fast af
I don't understand specifically
sorry
I'm super slow
what is there to not understand
I understand how to filter out emojis
with regex
but
what
You want the opposite right? lol
I don't understand how to implement it into messages
if (string.match()) delete();
Message.match ?
Are you sending emojis, or...?
what
just like you would with any other string, compare against the content
If anyone sends a message that is not an emoji or longer than one emoji then delete
I'm so fucking stupid
the regex is similar to mention regex
notepad.exe
???
-_-
vim better
vsc? atom?
nano gang
All good options
who's spamming reactions
Psh, dev mode
wait
bot.on('message', msg => { if (msg.author.bot) return; if (msg.content !== (I HAVE NO FUCKING IDEA)) {
what would it look like
no
I have no idea what that means
If(message.match())
?
FUCK I CANT
We are kinda getting into help vampire territory now
why are you so smart
I DON'T KNOW WHERE THAT GOES
Learn js before making a bot
if (/regex_that_matches_an_emoji/.test(message_content)) {
// delete the message
}```
WHAT
/^(u||you)$/g
..that's js
no
I FEEL STUPID
its regex, not js.
I HAVE NO CODING KOWNLOEDGE
Thats your problem
you maybe shouldn't be making a bot then
You should learn that before making a bot
Bots are not the best first project
if it isn't an emoji
You need to Hello World first
/^(u||you)$/g
@faint prism u|you
i did that
Bots are not the best first project
^
okay wtf I'm confused @faint prism I pasted the literally SAME code to the birthday command and it works
you don't learn french by writing a book in french, do you?
but wont work with the test command
You can learn french by writing small sentences in french
eventually you get better
and write big books
Your trying to write a book first
A book is a big bot this is a minimal simple bot
Simple bots have a lot of moving parts
Oh really?
oh it's a book
Even the simplest bots
then do i need to
`bot.on('ready', () => {
console.log('Emoji Bot is Online!')
})
bot.on('message', msg => {
if (msg.author.bot) return;
if (msg.content !== (I HAVE NO FUCKING IDEA)) {
msg.delete();
msg.author.send({ embed: embed });
}
if (msg.content === new RegExp(/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/g)) {
msg.member.setNickname(msg.content);
}
})
bot.login(token);`
This is the entire bot
yeah I don't get it
e
My class library alone is 70kb
what the fuck is that regex
My bot project compiled is 237mb
that was me testing things
Why would the command be === to a regex
<html>
<head>
<style>
body {
background-image: url("paper.gif");
background-color: #cccccc;
}
</style>
</head>
<body>
<h1>The Best Bot</h1>
<p>Black Sheep</p>
</body>
</html>
here
yikesss
Learn js first
how can i
=== is type sensitive too in JS right?
learn html
do i need to replace url with something
img tag
Can someone please just write the one bot.on script for me so i can see what I'm doing wrong
no.
;-;
if you pay me
No spoon feeding
);
lol

it's 5 lines of code

u just copied my code







