How do I program a Discord bot that sends messages? (JavaScript, NodeJS)

The Discord bot is not working. I have tried various methods (as you can see from the main file), but nothing works. I need your help.
13 Replies
d.js toolkit
d.js toolkitā€¢12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - āœ… Marked as resolved by staff
treble/luna
treble/lunaā€¢12mo ago
show your code
Detonario
DetonarioOPā€¢12mo ago
GitHub
GitHub - Detonario/Deto-s-Code: Just some commands and... that's it.
Just some commands and... that's it. Contribute to Detonario/Deto-s-Code development by creating an account on GitHub.
treble/luna
treble/lunaā€¢12mo ago
its messageCreate and you do not need 2 listeners
Detonario
DetonarioOPā€¢12mo ago
like this? sorry i'm really bad
No description
treble/luna
treble/lunaā€¢12mo ago
yes
Detonario
DetonarioOPā€¢12mo ago
it works. thx so much... šŸ‘šŸ» do you maybe know how I can lock a bot to a specific channel on Discord? i know i can make him not see the other channels, but this can be annoying. any other solution?
treble/luna
treble/lunaā€¢12mo ago
compare the channel id
Detonario
DetonarioOPā€¢12mo ago
is there a command for it? message.channel.permissionoverwrites.edit(message.guild.everyone.id, maybe with this?
Unknown User
Unknown Userā€¢12mo ago
Message Not Public
Sign In & Join Server To View
Detonario
DetonarioOPā€¢12mo ago
cant believe, it worked šŸ˜… thank you final question, i promise: do you maybe know a good free cloud server, where i can put the bot online 24/7 ?
Unknown User
Unknown Userā€¢12mo ago
Message Not Public
Sign In & Join Server To View
Detonario
DetonarioOPā€¢12mo ago
šŸ‘šŸ»
Want results from more Discord servers?
Add your server