如何使Discord.JS机器人对其自身的直接消息作出反应? [英] How do I make my Discord.JS bot react to it's own Direct Message?
本文介绍了如何使Discord.JS机器人对其自身的直接消息作出反应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我制作我的机器人时,我想制作它,以便当您键入 afv!support
时,它将发送一个DM,如下所示: DM示例
When I'm making my bot, I want to make it so that when you type afv!support
it will send a DM like this:
DM example
Thanks for contacting AFV support. Please react below for which problem you have.
:one: Ban Appeal
:two: Bug Report
:three: Report Staff/User
This command will expire in two minutes.
,然后与:one:,:two:和:three:反应.我环顾四周,但没有找到答案.
and then react with :one:, :two:, and :three:. I've looked around but haven't found the answer.
感谢您的帮助!
推荐答案
发送消息到目标,将消息传递到 .then()
,机器人将在其中对消息做出反应
Send a message to your target, pass the message into a .then()
, Where the bot will react to the message
message.member.send(<theMessage>).then(msg => {
msg.react('<emoji>')
msg.react('<emoji>')
msg.react('<emoji>')
})
这篇关于如何使Discord.JS机器人对其自身的直接消息作出反应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文