Get the number of boosts in a server discord.py(获取服务器 discord.py 中的提升次数)
问题描述
我正在尝试创建一个服务器信息命令,我希望它还显示服务器名称、提升计数、提升成员和其他一些东西.
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 中的提升次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:获取服务器 discord.py 中的提升次数


基础教程推荐
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 筛选NumPy数组 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01