bot spams

module.exports = {
name: "messageCreate",
once: false,

async execute(message, client) {
if (message.channel.id !== '1100929475849498665') return;
if (message.channel.id === '1100929475849498665') {
await message.channel.send('@everyone')
}
}
}
module.exports = {
name: "messageCreate",
once: false,

async execute(message, client) {
if (message.channel.id !== '1100929475849498665') return;
if (message.channel.id === '1100929475849498665') {
await message.channel.send('@everyone')
}
}
}
13 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
JollyJohn
JollyJohnOP2y ago
JollyJohn
JollyJohnOP2y ago
thats what happens i only have one terminal open as well
Syjalo
Syjalo2y ago
That works as you coded. The channel id is '1100929475849498665'.
JollyJohn
JollyJohnOP2y ago
oh so i should ignore if the message.author === bot?
Syjalo
Syjalo2y ago
It sends the message and handles it Yes
JollyJohn
JollyJohnOP2y ago
ok, how do i check if its a bot?
d.js docs
d.js docs2y ago
It's good practice to make your bots ignore other bots, including itself. This can be done through a single line of code:
if (<message>.author.bot) return;
if (<message>.author.bot) return;
<message> being whatever you defined message as.
JollyJohn
JollyJohnOP2y ago
ok, thank you so it doesnt ping @ everyone, do i need to parse mentions? allowedMentions: { parse: ['users', 'roles'], repliedUser: true } thats how i defined my client
Syjalo
Syjalo2y ago
Yes
JollyJohn
JollyJohnOP2y ago
Okay, so do i just add 'everyone'?
Syjalo
Syjalo2y ago
Yep
JollyJohn
JollyJohnOP2y ago
ok, thank you
Want results from more Discord servers?
Add your server