Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 70f1fef

Browse files
author
Benjamin O'Brien
committed
🩹 Final 1.3 Patch 🩹
1 parent baeca8f commit 70f1fef

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

assets/prism.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,23 @@ async def error_handler(ctx, error):
108108

109109
return await ctx.send(embed = Tools.error(f"You need the {str(error).split('sing ')[1].split(' per')[0]} permission(s) to use this command."))
110110

111-
elif "Forbidden: 403 Forbidden" in str(error):
111+
elif isinstance(error, commands.CommandNotFound):
112+
113+
return
114+
115+
elif "403" in str(error):
112116

113117
try:
114118

115-
return await ctx.send(embed = Tools.error("I'm either missing permission(s) or that user is higher than me."))
119+
return await ctx.send(embed = Tools.error("Missing permission(s)."))
116120

117121
except:
118122

119123
pass
120124

121125
elif "NoSuchUser" in str(error):
122126

123-
return
127+
return await ctx.send(embed = Tools.error("Couldn't find that user."))
124128

125129
await ctx.send(embed = discord.Embed(title = "Unexpected Error", description = "The command you just used generated an unexpected error.\nPrism has sent an automatic bug report about this problem.\n\nIn the meantime, try some of our other commands. :)", color = 0xFF0000))
126130

@@ -414,10 +418,6 @@ def bought(name, amount):
414418

415419
async def getClosestUser(ctx, user, return_member = False):
416420

417-
if ctx.author.id == user.id:
418-
419-
user = ctx.author.id
420-
421421
user = str(user)
422422

423423
matcher = StringMatcher()
@@ -464,9 +464,7 @@ async def getClosestUser(ctx, user, return_member = False):
464464

465465
if not matches:
466466

467-
await ctx.send(embed = Tools.error("Couldn't find that user."))
468-
469-
raise AttributeError("NoSuchUser")
467+
raise ValueError("NoSuchUser")
470468

471469
id = int(max(matches.items(), key = itemgetter(1))[0])
472470

commands/misc/profile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def profile(self, ctx, user = None):
2020

2121
db = loads(open("db/users", "r").read())
2222

23-
user = Tools.getClosestUser(ctx, user if user else ctx.author)
23+
user = await Tools.getClosestUser(ctx, user if user else ctx.author)
2424

2525
if not str(user.id) in db:
2626

0 commit comments

Comments
 (0)