import discord
from discord.ext import commands
from discord.utils import get
intents = discord.Intents.all()
intents.members = True
bot = commands.Bot(command_prefix=("!"), case_insensitive=True, guild_subscriptions=True, intents=intents)
@bot.event
async def on_ready():
member_list = []
for guild in bot.guilds:
for member in guild.members:
member_list.append({member.name:member.id})
print(member_list)
试试看:
确保在application中启用了意图
相关问题 更多 >
编程相关推荐