Browse Source

fixed error that reintroduced emoticons activating commandnotfound

tags/v2.1.0
Roxie Gibson 5 years ago
parent
commit
cf672fa3cb
2 changed files with 7 additions and 4 deletions
  1. +2
    -1
      CHANGELOG.md
  2. +5
    -3
      roxbot/core.py

+ 2
- 1
CHANGELOG.md View File

@@ -3,7 +3,6 @@
#### New features
- New 8-ball command due to Roxbot's new found vision of the future. She requested this.


#### Bug fixes and changes
- Fixed some settings commands editing the wrong setting the backend
- Fixed NSFW commands not handling errors properly
@@ -11,6 +10,8 @@
- Permission checking was really broken. Phew no one noticed :sweat:
- Fixed dumb issue with trivia not picking loading custom emojis
- Fixed bug where `;avatar` didn't return animated pfp correctly
- Fixed reintroduced bug that made emoticons trigger Roxbot's `CommandNotFound` response
- Frogtips' Croaks should not longer return error at end of lifespan

## v2.0.3


+ 5
- 3
roxbot/core.py View File

@@ -139,7 +139,9 @@ class ErrorHandling:
is_custom_command = bool(ctx.invoked_with in cc["1"] or ctx.invoked_with in cc["2"])
is_emoticon_face = bool(any(x in string.punctuation for x in ctx.message.content.strip(ctx.prefix)[0]))
is_too_short = bool(len(ctx.message.content) <= 2)
if is_custom_command or is_emoticon_face or is_too_short:
if is_emoticon_face:
return None
if is_custom_command or is_too_short:
return None
else:
return error.args[0]
@@ -199,13 +201,13 @@ class ErrorHandling:
embed.add_field(name='User', value=ctx.author)
embed.add_field(name='Message', value=ctx.message.content)
embed.timestamp = datetime.datetime.utcnow()
elif isinstance(error, commands.CommandError):
elif isinstance(error, commands.CommandError) and not bool(case is None and user_error_case is None):
embed.description = "Error: {}".format(error.args[0])
roxbot.logger.error(embed.description)
else:
roxbot.logger.error(str(error))

if embed:
if embed.description:
embed.colour = roxbot.EmbedColours.dark_red
await ctx.send(embed=embed)


Loading…
Cancel
Save