問題描述
我正在嘗試創建一個服務器信息命令,我希望它還顯示服務器名稱、提升計數、提升成員和其他一些東西.
I am trying to make a server info command and I want it to display the server name, boost count, boost members and some other stuff as well.
唯一的問題是我查看了文檔并在線搜索,但我無法找到如何找到提升信息.
Only problem is I have looked at the docs and searched online and I cant find out how to find the boost information.
我沒有任何代碼,因為我沒有找到任何代碼可供自己嘗試和使用
I dont have any code as Ive not found any code to try and use for myself
有什么方法可以得到這些信息嗎?
Is there any way to get this information?
推薦答案
公會名稱 - guild_object.name
提升計數 - guild_object.premium_subscription_count
Boosters,提升服務器的人 - guild_object.premium_subscribers
Boosters, the people who boosted the server - guild_object.premium_subscribers
如果您按照我的假設在命令中執行此操作,請使用 ctx.guild
而不是 guild_object
.如需進一步了解,您可以重新閱讀文檔,因為上述所有信息都在 discord.Guild
If your doing this in a command as I assume, use ctx.guild
instead of guild_object
. For anything further, you can re-read the docs as all of the above information is in it under the discord.Guild
這篇關于獲取服務器 discord.py 中的提升次數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!