Reputation: 39
I'm trying to get my bot to reply to a specific command, but I don't want him to mention the user who uses the command when he replies with his pre-loaded response. Could anyone help?
I think it may be due to the code 'msg.reply' but I'm not sure how to edit it to ensure that he doesn't mention the user.
Thanks!
client.on('message', msg => {
if (msg.content === '!events') {
msg.reply(`Birthday party - September 14th
Christening - October 18th
Halloween - October 31st`);
}
});
Upvotes: 3
Views: 4334
Reputation: 1866
2021 update: With the new reply feature, it is possible to avoid mentioning ("pinging") the users whose message you are replying to. You just have to set the allowedMentions
for repliedUser
to false
:
reaction.message.reply({
content: 'Your message here',
allowedMentions: {
repliedUser: false
}
} as ReplyMessageOptions);
Upvotes: 5
Reputation: 935
Instead of doing message.reply
do message.channel.send
client.on('message', msg => {
if (msg.content === '!events') {
msg.channel.send('Birthday party - September 14th Christening - October 18th Halloween - October 31st');
}
});
Upvotes: 3