Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- import random
- client = commands.Bot(command_prefix = '.')
- client.remove_command('help')
- @client.event
- async def on_ready():
- print('Ready.')
- @client.event
- async def on_member_join(member):
- print(f'{member} has joined a server.')
- @client.event
- async def on_member_remove(member):
- print(f'{member} has left a server.')
- @client.command()
- async def ping(ctx):
- await ctx.send (f'Pong! `{round(client.latency * 1000)}ms`')
- @client.command(aliases=['8ball'])
- async def _8ball(ctx, *, question):
- responses = [
- 'It is certain.',
- 'It is decidedly so.',
- 'Without a doubt.',
- 'Yes - definitely.',
- 'You may rely on it.',
- 'As I see it, yes.',
- 'Most likely.',
- 'Outlook good.',
- 'Yes.',
- 'Signs point to yes.',
- 'Reply hazy, try again.',
- 'Ask again later.',
- 'Better not tell you now.',
- 'Cannot predict now.',
- 'Concentrate and ask again.',
- 'Do not count on it.',
- 'My reply is no.',
- 'My sources say no.',
- 'Outlook not so good.',
- 'Very doubtful.']
- await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}')
- @client.command()
- @commands.has_permissions(manage_message=True)
- async def clear(ctx, amount=10):
- await ctx.channel.purge(limit=amount)
- print('Test')
- @client.command()
- @commands.has_permissions(manage_message=True)
- async def kick(ctx, member : discord.Member, *, reason=None):
- await member.kick(reason=reason)
- await ctx.send(f'`Kicked {member.mention}!`')
- @client.command()
- @commands.has_permissions(manage_message=True)
- async def ban(ctx, member : discord.Member, *, reason=None):
- await member.ban(reason=reason)
- await ctx.send(f'`Banned {member.mention}!')
- @client.command()
- @commands.has_permissions(manage_message=True)
- async def unban(ctx, *, member):
- banned_users = await ctx.guild.bans()
- for ban_entry in banned_users:
- user = ban_entry.user
- await ctx.guild.unban(user)
- await ctx.send(f'`Unbanned user!`')
- @client.command()
- async def embed(ctx, member: discord.Member):
- embed = discord.Embed(colour=member.color, timestamp=ctx.message.created_at)
- embed.add_field(name=f'{member}', value='Yes daddy.. sorry')
- await ctx.send(embed=embed)
- @client.event
- async def on_command_error(ctx, error):
- if isinstance(error, commands.MissingRequiredArgument):
- await ctx.send('Please put in all required arguments, if you want this command to work :).')
- elif isinstance(error, commands.CommandNotFound):
- await ctx.send('Command not found.')
- @client.command()
- async def help(ctx):
- embed = discord.Embed(description='Commands')
- embed.add_field(name='Embed', value=embed_description)
- await ctx.send(embed=embed)
- client.run(ErXCKAJn3Sm195qeDHaiR-6o')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement