问题描述
我有一个不和谐的机器人,我只是想知道:我如何找出该机器人有多少个行会?这样,如果我说-公会
,它会告诉我其中有多少个公会。
I have a discord bot, and I was just wondering: how do I find out how many guilds the bot is in? So that if I say -guilds
it'll tell me how many guilds it's in.
推荐答案
我将命令留给您,但是要获取漫游器的可用公会,必须使用< Client> .guilds
。
I'll leave the command up to you, but to get the bot's available guilds, you must use <Client>.guilds
.
这是行会的集合,因此要获取集合的大小,您要做的就是< Client> .guilds.size
This is a collection of guilds so to get the size of a collection all you have to do is <Client>.guilds.size
此信息也位于。
我希望这会有所帮助!
-Trifex
在评论中,指出,截至.js v12,检索机器人所属的所有公会集合的正确方法是< Client> .guilds.cache
,这意味着获取公会的大小您必须使用< Client> .guilds.cache.size
!
In the comments, @NicoHd105 noted that as of discord.js v12, the proper way to retrieve a collection of all guilds a bot is part of is <Client>.guilds.cache
, meaning to get the size of the guilds you must use <Client>.guilds.cache.size
!
这篇关于我如何找到我的机器人所在的公会数量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!