Skip to content

Commit 6cfe365

Browse files
authored
Merge pull request #4 from PyBotDevs/archisha69-patch-2
Use a more suitable exception type for invalid arguments
2 parents 7d6ad69 + 10f58f9 commit 6cfe365

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cogs/q.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import discord, base64, brainfuck #pip install brainfuck-interpreter
22
from discord.ext import commands
33
from discord.ext.commands import *
4+
from discord.errors import InvalidArgument
45

56
class ex(commands.Cog):
67
def __init__(self, client:commands.Bot):
@@ -22,6 +23,6 @@ async def a(self, ctx, c, *, data):
2223
return await ctx.reply(base64.b64decode(data).decode("UTF-8"))
2324
elif c == "bf" or c == "brainfk" or c == "brainfuck":
2425
return await ctx.reply(brainfuck.evaluate(data))
25-
else: raise BadArgument
26+
else: raise InvalidArgument
2627

2728
def setup(client:commands.Bot): client.add_cog(ex(client))

0 commit comments

Comments
 (0)