@client.command()
async def clear(ctx, amount=5):
await ctx.channel.purge(limit=ammount)
@bot.command(name='clear')
@commands.has_permissions(manage_messages=True)
async def clear(ctx, amount: int):
authors = {}
async for message in ctx.channel.history(limit=amount + 1):
if message.author not in authors:
authors[message.author] = 1
else:
authors[message.author] += 1
await message.delete()
msg = "
".join([f"{author}:{amount}" for author,
amount in authors.items()])
await ctx.channel.send(msg)```
def _status(self, ctx, *, message):
'''Set a custom playing status for the bot.'''
if message == 'clear':
return await self.change_presence(activity=None)
await self.change_presence(activity=discord.Game(message))
await ctx.send(f"Changed status to **{message}**")
@bot.command()
async def clear(ctx, amount=5):
await ctx.channel.purge(limit=amount)
or
@client.command()
async def clear(ctx, amount=5):
await ctx.channel.purge(limit=amount)