SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 107 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import discord
  2. from discord.ext import commands
  3. import random
  4.  
  5.  
  6. client = commands.Bot(command_prefix = '.')
  7. client.remove_command('help')
  8.  
  9.  
  10. @client.event
  11. async def on_ready():
  12.     print('Ready.')
  13.  
  14.  
  15. @client.event
  16. async def on_member_join(member):
  17.     print(f'{member} has joined a server.')
  18.  
  19. @client.event
  20. async def on_member_remove(member):
  21.     print(f'{member} has left a server.')
  22.  
  23. @client.command()
  24. async def ping(ctx):
  25.     await ctx.send (f'Pong! `{round(client.latency * 1000)}ms`')
  26.  
  27.  
  28. @client.command(aliases=['8ball'])
  29. async def _8ball(ctx, *, question):
  30.     responses = [
  31.         'It is certain.',
  32.         'It is decidedly so.',
  33.         'Without a doubt.',
  34.         'Yes - definitely.',
  35.         'You may rely on it.',
  36.         'As I see it, yes.',
  37.         'Most likely.',
  38.         'Outlook good.',
  39.         'Yes.',
  40.         'Signs point to yes.',
  41.         'Reply hazy, try again.',
  42.         'Ask again later.',
  43.         'Better not tell you now.',
  44.         'Cannot predict now.',
  45.         'Concentrate and ask again.',
  46.         'Do not count on it.',
  47.         'My reply is no.',
  48.         'My sources say no.',
  49.         'Outlook not so good.',
  50.         'Very doubtful.']
  51.  
  52.     await ctx.send(f'Question: {question}\nAnswer: {random.choice(responses)}')
  53.  
  54.  
  55.  
  56. @client.command()
  57. @commands.has_permissions(manage_message=True)
  58. async def clear(ctx, amount=10):
  59.     await ctx.channel.purge(limit=amount)
  60.     print('Test')
  61.  
  62.  
  63.  
  64. @client.command()
  65. @commands.has_permissions(manage_message=True)
  66. async def kick(ctx, member : discord.Member, *, reason=None):
  67.     await member.kick(reason=reason)
  68.     await ctx.send(f'`Kicked {member.mention}!`')
  69.  
  70.  
  71.  
  72. @client.command()
  73. @commands.has_permissions(manage_message=True)
  74. async def ban(ctx, member : discord.Member, *, reason=None):
  75.     await member.ban(reason=reason)
  76.     await ctx.send(f'`Banned {member.mention}!')
  77.  
  78.  
  79.  
  80.  
  81. @client.command()
  82. @commands.has_permissions(manage_message=True)
  83. async def unban(ctx, *, member):
  84.  
  85.     banned_users = await ctx.guild.bans()
  86.  
  87.     for ban_entry in banned_users:
  88.  
  89.         user = ban_entry.user
  90.  
  91.         await ctx.guild.unban(user)
  92.  
  93.         await ctx.send(f'`Unbanned user!`')
  94.  
  95.  
  96. @client.command()
  97. async def embed(ctx, member: discord.Member):
  98.     embed = discord.Embed(colour=member.color, timestamp=ctx.message.created_at)
  99.  
  100.     embed.add_field(name=f'{member}', value='Yes daddy.. sorry')
  101.  
  102.     await ctx.send(embed=embed)
  103.  
  104. @client.command()
  105. async def help(ctx):
  106.     embed = discord.Embed(description='Commands')
  107.     embed.add_field(name='Embed', value=embed_description)
  108.     await ctx.send(embed=embed)
  109.  
  110.  
  111.  
  112. client.run('')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top