最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Auto-reply to direct messages - Stack Overflow

programmeradmin0浏览0评论

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')
})
发布评论

评论列表(0)

  1. 暂无评论