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

javascript - Create a group DM Discord.js - Stack Overflow

programmeradmin0浏览0评论

I am trying to get my bot to message two people but in the same chat window (like when you add a friend to a conversation). The only thing I've found is how to send to a single person by doing <client>.send(message); How could I add a second person to that conversation?

Any examples would be highly appreciated.

I am trying to get my bot to message two people but in the same chat window (like when you add a friend to a conversation). The only thing I've found is how to send to a single person by doing <client>.send(message); How could I add a second person to that conversation?

Any examples would be highly appreciated.

Share Improve this question edited Jun 14, 2018 at 21:20 user2896438 asked Jun 14, 2018 at 20:06 user2896438user2896438 94417 silver badges23 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 4

Discord.js doesn't really implement that because in Discord bots can't join Group DMs. You would need a self-bot (a bot that runs on a user account), but Discord doesn't want them to be used, so discord.js didn't make this options.

Therefore, at the moment there's no way to do that: the groupDMChannel class can't be used to create them, and since there's no method to do that from the client or from a DM channel I think you're stuck there :\

just taking a quick look at the Discord.js documentation, it seems they do have a GroupDMChannel class, and this seems to be what you want / need to use.

The two methods that stand out to me:

  • send
  • addUser

Where I'm assuming (I know I shouldn't!) that you have to call addUser first.

disclaimer: not going into detail, since I don't have experience using this particular module

发布评论

评论列表(0)

  1. 暂无评论