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 toolkit14mo 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.
Baconburger998
Baconburger99814mo ago
Baconburger998
Baconburger99814mo ago
thats what happens i only have one terminal open as well
Syjalo
Syjalo14mo ago
That works as you coded. The channel id is '1100929475849498665'.
Baconburger998
Baconburger99814mo ago
oh so i should ignore if the message.author === bot?
Syjalo
Syjalo14mo ago
It sends the message and handles it Yes
Baconburger998
Baconburger99814mo ago
ok, how do i check if its a bot?
d.js docs
d.js docs14mo 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.
Baconburger998
Baconburger99814mo 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
Syjalo14mo ago
Yes
Baconburger998
Baconburger99814mo ago
Okay, so do i just add 'everyone'?
Syjalo
Syjalo14mo ago
Yep
Baconburger998
Baconburger99814mo ago
ok, thank you