“diskord.py Clear Command” Code-Antworten

diskord.py Clear Command

@client.command()
async def clear(ctx, amount=5):
	await ctx.channel.purge(limit=ammount)
Soupyy

Diskord.py Clear Command

@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 = "\n".join([f"{author}:{amount}" for author,
                     amount in authors.items()])
    await ctx.channel.send(msg)```
Friendly Flamingo

diskord.py Clear Command

channel = client.get_channel(7598437678956783)
await channel.purge(limit=1)
Da Minty

Discord.py Clear

@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)
TrimB24

Ähnliche Antworten wie “diskord.py Clear Command”

Fragen ähnlich wie “diskord.py Clear Command”

Weitere verwandte Antworten zu “diskord.py Clear Command” auf Python

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen