Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord
- from discord.ext import commands
- import random
- bot = commands.Bot(command_prefix='.')
- bot.remove_command('help')
- #205346839082303488 id
- @bot.event
- async def on_ready():
- await bot.change_status(game=discord.Game(name='.help'))
- print('Logged in as')
- print(bot.user.name)
- print(bot.user.id)
- print('------')
- @bot.event
- async def on_message(ctx):
- msg = ctx
- print(str(msg.timestamp)[:16], msg.server.name + ':' + msg.channel.name, msg.author, msg.content)
- await bot.process_commands(ctx)
- async def do_removal(message, limit, predicate):
- if message.channel.permissions_for(message.author).manage_messages or message.author.id == '205346839082303488':
- await bot.purge_from(message.channel, limit=limit, before=message, check=predicate)
- else:
- await bot.say('not enuff perms')
- @bot.command(pass_context=True)
- async def purge(ctx, amount: int, member: discord.Member=None):
- await do_removal(ctx.message, int(amount), lambda e: e == member)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement