Answers for "discord.py args"

1

define args discord

if (!message.content.startsWith(prefix) || message.author.bot) return;

const args = message.content.slice(prefix.length).trim().split(' ');
const command = args.shift().toLowerCase();
Posted by: Guest on December-20-2020
0

how to add multiple arguments in discord commands rewrite

@bot.command()
async def args(ctx, arg1, arg2):
    await bot.say('You sent {} and {}'.format(arg1, arg2))
Posted by: Guest on July-07-2020
1

discord.py optional argument

@client.command()
async def hellothere(ctx, *, msg):
    await ctx.send("General Kenobi")
#to add an optional Argument simply add an =None (anything else alowed to) after msg
#the * means that it gives you everthing after the command
async def hellothere(ctx, *, msg=''):
Posted by: Guest on December-11-2020

Browse Popular Code Answers by Language