简体   繁体   English

如何获取我的 discord 机器人所在的公会列表?

[英]How can I get the list of guilds my discord bot is in?

I want to know if I can get a list of guild IDs my bot is in. Basically, a command that returns a mesage containing all of the guild IDs the bot is currently in.我想知道我是否可以获得我的机器人所在的公会 ID 列表。基本上,一个命令返回一条消息,其中包含机器人当前所在的所有公会 ID。

Discord JS v12 Discord JS v12

message.channel.send(client.guilds.cache.map(guild => guild.id).join(", \n"));

Discord JS v11 Discord JS v11

message.channel.send(client.guilds.map(guild => guild.id).join(", \n"));

I want to know if I can get a list of guild IDs my bot is in. Basically, a command that returns a mesage containing all of the guild IDs the bot is currently in.我想知道我是否可以获得我的机器人所在的公会 ID 列表。基本上,一个返回包含机器人当前所在的所有公会 ID 的消息的命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM