Added error notification to level edit #103

This commit is contained in:
Sven Heidemann 2022-11-11 07:33:24 +01:00
parent 8fafc94118
commit b2087042bc
2 changed files with 4 additions and 0 deletions

View File

@ -196,6 +196,8 @@
},
"edit": {
"edited": "Level {} wurde bearbeitet :D",
"color_invalid": "Die Farbe {} ist ungültig!",
"permission_invalid": "Der Berechtigungswert {} ist ungültig!",
"not_found": "Level {} nicht gefunden!"
},
"remove": {

View File

@ -229,6 +229,7 @@ class LevelGroup(DiscordCommandABC):
try:
level_from_db.color = hex(discord.Colour.from_str(color).value)
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)
return
@ -239,6 +240,7 @@ class LevelGroup(DiscordCommandABC):
try:
level_from_db.permissions = discord.Permissions(permissions).value
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)
return