如何在 ids discord.py 附近列出我所有的机器人公会名称
How to list all of my bot guild names near the ids discord.py
如何列出所有公会 ID 和名称而不是一个?
@client.command()
async def guilds(ctx):
for guild in client.guilds:
em=discord.Embed(title="GUILD IDS",description=f"{[guild.name + ' : '+ str(guild.id)]}")
await ctx.send(embed=em)
你可以这样使用:
@client.command()
async def commandname(ctx):
listGuild = []
for guild in client.guilds:
listGuild.extend(f"{guild.name}:{guild.id}")
print(listGuild)
如何列出所有公会 ID 和名称而不是一个?
@client.command()
async def guilds(ctx):
for guild in client.guilds:
em=discord.Embed(title="GUILD IDS",description=f"{[guild.name + ' : '+ str(guild.id)]}")
await ctx.send(embed=em)
你可以这样使用:
@client.command()
async def commandname(ctx):
listGuild = []
for guild in client.guilds:
listGuild.extend(f"{guild.name}:{guild.id}")
print(listGuild)