#development
1 messages ยท Page 604 of 1
I'm just using a example that would reference a different type of code
Yeh
x3
I didn't mean to put .js
Yeh I'ma start using that as separate commands soon
I am just used to using js more then py
so i need a command handler to do custom commands?
wait no
No
Custom commands you make from scratch
Like profile customization, you strip off the command prefix and name
but how is my question
And have the rest be put in it
https://anidiots.guide/
https://discordjs.guide/
both good sources to help you with a command handler
A guide made by the community of discord.js for its users.
i mean custom commands like you can add with nightbot
Oh
Oh uhm
That's gonna be p hard tbh
Ye
then when they try and use that command call it from the db
I'd recommend firebase or s3
Imma just look at YT lol
Yea
why
Either outdated, or irrelevant
Not really
It isn't that it is outdated or irrelavant
you'd just be copying the whole thing
and not knowing what it does
cause they don't explain it
https://anidiots.guide/
https://discordjs.guide/ these can help most likely
A guide made by the community of discord.js for its users.
Likely
i can now do the case stuff off by heart
^
Yeh
But you might have to install packages and tie in API
ohh hi
They may use separate scripts for different commands
Do you have a question Jazz
^
What is it, and what lang
var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
var timestamp = time; // UNIX timestamp in seconds
var time2 = new Date();
time2.setTime(timestamp*1000); // javascript timestamps are in milliseconds
var dayOfWeek = days[time2.getDay()];
return time2.set(timeID, dayOfWeek);
}```
the function isnt working
=>
^
arrow function?
problelm is
location.js:101 Uncaught (in promise) TypeError: time2.set is not a function
Hm
dpm
Idk much about js
is this JS
don't you need to define what timeID is?
It definitely isn't py
Error message isn't correct if it was py
not really
thats rude
You can ask other development questions here
lmao
^
I have asked plenty of other questions unrelated to bot development
thats the intent of the channel, but i mean people can ask other things too
Never got yelled at
^
anyone know whats the prob
No sorry.
This code is throwing errors. I'm still using Discord.js, but I followed the script on the official documentation website
What's the error message
oof notepad ++
also i know notepad++ isn't the best but at least i'm not using the original notepad like i was before
off
@earnest phoenix new isnt needed
message.channel.send(${message.author}, attachment)
it's on the official documentation page that it's needed
meh
It's supposed to tag the user who sent the command and send the "father i crave cheddar" image
const attachment = "";
thats all u need
Yea
and removing new only put this error
Don't use attachment()
I'm taking these from the official website. I've never done Discord.js before today
can u send all code in haste bin
Well.
what
Don't spoon-feed
not a url
@west spoke what u mean by that
But I could be looking at this wrong
ohh i was just gonna say i know what u mean
xd
lol
advice did not apply correctly
gotem
at the very top of my code
if you already have client defined
then you don't need to include client
Show full code
Not partial
so i dont have the exact text apparently
one sec
it doesnt have my bot token or anything
you wanted the full code
its just an updated version of the file that i sent a few hours ago
and no, i dont expect you to write it for me
yes i know it looks horrible
because i have no experience with coding
most of this was done from a tutorial
let img = new Discord.Attachment = ('./resources/cheddar.png');
message.channel.send(`${message.author}` + img});
i think that has an invalid left side assignment?
is that what its called?
the "new discord.attachment" part
I only know how to make a basic message send script
let body = {"url":"https://media.tenor.com/images/7aec1c8df8b5653666483320ed50fdd8/tenor.gif"}
return message.channel.send(body.url);
Or you can try that (but I think you need superagent)
But replace the link by the link of the picture
I'm using Discord.js, would that work?
mean yes
but you don't have to put it in an object
you could just make it a string
Which is what I tried telling you earlier but you were so set on the Attachment thing
As I said I have No Fucking Clue how to use javascript or discord.js other than basic stuff
and stuff learned from a tutorial

I literally gave you it as well
and making a string is pretty basic
it is literally doing
let something = ""
is it defining a variable?
let something
something is the variable
and you are assigning it a value by doing =
the value you are assigning it is a string
so the string is stored into the variable to be used somewhere else
๐
bruh can i steal that

Yup
Jkjk
thank
Np
Btw, idk how to edit a message with the bot :/
Edit his message (like to do a ping command)
well
message.channel.send("Hello").then(msg => {
msg.edit("Goodbye")
})
is one way to do it
Thanks x)
x)
oof
But why it doesn't work ?
:/
if(messageArray[0] === "!loli") {
let body = {"url":"https://media.tenor.com/images/7aec1c8df8b5653666483320ed50fdd8/tenor.gif"}
let loliEmbed = new Discord.RichEmbed()
.setDescription(`FBI OPEN UP !!!`)
.setImage(body.url)
.setColor("#d604cf")
return message.channel.send(loliEmbed);
}
@earnest phoenix Try this code
You can replace "!loli" by what you want
This is considered spoon feeding
and looking at their code
it would be
if(command === `${prefix}loli) {...}
ah x)
sorry
I've lost
Then...
let messageArray = message.content.split(" ");
if(messageArray[0] === "!loli") {
let body = {"url":"https://media.tenor.com/images/7aec1c8df8b5653666483320ed50fdd8/tenor.gif"}
let loliEmbed = new Discord.RichEmbed()
.setDescription(`FBI OPEN UP !!!`)
.setImage(body.url)
.setColor("#d604cf")
return message.channel.send(loliEmbed);
}
Try this one
Ok, ok
You are spoon feeding
and that code won't work
I mean it would but they already have command defined
so it would be pointless to define messageArray
Ooh ok
wtf where's the ; ๐ก ๐ค
; isn't really needed in js
Aware
I tried repairing it but I don't think it works in Discord.js
Oh shoot
Didn't even notice that
Yea why are you using 4 message events
you only need one
this is what im doing with it
i changed the thing that triggers the command and stuff
probably incorrectly, but meh
I'm using it because i'm used to the interface
I used it back in 7th grade
At least I'm not using Windows notepad like I was
Understanding the interface of most editors shouldn't be that hard
even atom is better then notepad++
Unless you're like my grandma or something, I'm sure you'll be fine
I got it to work
gg
I'll consider it. Probably won't switch today, but will switch eventually.
use your eyes to lint ๐
if you don't you are setting yourself up for failure xd
imo at least
a linter is helpful
and syztum I tried that once
it sucks
my eyes stopped working
lul
my eyes only downgrade pepehands
Is there a link here rhst would help me make a bot that i added to my discord make posts automatically for daily things?
Use a loop with a 3600*24 second sleep period
Ok can i dont know anything about discord formatting and im using just my phone is there a way to do it on my phone or no? Lol basically can you dumb that down for me
you dont make a bot on mobile
not without extreme difficulty
making a bot requires knowing how to code or reading #502193464054644737
๐
Im not making a bot im taking a bot already built and trying to automate it
Thats easy if in python
Will subscribing it to certian channels work
Yep with db
Stop
I didnt mean to send it
whenever i do <:emojiname:emojiid> ofc replacing the values, it doesn't show the emoji, am i doing it wrong
works for me
- does the bot have access to the emoji?
- does the bot have permission to use external emotes?
Wait how that async eval tho
Guide to Making Your Bot Appear Online on Discord Bot List after the Outage
Due to the outage/server orphaning that occurred earlier today and affected this guild, most bots on the website show as offline, regardless of whether the bot is actually offline. Details on how to fix it are below.
For sharded bots
If your bot is sharded, all you have to do restart the shard that this guild is running on.
For non-sharded bots
If your bot is not sharded, restarting the bot should fix it.
Note that the change will not be visible on the site immediately due to our caching.

shut up owobear
@earnest phoenix this is #development my man
Jesus why tho
Like 10-15 and at the end have view the rest of the tags here
I can link the url myself
I'm guessing whatever it is that you're using, please don't tell me, has an array of tags?
idk why I helped, but np
Not really
Aaand raspbian can't install pip
It can be 2 girls on a park bench
Great
for all you know
Ok stop trying to make It innocent
It cant be innocent
Shhhh
You didnt do a good job at crossing it out
hey, i wonder if anyone can direct me to the proper documentation for programming and setting up a donate button for the site. just dm me.
my bot looks like its starting to blow up and my wife is gonna blow up if i dont add that button soon lel.
Hey guys, can anybody help me with cronjobs for my bot right quick?
@lavish abyss if you provide a little more detail, then sure
I got it sorted out, the directory did not have execute permissions, i just did sudo chmod +x DIRECTORYNAMEHERE
@oblique edge ^
ah ๐
hello everyonee!!
i need help with making a bot
how i can Set up in a bot 24/7 ??
VPS
how does one shard a bot? Like a Discord Bot sharding book for dummies
some yes
google "Google Cloud compute" @hollow hamlet
some no
@soft cove https://discordjs.guide/sharding/#when-to-shard this is even better
A guide made by the community of discord.js for its users.
ok thanks
i have a question, mind if i DM you?
Why not state it here?
nvm
ok
/*
The following code goes into it's own file, and you run this file
instead of your main bot file.
*/
const Discord = require('discord.js');
const Manager = new Discord.ShardingManager('./YOUR_BOT_FILE_NAME.js');
Manager.spawn(2); // This example will spawn 2 shards (5,000 guilds);
where would i put something like this?
like what file
in a file called
shardManager.js
but I would read
A guide made by the community of discord.js for its users.
this
it gives you a better rundown
ok
how to confirm email to add bot
@hollow hamlet if you dont want to pay, you can host the bot locally, but then you run into limits with your own infrastructure
And that
i'm back
Okay... let me see...
so, if i can do the bot online 24/7 local but i need to stay my pc online 24/7?
or another device 24/7
correct
how much cost the service?
Mine costs 3 euros a month however its EU only
Small VPS are 1-5 USD/EUR, check pins for some good hosting websites
I use Scaleway
okay i see
I self host on my home server, and when I expect a potential issue with my home infrastructure, I just start the bot up on my personal server at our datacenter
How does the discordbots api knows how much servers the bot is in?
you tell it

Bot developers send server count to DBL
@hollow hamlet localhost are good
stay your pc online doesn't cost anything
and if you have a good connection the bot stay online 24h/7j
Rip cpu and mem though if your bot gets too big
For that you get a vps then ^
Lel
but, I have to pay the electricity bill at the end of the month
the bot doesn't give me the money to pay :b
or i can generate money if my bot are online?
Problem: Nothing writes in the file and the embed does not appear in the chat
any ideas why?
any1?
i'cant help you with your problem @hard tendon sorry,
Try to search your problem in google
dont use json as a database problem solved
๐ ๐
so, i'm working on a say command for my Discord.JS bot with canvas, and one problem that I am running into is that if you want to @ someone it will write it as <@!ID>... Ik why this is, i just don't know how to fix it
my bot is @snow haven
Discord.JS
not much... but considering that this is my first try I'm rlly happy with what I got so far
at what line does it display the id of the user
what ilne is that in the code
I cant seem to find it
you can do ```js
await client.fetchUser(id)
It's just when the user gets @ed
bs.say anymention @earnest phoenix
oh wait
XD
Mentions are in the message properties
ahh, so will this work with the ping in any position?
message.mentions.users / message.mentions.members
Depends on the type you want
Yes it will
It's mainly just so if someone wants to ping someone their name can show up
(node:8917) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'id' of undefined
even if i put in message.mentions.users / message.mentions.members
await client.fetchUser(id)
i've been looking at the wrong docs page
you can use the built in regex expressions to scan your message, and then get the user from the members collection
I'm havin a problem which makes it say "channel.send is not a function" smh
and it's only on some things
Mk show code and error
let channel = guild.channels.first();
let embed = new Discord.RichEmbed()
.setTitle("ex")
.setDescription("Hi");
if(channel) channel.send(embed);
and
I can already see the problem
Shouldn't there be a ; after setTitle
No
That will stop the bottom line
And it will error
And
It Is message.guild.channels
But may I ask
its on guild join
What channel are you trying to send it to
It's probably a voicechannel you try to.send() on
You'd have to filter the first text channel you have perms to write in if you wanna do that
But pretty sure in that case it just wasn't a type text channel
will only try send if its text type now >):
if no perm then it says DiscordAPIError: Missing permissions tho
Catch it :>
Or check if the bot has perms before sending the embed
yeah catchin as well ๐
made so it checks type cuz it would make sence there's no .send in voice channel so
but thx evrywan
+10iq
Is it possible to change the name of the bot on the website. For example. discordbots.org/botname
Instead of a number
Some bots got that
Oh tnx
what this words is colored ?
and now question... why on phone this not working uhh
it is gray yh
because discord needs to support the app for many platforms, and highlighting is not available on mobile
:(
Hello
Not here please
Okay sorry
#502193464054644737 please read
Would an urban dictionary command be allowed if it only works in NSFW channels?
if (message.author.id !== AuthorID) return message.channel.send('Command Only for Bot Owner !')
``` its ok ?
(nodejs)
Hello
can somebody help me please
i have an OUATH2 /@me get request error 401
i cant get it with the access_token
what are you using to code the bot?
discord.js
You need to be specific so people can help you, dear.
ok
const json = await responsey.json();
const fetchDiscordUserInfo = await fetch('http://discordapp.com/api/users/@me', {
headers: {
Authorization: Bearer ${json.access_token},
}
});
const userInfo = await fetchDiscordUserInfo.json();
i have this code and i want to get the user info and put it to a variable called userInfo
and i get 401 error
https
Try it out
let me try ok
@earnest phoenix for what command? yes it's ok, because it finds the owner id and if the person with the incorrect id tried to use the command, it would send that message to that person
@earnest phoenix
`const json = await responsey.json();
const fetchDiscordUserInfo = await fetch('https://discordapp.com/api/users/@me', {
headers: {
Authorization: Bearer ${json.access_token},
}
});
const userInfo = await fetchDiscordUserInfo.json();
`i have this code and i want to get the user info and put it to a variable called userInfo
and i get 401 error
next time put the code in the code bracket ^
ok ๐
or stop copypasting the same snippet 400 times
ok but it was just 2 times
why would u mention me I know jack shit about proper coding i only know basic messaging and embed messages
ok
sorry bro
it's fine
provide your entire method
just giving fair warning because I'm new to discord.js
ok
also hate to interrupt but how do you tag a mentioned user in a discord.js message
i know how to do command author but not mentioned user, and google is giving me outdated responses
<@userid>
@earnest phoenix Bearer -> Bot
no lol bearer is for oauth, stop helping without reading whats the problem
which docs? the official documentation?
yes
it didnt work bro
wait i forgot to change
sorry
still didnt work
yes /api/users/@me is an endpoint available to both lol @slender thistle
bot tokens are for bots
I get 401 when using Bearer
yes
@earnest phoenix i told you probide your entire method
me too but i still get when i try bot
@earnest phoenix what does it mean lol
i am really new to oauth2
provide your entire function
low iq hours
ueah
@slender thistle because bearer is for oauth. you need an access token
ohh
a little question
how can i get access token @earnest phoenix
i am using json.access_token
(defined json)
noone?
ok...
after the user authorizes your app your user will get redirected to your website with a url param named code, exchange that for an access token by calling /api/oauth2/token
stop being impatient jesus christ
sorry ๐
let me try
i understanded the issue @earnest phoenix the code is ok but i cant get the access_token
it gives undefined
print out the response and see what you get
ok
undefined
i still get undefined @earnest phoenix
please ping me when you read my message
...what does this mean
because i know memory leaks are bad
I don't know js but I think that you got a leak because you don't have enough Listeners
however idk
oh god
oh god no
@earnest phoenix please dont tell me you have a client.on('message' ... for every command
I realized what it meant just after I sent that
I have the command types sectioned off
very stupidly
How do I write it into my code to increase listener allowance
you should have 1 message event, and check for commands in there
yeah i just put them all together
i am An Idiot
i just did a lot of screaming because i forgot one of the client.on things
I have a question because I made a slots command that works and you get the coins etc. but sometimes the command does not respond and nothing comes.
CODE: https://hasteb.in/agejexop.js
probably because youre using json as a database
there should be an error though
Why have I done so many commands with JSON making the operation perfect.
youre right. json is a perfect database and is not at all prone to corruption based on your immense wealth of experience
actually, the reason it can get corrupted is if you read and write at once
which can be avoided if youre smart enough
maybe its because youre trying to use english but the english language if statement is weapped in the german if statement
it shouldn't be that
yea but thats very hard to avoid cyber, especially on a discord bot that has multiple users
Or use a db like s3 or firebase
Can also be used to link to a website
Since it writes and then does literally nothing until the next command
how do you set the bots Playing Game bit
in discord.js
Thanks!
i was wrong on that one
so whats the problem?
Bah it's logical he must not react to his own reactions lmao
setGame is deprecated, use setActivity instead
dafuq 
Just wondering, are you allowed to store data coming feom Discord in an external database? I was thinking about user id's for example.
It depends what data
some requires consent
if its for bot usage like economy its fine
I was just wondering in general
Currently I don't need it, but I might in the close future
I store peoples ids so I can get the economy data from my folder spam
Ok great! Thanks!
ID's are fine
yes
avatars aren't I believe
Good news, I don't think I'll need a lot more
Hi :
https://hastebin.com/isenewadac.js
My code has a problem
My bot take his reactions
?-?
Which means only the reactions from your bot will count
๐ค
How can I do then?
Change the name
Of ?
..
You have a message event yes
In which you have the variable "message"
In your .then() you're also calling that message
Don't do that
Give it another name

You can edit and explain me ? '-'
Do you understand the problem
?
Owo
in message
same
As you can see by the highlights
Your filter check uses that message
And not the message from the user using the command
Ok
Yes
Ok
That's what I'm explaining
It takes his reactions
Because your filter
Checks the author of the message that the bot send
Your bot is the author of the messages it sends

Rename message everywhere inside your .then()
Except for in the filter
And in your bottom timeout function
Because you're using reply in there
You should reply to the user, not the bot
use message inside the timeout for the replies
Or the bot will reply to itself
@late hill fckin weeb
Yes you forgot to change one
๐ค
@sinful lotus thanks uwu
xd
๐ณ
I ship
@late hill for an embed how i can?
message.channel.send(embed); .then(anothermessage => { ?
Ok no it's good
anyone know how i can read a js file and get the data from items ?
items = {
"-1": ["Empty slot", 0, -1, 0, 0, 0, 0],
8757: ["Sheath0", 27, -1, 0, 0, 0, 5],
3285: ["Ivory Wyvern Key", 10, -1, 46, 0, 0, 100],
3284: ["Draconis Key", 10, -1, 46, 0, 0, 200],
3323: ["Marid Pet Skin", 10, -1, 92, 0, 0, 2e3],
24837: ["Bagston Pet Skin", 10, -1, 138, 0, 0, 2e3],
24840: ["Goldy Pet Skin", 10, -1, 184, 0, 0, 2e3],
. . .
I found
module.exports = items @fleet mason ?
the js file is from a website link so then i would have to download it
I mean using eval() on it would work
But if that page returns some weird stuff
It could fuck stuff up
Don't know which would be a safer way
true
Was async shut down?
Ye
rewrite has been released
You updated your discord.py
You did
K what version do I need
rewrite
Just basically pip install discord.py==0.16.12 iirc
...
you won't get support for it, but it works
people was moving because they couldnt use it
in the discord.py server there is no help for it
Are you sure they moved because rewrite was added on PyPi instead of async
rewrite is here
async is not completely dead
You can install and use it, but don't expect people in d.py server to help you with it
Ik
It works
I did a sample =pi command and it does work
Now to try it on my backup
Ye everything works
How can request.form in Flask be empty (lierally just a dot)? 
I will
hey so i just want to suggest to people not using it to use visual studio code because 1) dark theme, and 2) It automatically completes brackets
i got suggested it yesterday
and fuck i love it
๐ค
hey i just want to thank the people who helped me figure stuff out yesterday
I managed to add a ton of commands and I figured out more coding stuff
so thank you! :D
basically every single editor has a dark theme and autocompletes brackets
not notepad++
Or wordpad
theyre not really editors though
They are
notepad is made for code
Change my mind
notepad++*
I use wordpad for html
literally every actual editor does these things. brackets, vsc, atom, any of the jetbrains, etc
notepad is like cmon man
WebStorm with VIm bindings
so home server is back online
well, power button pushed
once os is bootred, Vigor should be up
Yikes
I heard someone call worldpad an editor and I am here to enact karma for your unholy deeds

@icy gyro it is. Change my mind.
word processor =/= editor
wordpad is basically a chinese copy of ms word except its still backed by ms
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ([object Object])
at VoiceConnection.emit (events.js:178:17)
at VoiceWebSocket.ws.on.err (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\discord.js\src\client\voice\VoiceConnection.js:363:32)
at VoiceWebSocket.emit (events.js:189:13)
at VoiceWebSocket.onError (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\discord.js\src\client\voice\VoiceWebSocket.js:156:10)
at WebSocket.onError (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\ws\lib\event-target.js:128:16)
at WebSocket.emit (events.js:189:13)
at WebSocket.finalize (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\ws\lib\websocket.js:185:12)
at ClientRequest._req.on (C:\Users\chill\Desktop\Chill Bot\discord-bot\node_modules\ws\lib\websocket.js:635:10)
at ClientRequest.emit (events.js:189:13)
at TLSSocket.socketErrorListener (_http_client.js:392:9)
at TLSSocket.emit (events.js:189:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)``` i got this?
show code and stuff
like but where
hastebin i guess
no like what part
idk
im prolly not able to help tbf, but to help others see the issue who can actually help
@junior summit add an error event
client.on('error', () => console.error)
i did
wordpad is word but free and old
Yeah but it was what i was using before I sacrificed 5 gb using vsc
And only for html
Already have the python ide
@junior summit message.guild.name
Depends where u define it
Hello guys/girls, just wondering how I can inject my custom emojis into some of my bots responses/embeds
*Python bot
Discord.py
