When I execute the command using my current code, I get the error NameError: name 'offline' is not defined
. I can’t find the correct variables to make it work properly.
JavaScript
x
6
1
@bot.command()
2
async def D(ctx):
3
for user in ctx.guild.members:
4
if user.status != offline:
5
print (user.name+"#"+user.discriminator)
6
Advertisement
Answer
According to the API reference, you could use
JavaScript
1
2
1
if user.status != discord.Status.offline
2
PS. I know nothing about this library, yet I tried searching the docs. Give it a try from now on :)