fix(commands:rule>list|Mod): fix when no rules

This commit is contained in:
Romain J 2021-05-13 23:14:13 +02:00
parent 8f62c2c4a1
commit 067e29a96a
10 changed files with 30 additions and 13 deletions

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tuxbot-bot\n" "Project-Id-Version: Tuxbot-bot\n"
"Report-Msgid-Bugs-To: rick@gnous.eu\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tuxbot-bot\n" "Project-Id-Version: Tuxbot-bot\n"
"Report-Msgid-Bugs-To: rick@gnous.eu\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tuxbot-bot\n" "Project-Id-Version: Tuxbot-bot\n"
"Report-Msgid-Bugs-To: rick@gnous.eu\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -32,6 +32,10 @@ msgid ""
"{}" "{}"
msgstr "" msgstr ""
#: tuxbot/cogs/Mod/mod.py:121
msgid "No rules found for this server"
msgstr ""
#: tuxbot/cogs/Mod/mod.py:120 #: tuxbot/cogs/Mod/mod.py:120
msgid "Rules for {}" msgid "Rules for {}"
msgstr "" msgstr ""

View file

@ -35,6 +35,10 @@ msgstr ""
"{}merci de lire la règle suivante : \n" "{}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 #: tuxbot/cogs/Mod/mod.py:120
msgid "Rules for {}" msgid "Rules for {}"
msgstr "Règles pour {}" msgstr "Règles pour {}"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tuxbot-bot\n" "Project-Id-Version: Tuxbot-bot\n"
"Report-Msgid-Bugs-To: rick@gnous.eu\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -32,31 +32,35 @@ msgid ""
"{}" "{}"
msgstr "" 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 {}" msgid "Rules for {}"
msgstr "" msgstr ""
#: tuxbot/cogs/Mod/mod.py:126 #: tuxbot/cogs/Mod/mod.py:131
msgid "Latest change: {}" msgid "Latest change: {}"
msgstr "" msgstr ""
#: tuxbot/cogs/Mod/mod.py:140 #: tuxbot/cogs/Mod/mod.py:145
msgid "Rules for {} ({}/{})" msgid "Rules for {} ({}/{})"
msgstr "" msgstr ""
#: tuxbot/cogs/Mod/mod.py:159 #: tuxbot/cogs/Mod/mod.py:164
msgid "" msgid ""
"Following rule added: \n" "Following rule added: \n"
"{}" "{}"
msgstr "" msgstr ""
#: tuxbot/cogs/Mod/mod.py:182 #: tuxbot/cogs/Mod/mod.py:187
msgid "" msgid ""
"Following rule updated: \n" "Following rule updated: \n"
"{}" "{}"
msgstr "" msgstr ""
#: tuxbot/cogs/Mod/mod.py:200 #: tuxbot/cogs/Mod/mod.py:205
msgid "" msgid ""
"Following rule deleted: \n" "Following rule deleted: \n"
"{}" "{}"

View file

@ -116,6 +116,11 @@ class Mod(commands.Cog):
async def _rule_list(self, ctx: ContextPlus): async def _rule_list(self, ctx: ContextPlus):
rules = await get_server_rules(ctx.guild.id) 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( embed = discord.Embed(
title=_("Rules for {}", ctx, self.bot.config).format( title=_("Rules for {}", ctx, self.bot.config).format(
ctx.guild.name ctx.guild.name

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tuxbot-bot\n" "Project-Id-Version: Tuxbot-bot\n"
"Report-Msgid-Bugs-To: rick@gnous.eu\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tuxbot-bot\n" "Project-Id-Version: Tuxbot-bot\n"
"Report-Msgid-Bugs-To: rick@gnous.eu\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Tuxbot-bot\n" "Project-Id-Version: Tuxbot-bot\n"
"Report-Msgid-Bugs-To: rick@gnous.eu\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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"