mirror of
https://github.com/Octech2722/jeevesbot.git
synced 2026-02-04 11:42:43 -06:00
17 lines
620 B
Python
17 lines
620 B
Python
import discord
|
|
from discord.ext import commands
|
|
|
|
class Clear(commands.Cog):
|
|
|
|
def __init__(self, client):
|
|
self.client = client
|
|
|
|
@commands.command() # Creates a command just as you would in the bot.py file
|
|
@commands.has_permissions(manage_messages=True)
|
|
async def clear(self, ctx, amount=1):
|
|
print(f'The user "{ctx.author.name}" in "{ctx.guild}" called the clear command!')
|
|
await ctx.channel.purge(limit=amount)
|
|
print(f'The user "{ctx.author.name}" removed {amount} message(s) in "{ctx.guild}" "{ctx.channel}" channel!')
|
|
|
|
def setup(client):
|
|
client.add_cog(Clear(client)) |