O
O
old_stalin2020-09-20 16:30:09
Python
old_stalin, 2020-09-20 16:30:09

How to make a discord bot accept a command of 2 words?

I want to make it so that my bot can accept commands from 2 words !clear all, and not just !clear
async def clear(ctx, amount=1):
await ctx.channel.purge(limit=amount)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shurshur, 2020-09-20
@old_stalin

Make a clear command with a parameter and ignore if the parameter is not equal to all:

@bot.command(name='clear')
async def clear_all(ctx, arg=None)
  if arg != 'all': return
  ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question