[Core] Fix error message about guild-only command and add dm-only error message (#3057)

* enhance(core): fix guild-only error message, add dm-only error message

* chore(changelog): add towncrier entries
This commit is contained in:
jack1142 2019-10-16 14:17:04 +02:00 committed by Michael H
parent 428bf55480
commit d42a2d5140
3 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1 @@
Bot will now properly send a message when the invoked command is guild-only.

View File

@ -0,0 +1 @@
Bot will now send a message when the invoked command is DM-only.

View File

@ -234,10 +234,12 @@ def init_events(bot, cli_flags):
elif isinstance(error, commands.UserFeedbackCheckFailure):
if error.message:
await ctx.send(error.message)
elif isinstance(error, commands.CheckFailure):
pass
elif isinstance(error, commands.NoPrivateMessage):
await ctx.send("That command is not available in DMs.")
elif isinstance(error, commands.PrivateMessageOnly):
await ctx.send("That command is only available in DMs.")
elif isinstance(error, commands.CheckFailure):
pass
elif isinstance(error, commands.CommandOnCooldown):
await ctx.send(
"This command is on cooldown. Try again in {}.".format(