Discord.py command-fehler. Kann wer helfen?
Also ich habe einen Command in meinen DC-Bot gemacht der calc heißt.
@client.command()
async def calc(ctx, x, r, y):
erg1 = float(x) + float(y)
erg2 = float(x) - float(y)
erg3 = float(x) * float(y)
erg4 = float(x) / float(y)
erg5 = float(x) ** float(y)
if r == "+":
await ctx.send(erg1)
await ctx.send('Type **l!calchelp** for a list of calculator commands')
if r == "-":
await ctx.send(erg2)
await ctx.send('Type **l!calchelp** for a list of calculator commands')
if r == "*":
await ctx.send(erg3)
await ctx.send('Type **l!calchelp** for a list of calculator commands')
if r == "/":
await ctx.send(erg4)
await ctx.send('Type **l!calchelp** for a list of calculator commands')
if r == "**":
await ctx.send(erg5)
await ctx.send('Type **l!calchelp** for a list of calculator commands')
Aber wenn ich dann !calc 10 + 10 eingebe, kommt diese Meldung:
Ignoring exception in command None:
discord.ext.commands.errors.CommandNotFound: Command "calc10+10" is not found
3 Antworten
Nett wäre wenn du erstmal sagst was er machen soll und für was die variablen stehen. Außerdem, guck sowas lieber aus stackoverflow nach da sind profis unterwegs.
Ok ich werde auf stackoverflow nachschauen. Aber hier die variablen-bedeutungen: ctx ist damit ich weiß wo der command gesendet wurde, x ist die 1 zahl r ist das rechenzeichen und y die 2 zahl
Guck mal... Dafür gibt es hier diese Quelltext-Funktion :)
Oder benutzte https://www.hastebin.com