forked from sh-edraft.de/sh_discord_bot
Added error notification to level edit #103
This commit is contained in:
parent
8fafc94118
commit
b2087042bc
@ -196,6 +196,8 @@
|
|||||||
},
|
},
|
||||||
"edit": {
|
"edit": {
|
||||||
"edited": "Level {} wurde bearbeitet :D",
|
"edited": "Level {} wurde bearbeitet :D",
|
||||||
|
"color_invalid": "Die Farbe {} ist ungültig!",
|
||||||
|
"permission_invalid": "Der Berechtigungswert {} ist ungültig!",
|
||||||
"not_found": "Level {} nicht gefunden!"
|
"not_found": "Level {} nicht gefunden!"
|
||||||
},
|
},
|
||||||
"remove": {
|
"remove": {
|
||||||
|
@ -229,6 +229,7 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
try:
|
try:
|
||||||
level_from_db.color = hex(discord.Colour.from_str(color).value)
|
level_from_db.color = hex(discord.Colour.from_str(color).value)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.level.edit.color_invalid').format(color))
|
||||||
self._logger.error(__name__, f'Error parsing color {color}', e)
|
self._logger.error(__name__, f'Error parsing color {color}', e)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -239,6 +240,7 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
try:
|
try:
|
||||||
level_from_db.permissions = discord.Permissions(permissions).value
|
level_from_db.permissions = discord.Permissions(permissions).value
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.level.edit.permission_invalid').format(permissions))
|
||||||
self._logger.error(__name__, f'Error parsing permissions {permissions}', e)
|
self._logger.error(__name__, f'Error parsing permissions {permissions}', e)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user