python - 有没有办法用 discord.py 列出不和谐服务器的所有成员
问题描述
我想检索包含不和谐服务器一部分的所有人的列表。
import discord
from discord.ext import commands
TOKEN = 'my_token'
bot = commands.Bot(command_prefix = '!')
@bot.command()
async def members(ctx):
for member in ctx.guild.members:
await ctx.send(member)
bot.run(TOKEN)
每当使用 !members 时,我都会得到一个当前在语音频道中或以某种方式在服务器上处于活动状态的所有成员的列表,但我想让那些刚刚显示为在线甚至离线的成员。有人有什么想法吗?
解决方案
推荐阅读
- sharepoint - 使用 spfx 在 SharePoint Web 部件中显示 SP 项目附件
- python - 如何将超链接添加到 RichToolTip?
- c# - 使用多态对象创建时出现继承错误
- java - Linux Java 应用程序内存泄漏检测
- c# - WNetAddConnection2 在某些站点中失败,错误代码为 1326,而网络使用成功
- sql - 将多行的属性合并为一行
- javascript - 如何使用 javascript 一遍又一遍地创建函数和图像标签?
- java - 如何从母目录执行两个不同子目录中的两个java文件
- python - ValueError:“ConcreteFunction”的所有输入都必须是张量
- javascript - SocketIO App 在 Heroku 上表现异常但在本地工作