just wondering how an I have 2 arguments, for example
User: ?text A B Bot: A B
Like “arg1” and “arg2” Example:
await bot.say({} {}.format(arg1, arg2))
Advertisement
Answer
For 2 args as 2 separate variables you could do something like this
@bot.command() async def args(ctx, arg1, arg2): await ctx.send('You sent {} and {}'.format(arg1, arg2))
Or if you want to send all args passed as a list you could do… as per the rewrite documentation:
@bot.command() async def args(ctx, *args): await ctx.send('`{}` arguments: `{}`'.format(len(args), ', '.join(args)))
Or if you want to send everything as one argument you could do (documentation):
@bot.command() async def args(ctx, *, arg): await ctx.send(arg)