How would I find and store all of the users UserID's in a discord server?
@client.event
async def on_message(message):
if message.content.startswith("##kickrandom"):
await client.send_message(message.channel, "Kicking a random user in 30 seconds...")
Each user only has 1 ID, so you can get a full list of members on the server and grab the ID of each
ids = []
for m in server.members:
ids.append(m.id)
Python has a tool to do this quickly called list compression.
ids = [m.id for m in server.members]
However, if you just want to kick a random member, you can just use
target = random.choice(list(server.members))