I have a command that I made to choose a random member for the server, but for some reason, whenever I run it, it only mentions itself.. As if it cannot detect that there are other members in the server besides itself. Here is the code: ok
client = commands.Bot(command_prefix=['%', "v", "V"],
case_insensitive=True,
help_command=None)
intents = discord.Intents().all()
intents = True
@client.event
async def on_ready():
print('Bot is Online! ;)')
servers = len(client.guilds)
members = 0
for guild in client.guilds:
members += guild.member_count - 1
await client.change_presence(activity=discord.Activity(
type=discord.ActivityType.watching,
name=f'{servers} servers and {members} members | %help'))
@client.command()
async def choosemem(ctx):
guild = ctx.guild
await ctx.send(f"{random.choice(guild.members).mention} has been chosen")
This Is the full code, including the status, and the intents.