javascript - Auto-reply to direct messages - Stack Overflow

So I've been trying to do something so if someone dm's you, it'll reply with a message.E

So I've been trying to do something so if someone dm's you, it'll reply with a message.

Example:

Friend: Hey

Bot: I'm afk

Something like that so basically when someone sends a message to your dms the bot will reply a message saying something.

So I've been trying to do something so if someone dm's you, it'll reply with a message.

Example:

Friend: Hey

Bot: I'm afk

Something like that so basically when someone sends a message to your dms the bot will reply a message saying something.

Share Improve this question edited Dec 5, 2018 at 14:59 Federico Grandi 6,7865 gold badges33 silver badges51 bronze badges asked Dec 5, 2018 at 1:02 Jackson4765Jackson4765 111 silver badge2 bronze badges 1
  • 2 Wele to Stack Overflow ! What exactly is your question ? We can't seem to find it in your post – GMB Commented Dec 5, 2018 at 1:28
Add a ment  | 

2 Answers 2

Reset to default 4

Without breaking Discord TOS you can't. Because you would need to have a userbot or selfbot. Basically its some bot that acts as the user (in your case reading the messages). And most libraries are dropping the support for selfbots.
For reference: https://support.discordapp./hc/en-us/articles/115002192352-Automated-user-accounts-self-bots-

Automating normal user accounts (generally called "self-bots") outside of the OAuth2/bot API is forbidden, and can result in an account termination if found.

Use client.on and provide a callback function as such:

client.on('message', message => {
  if (message.content.startsWith('Hey'))
    target.send('im afk')
})

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744785192a4593580.html

相关推荐

  • javascript - Auto-reply to direct messages - Stack Overflow

    So I've been trying to do something so if someone dm's you, it'll reply with a message.E

    11小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信