Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. import discord
  2. from discord.ext import commands
  3. import random
  4.  
  5. bot = commands.Bot(command_prefix='.')
  6. bot.remove_command('help')
  7. #205346839082303488 id
  8.  
  9. @bot.event
  10. async def on_ready():
  11. await bot.change_status(game=discord.Game(name='.help'))
  12. print('Logged in as')
  13. print(bot.user.name)
  14. print(bot.user.id)
  15. print('------')
  16.  
  17.  
  18. @bot.event
  19. async def on_message(ctx):
  20. msg = ctx
  21. print(str(msg.timestamp)[:16], msg.server.name + ':' + msg.channel.name, msg.author, msg.content)
  22.  
  23. await bot.process_commands(ctx)
  24.  
  25. async def do_removal(message, limit, predicate):
  26. if message.channel.permissions_for(message.author).manage_messages or message.author.id == '205346839082303488':
  27. await bot.purge_from(message.channel, limit=limit, before=message, check=predicate)
  28. else:
  29. await bot.say('not enuff perms')
  30.  
  31. @bot.command(pass_context=True)
  32. async def purge(ctx, amount: int, member: discord.Member=None):
  33. await do_removal(ctx.message, int(amount), lambda e: e == member)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement