I'm new to python, I'm getting an error in the title. I know what the problem is but I want to make one command providing different results based on what arguements the user provided in the command.
Like for example if it's going to be '!sens 20 cm 800 dpi' the bot replies '{} ingame' but if '!sens 10 ingame 800 dpi' the bot replies '{} cm'
I dont want to make two commands with different names.
import math
import discord
from discord.ext import commands
TOKEN = ''
bot = commands.Bot(command_prefix='!')
d= 166461.6
@bot.command(name="sens")
async def sens_cm(ctx, x: float,cm, y: float,dpi):
await ctx.send('{} ingame'.format(d/(x*y)))
@bot.command(name="sens")
async def sens(ctx, x1: float,ingame, y1: float,dpi):
await ctx.send('{} cm'.format(d/(x1*y1)))
bot.run(TOKEN)