Commit be095ac2 authored by Ferdinand Schober's avatar Ferdinand Schober 💬
Browse files

basic bot commands

parent 7e16b8ad
import discord
from pprint import pprint
from discord.ext import commands
with commands.Bot(command_prefix='!') as client:
@client.event
async def on_ready():
bot = commands.Bot(command_prefix='$')
@bot.event
async def on_ready():
print('Bot is ready')
werwolf_server = await(bot.fetch_guild('696079221684175001'))
print(f'members: {[member.name for member in await(werwolf_server.fetch_members().flatten())]}')
@bot.event
async def on_member_join(member):
print(f'{member} has joined a server')
@bot.event
async def on_member_remove(member):
print(f'{member} has left a server')
@bot.command()
async def echo(ctx, *, args):
await ctx.send(args)
@bot.command()
async def ping(ctx):
await ctx.send('pong')
@bot.command()
async def clear(ctx, amount=2):
await ctx.channel.purge(limit=amount)
bot.run('Njk2MTEyNTQ1MDgxMDY1NTU0.Xoj_iQ.VXMY9AUo56o_k-QgLSUWtPldhjE')
def start_game(players):
werwolf_players = [WerwolfPlayer(player.id) for player in players]
class WerwolfPlayer:
def __init__(self, id)
self.id = id
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment