shayypy / guilded.py

Asynchronous Guilded API wrapper for Python
https://guildedpy.rtfd.io
Other
135 stars 25 forks source link

Single backslash rstripped in input #54

Open YumYummity opened 1 year ago

YumYummity commented 1 year ago

Describe the bug A single backslash can be placed at the end of an integer. EG. -slots 200000\ results in the same thing as -slots 200000

To Reproduce

# using guilded.ext.commands.Bot
@bot.command(name='slots')
async def testcode(ctx, amount:int):
    await ctx.reply(str(amount), private=ctx.message.private)

Afterwards, just run -slots 200000\

Expected behavior Raise an error: Converting to "int" failed for parameter "amount".

Actual behavior Command runs as if the backslash isn't there.

Screenshots image

Environment

shayypy commented 1 year ago

Not sure what's causing this, it's stripped from string arguments too. Seems fairly inconsequential but I'll keep it open as a reminder to look into it.

YumYummity commented 1 year ago

This only happens for a single backslash, and it gives the correct input if you have 2 or more backslashes.