Python Discord Bot
Archived 3 years ago
J
JustWait
Verified
`from requests import post
import subprocess
import discord
import subprocess
import sys
import time
guild_id = ... #Server Id
alive = True
token ='...Y'
intents = discord.Intents.default()
intents.message_content = True
allowed_roles = ['Rekrut {1}', 'Role2', 'Role3'] # Liste der Rollen, auf die der Bot reagieren darf
client = discord.Client(intents=intents)
@client.event
async def on_ready():
print('Bot is ready.')
@client.event
async def on_message(message):
global alive
if message.author == client.user:
return
if message.guild is not None and message.channel.name == 'testarmee':
if alive == False:
if '/mod.start=bot' in message.content:
await message.channel.send('Bot is ready...')
alive = True
else:
if any(role.name in allowed_roles for role in message.author.roles):
if '/mod.bot=list' in message.content:
#await message.channel.send(list_all_members())
guild = client.get_guild(guild_id)
members = guild.members
for member in members:
print(member.name)
client.run(token)
why will it just list 4 members of 600?`
