How to list all of the guild ids and names instead of one?
@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)
>Solution :
You can use something like this:
@client.command()
async def commandname(ctx):
listGuild = []
for guild in client.guilds:
listGuild.extend([guild.id, guild.name])
print(listGuild)