discord.js guildmemberadd-get-guild

biswetbf  于 2021-09-23  发布在  Java
关注(0)|答案(2)|浏览(423)

如何从discord.js中触发的guildmemberadd事件中获取公会id?
查看了discord.js文档,但找不到任何关于获得公会的信息,只有成员。

p5fdfcr1

p5fdfcr11#

使用guildmember.guild

client.on('guildMemberAdd', member => {
let { guild } = member //guild is now the member's guild
})
rsl1atfo

rsl1atfo2#

您可以使用<guildmember.guild>
例子:

client.on('guildMemberAdd', member => {
   let guild = member.guild;
})

相关问题