discord.py commands code example
Example 1: Discord.py bot example
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='prefix here')
@bot.event
async def on_ready():
print('Logged in as: ' + bot.user.name)
print('Ready!\n')
@bot.command()
async def commandname(ctx, *, somevariable)
Code goes here
await ctx.send('Message')
bot.run('yourtoken')
Example 2: 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))