I'm trying to get my bot to reply to a specific mand, but I don't want him to mention the user who uses the mand 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`);
}
});
I'm trying to get my bot to reply to a specific mand, but I don't want him to mention the user who uses the mand 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`);
}
});
Share
Improve this question
edited Aug 14, 2019 at 19:25
Mikhail Zhuikov
1,2582 gold badges9 silver badges23 bronze badges
asked Aug 14, 2019 at 18:39
swizzlesticksswizzlesticks
391 silver badge2 bronze badges
2 Answers
Reset to default 52021 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);
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');
}
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742311316a4419949.html
评论列表(0条)