【问题标题】:Discord.py bot only displaying 1 member in all guildsDiscord.py 机器人在所有公会中仅显示 1 个成员
【发布时间】:2022-06-15 08:36:54
【问题描述】:

我的 Discord 机器人设置为在其存在时显示成员计数,但它仅显示用户计数的数字 1,但我在服务器中有 2 个成员可以看到机器人。我已在应用程序仪表板上启用状态和成员意图。

import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.members = True
intents.presences = True
bot = commands.Bot(command_prefix="!", intents=intents, activity=discord.Activity(
    type=discord.ActivityType.watching, name=f"{len([discord.client.Guild.members])} users"), status=discord.Status.do_not_disturb)

bot.run("")

【问题讨论】:

  • 尝试使用discord.Intents.all()?

标签: python discord.py bots


猜你喜欢
  • 1970-01-01
  • 2021-04-30
  • 2021-10-14
  • 2020-11-11
  • 2021-02-27
  • 2021-09-05
  • 2021-01-29
  • 2021-03-14
  • 1970-01-01
相关资源
最近更新 更多