Files
discord-jeeves/cogs/admin.py

32 lines
595 B
Python
Raw Normal View History

2021-08-07 14:58:24 +02:00
import discord
from discord.ext import commands
import log
2021-08-07 14:58:24 +02:00
# setup logging
logger = log.get_logger(__name__)
embed = discord.Embed()
2021-08-07 14:58:24 +02:00
class Admin(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command()
@commands.is_owner()
async def clear(self, ctx, amount=1):
await ctx.channel.purge(limit=amount)
logger.warn(f'{ctx.message.author.name} cleared {amount} messages')
@commands.Cog.listener()
async def on_ready(self):
print('##### ADMIN module active')
def setup(bot):
bot.add_cog(Admin(bot))