I have this code where I want it so that when I say p!serverlist it would print out the servers that it's in. I don't know how to "append" the servers in my variable a.
p!serverlist
if message.content.startswith('p!serverlist'): a = '' e = 0 await message.channel.send('**Servers that I am in**') for guild in client.guilds: await a.append(f' `{guild.name}` ') e += 1 await message.channel.send(a) await message.channel.send('**I am in ' + str(e) + ' servers!**')```
You don't .append it. You just use the += operator.
.append
+=
a += f' {guild.name} '
1.4m articles
1.4m replys
5 comments
56.9k users