1

How could I change this command to check the custom status of all the members in the server instead of just checking the custom status of the person that wrote the command

The code that works gets my custom status which was test and it prints it out perfectly fine. I just want to know if/how I could get the custom status of everyone in the server.

@bot.command()
async def checkstatus(ctx):
    for status in ctx.author.activities:
        if isinstance(status, discord.CustomActivity):
            print(status)
Logged in as vanity#####
test
Dom
  • 33
  • 4

2 Answers2

3

You can iterate through all the members in your server (ctx.guild) in another for loop.

@bot.command()
async def checkstatus(ctx):
    for member in ctx.guild.members: # for every member in the server,
        for status in member.activities: # for every status that member has..
            # then the rest of your code below

Do also note that you need to enable member intents to view all the members.

Bagle
  • 2,326
  • 3
  • 12
  • 36
0

Are you trying to use a selfbot? If yes, they are against ToS, but you could use discord.py-self

Vinium
  • 21
  • 3