From 067e29a96a71f67a8d7005eb02390b702061cbfb Mon Sep 17 00:00:00 2001 From: Romain J Date: Thu, 13 May 2021 23:14:13 +0200 Subject: [PATCH] fix(commands:rule>list|Mod): fix when no rules --- tuxbot/cogs/Custom/locales/messages.pot | 2 +- tuxbot/cogs/Linux/locales/messages.pot | 2 +- tuxbot/cogs/Logs/locales/messages.pot | 2 +- tuxbot/cogs/Mod/locales/en-US.po | 4 ++++ tuxbot/cogs/Mod/locales/fr-FR.po | 4 ++++ tuxbot/cogs/Mod/locales/messages.pot | 18 +++++++++++------- tuxbot/cogs/Mod/mod.py | 5 +++++ tuxbot/cogs/Network/locales/messages.pot | 2 +- tuxbot/cogs/Polls/locales/messages.pot | 2 +- tuxbot/cogs/Utils/locales/messages.pot | 2 +- 10 files changed, 30 insertions(+), 13 deletions(-) diff --git a/tuxbot/cogs/Custom/locales/messages.pot b/tuxbot/cogs/Custom/locales/messages.pot index 6b5c95a..8ab1a8c 100644 --- a/tuxbot/cogs/Custom/locales/messages.pot +++ b/tuxbot/cogs/Custom/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-05-13 22:20+0200\n" +"POT-Creation-Date: 2021-05-13 23:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tuxbot/cogs/Linux/locales/messages.pot b/tuxbot/cogs/Linux/locales/messages.pot index 0faddaa..ed6cb82 100644 --- a/tuxbot/cogs/Linux/locales/messages.pot +++ b/tuxbot/cogs/Linux/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-05-13 22:20+0200\n" +"POT-Creation-Date: 2021-05-13 23:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tuxbot/cogs/Logs/locales/messages.pot b/tuxbot/cogs/Logs/locales/messages.pot index 8ed8e82..1e16c10 100644 --- a/tuxbot/cogs/Logs/locales/messages.pot +++ b/tuxbot/cogs/Logs/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-05-13 22:20+0200\n" +"POT-Creation-Date: 2021-05-13 23:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tuxbot/cogs/Mod/locales/en-US.po b/tuxbot/cogs/Mod/locales/en-US.po index 96aefd2..a4ab532 100644 --- a/tuxbot/cogs/Mod/locales/en-US.po +++ b/tuxbot/cogs/Mod/locales/en-US.po @@ -32,6 +32,10 @@ msgid "" "{}" msgstr "" +#: tuxbot/cogs/Mod/mod.py:121 +msgid "No rules found for this server" +msgstr "" + #: tuxbot/cogs/Mod/mod.py:120 msgid "Rules for {}" msgstr "" diff --git a/tuxbot/cogs/Mod/locales/fr-FR.po b/tuxbot/cogs/Mod/locales/fr-FR.po index f2e43d8..6d8ba40 100644 --- a/tuxbot/cogs/Mod/locales/fr-FR.po +++ b/tuxbot/cogs/Mod/locales/fr-FR.po @@ -35,6 +35,10 @@ msgstr "" "{}merci de lire la règle suivante : \n" "{}" +#: tuxbot/cogs/Mod/mod.py:121 +msgid "No rules found for this server" +msgstr "Aucune règle trouvée pour ce serveur" + #: tuxbot/cogs/Mod/mod.py:120 msgid "Rules for {}" msgstr "Règles pour {}" diff --git a/tuxbot/cogs/Mod/locales/messages.pot b/tuxbot/cogs/Mod/locales/messages.pot index f70ecd7..056c1db 100644 --- a/tuxbot/cogs/Mod/locales/messages.pot +++ b/tuxbot/cogs/Mod/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-05-13 22:20+0200\n" +"POT-Creation-Date: 2021-05-13 23:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -32,31 +32,35 @@ msgid "" "{}" msgstr "" -#: tuxbot/cogs/Mod/mod.py:120 +#: tuxbot/cogs/Mod/mod.py:121 +msgid "No rules found for this server" +msgstr "" + +#: tuxbot/cogs/Mod/mod.py:125 msgid "Rules for {}" msgstr "" -#: tuxbot/cogs/Mod/mod.py:126 +#: tuxbot/cogs/Mod/mod.py:131 msgid "Latest change: {}" msgstr "" -#: tuxbot/cogs/Mod/mod.py:140 +#: tuxbot/cogs/Mod/mod.py:145 msgid "Rules for {} ({}/{})" msgstr "" -#: tuxbot/cogs/Mod/mod.py:159 +#: tuxbot/cogs/Mod/mod.py:164 msgid "" "Following rule added: \n" "{}" msgstr "" -#: tuxbot/cogs/Mod/mod.py:182 +#: tuxbot/cogs/Mod/mod.py:187 msgid "" "Following rule updated: \n" "{}" msgstr "" -#: tuxbot/cogs/Mod/mod.py:200 +#: tuxbot/cogs/Mod/mod.py:205 msgid "" "Following rule deleted: \n" "{}" diff --git a/tuxbot/cogs/Mod/mod.py b/tuxbot/cogs/Mod/mod.py index c35680c..0f40f6e 100644 --- a/tuxbot/cogs/Mod/mod.py +++ b/tuxbot/cogs/Mod/mod.py @@ -116,6 +116,11 @@ class Mod(commands.Cog): async def _rule_list(self, ctx: ContextPlus): rules = await get_server_rules(ctx.guild.id) + if not rules: + return await ctx.send( + _("No rules found for this server", ctx, self.bot.config) + ) + embed = discord.Embed( title=_("Rules for {}", ctx, self.bot.config).format( ctx.guild.name diff --git a/tuxbot/cogs/Network/locales/messages.pot b/tuxbot/cogs/Network/locales/messages.pot index e5a7426..484b44a 100644 --- a/tuxbot/cogs/Network/locales/messages.pot +++ b/tuxbot/cogs/Network/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-05-13 22:20+0200\n" +"POT-Creation-Date: 2021-05-13 23:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tuxbot/cogs/Polls/locales/messages.pot b/tuxbot/cogs/Polls/locales/messages.pot index 8f0e05c..fb562a3 100644 --- a/tuxbot/cogs/Polls/locales/messages.pot +++ b/tuxbot/cogs/Polls/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-05-13 22:20+0200\n" +"POT-Creation-Date: 2021-05-13 23:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/tuxbot/cogs/Utils/locales/messages.pot b/tuxbot/cogs/Utils/locales/messages.pot index af2289e..5d5eb2c 100644 --- a/tuxbot/cogs/Utils/locales/messages.pot +++ b/tuxbot/cogs/Utils/locales/messages.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Tuxbot-bot\n" "Report-Msgid-Bugs-To: rick@gnous.eu\n" -"POT-Creation-Date: 2021-05-13 22:20+0200\n" +"POT-Creation-Date: 2021-05-13 23:12+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n"