texts(_help): add more text
This commit is contained in:
parent
a781e09bde
commit
de4c8c549a
7 changed files with 121 additions and 83 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -12,8 +12,7 @@ private.py
|
|||
.idea/
|
||||
|
||||
# other
|
||||
*.logs
|
||||
*.log
|
||||
logs/tuxbot.log
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
|
|
53
cogs/Help.py
53
cogs/Help.py
|
@ -4,10 +4,9 @@ import logging
|
|||
|
||||
import discord
|
||||
from discord.ext import commands
|
||||
from discord import utils
|
||||
|
||||
from bot import TuxBot
|
||||
from utils import Texts
|
||||
from utils import Texts, GroupPlus
|
||||
from utils.paginator import FieldPages
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
@ -16,22 +15,31 @@ log = logging.getLogger(__name__)
|
|||
class HelpCommand(commands.HelpCommand):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.ignore_cogs = ["Monitoring", "Help"]
|
||||
self.owner_cogs = ["Jishaku"]
|
||||
self.ignore_cogs = ["Monitoring", "Help", "Jishaku"]
|
||||
self.owner_cogs = []
|
||||
self.admin_cogs = ["Admin"]
|
||||
|
||||
def common_command_formatting(self, e, command):
|
||||
prefix = self.context.prefix if str(self.context.bot.user.id) not in self.context.prefix else f"@{self.context.bot.user.name}"
|
||||
prefix = self.context.prefix if str(
|
||||
self.context.bot.user.id) not in self.context.prefix else f"@{self.context.bot.user.name}"
|
||||
|
||||
e.title = self.get_command_signature(command)
|
||||
e.description = command.description
|
||||
|
||||
e.add_field(
|
||||
name="TODO: Text.params :",
|
||||
name=Texts(
|
||||
'help', self.context
|
||||
).get(
|
||||
'command_help.params'
|
||||
),
|
||||
value=command.usage
|
||||
)
|
||||
e.add_field(
|
||||
name="TODO: Text.usage :",
|
||||
name=Texts(
|
||||
'help', self.context
|
||||
).get(
|
||||
'command_help.usage'
|
||||
),
|
||||
value=f"{prefix}{command.qualified_name} " + command.usage
|
||||
)
|
||||
|
||||
|
@ -59,7 +67,8 @@ class HelpCommand(commands.HelpCommand):
|
|||
f"{owner.name}#{owner.discriminator}"
|
||||
for owner in owners
|
||||
]
|
||||
prefix = self.context.prefix if str(self.context.bot.user.id) not in self.context.prefix else f"@{self.context.bot.user.name} "
|
||||
prefix = self.context.prefix if str(
|
||||
self.context.bot.user.id) not in self.context.prefix else f"@{self.context.bot.user.name} "
|
||||
|
||||
e = discord.Embed(
|
||||
color=discord.Color.blue(),
|
||||
|
@ -85,7 +94,6 @@ class HelpCommand(commands.HelpCommand):
|
|||
)
|
||||
)
|
||||
|
||||
cogs = ""
|
||||
for extension in self.context.bot.cogs.values():
|
||||
if self.context.author not in owners \
|
||||
and extension.__class__.__name__ in self.owner_cogs:
|
||||
|
@ -93,22 +101,23 @@ class HelpCommand(commands.HelpCommand):
|
|||
if extension.__class__.__name__ in self.ignore_cogs:
|
||||
continue
|
||||
|
||||
cogs += f"• {extension.icon} **{extension.qualified_name}**\n"
|
||||
count = len(extension.get_commands())
|
||||
text = Texts('help', self.context).get('main_page.commands')
|
||||
|
||||
e.add_field(
|
||||
name=Texts(
|
||||
'help', self.context
|
||||
).get(
|
||||
'main_page.categories'
|
||||
),
|
||||
value=cogs
|
||||
)
|
||||
if count <= 1:
|
||||
text = text[:-1]
|
||||
|
||||
e.add_field(
|
||||
name=f"__{extension.icon} **{extension.qualified_name}**__",
|
||||
value=f"{count} {text}"
|
||||
)
|
||||
|
||||
await self.context.send(embed=e)
|
||||
|
||||
async def send_cog_help(self, cog):
|
||||
pages = {}
|
||||
prefix = self.context.prefix if str(self.context.bot.user.id) not in self.context.prefix else f"@{self.context.bot.user.name}"
|
||||
prefix = self.context.prefix if str(
|
||||
self.context.bot.user.id) not in self.context.prefix else f"@{self.context.bot.user.name}"
|
||||
|
||||
if cog.__class__.__name__ in self.owner_cogs \
|
||||
and self.context.author not in self.context.bot.owners:
|
||||
|
@ -127,12 +136,12 @@ class HelpCommand(commands.HelpCommand):
|
|||
+ ' ' * int(17 - len(cmd.name)) \
|
||||
+ f":: {cmd.help}\n"
|
||||
|
||||
if isinstance(cmd, commands.Group):
|
||||
if isinstance(cmd, GroupPlus):
|
||||
for group_command in cmd.commands:
|
||||
pages[cmd.category] \
|
||||
+= f"━ {group_command.name}" \
|
||||
+= f"└> {group_command.name}" \
|
||||
+ ' ' * int(15 - len(group_command.name)) \
|
||||
+ f":: {cmd.help}\n"
|
||||
+ f":: {group_command.help}\n"
|
||||
for e in pages:
|
||||
pages[e] += "```"
|
||||
formatted = []
|
||||
|
|
|
@ -241,11 +241,6 @@ class Useful(commands.Cog):
|
|||
title=Texts('useful', ctx).get('Information about TuxBot'),
|
||||
color=0x89C4F9)
|
||||
|
||||
e.add_field(
|
||||
name=f"__{Texts('useful', ctx).get('Latest changes')}__",
|
||||
value=self._latest_commits(),
|
||||
inline=False)
|
||||
|
||||
e.add_field(
|
||||
name=f"__:busts_in_silhouette: "
|
||||
f"{Texts('useful', ctx).get('Development')}__",
|
||||
|
@ -295,6 +290,12 @@ class Useful(commands.Cog):
|
|||
inline=True
|
||||
)
|
||||
|
||||
e.add_field(
|
||||
name=f"__{Texts('useful', ctx).get('Latest changes')}__",
|
||||
value=self._latest_commits(),
|
||||
inline=False
|
||||
)
|
||||
|
||||
e.add_field(
|
||||
name=f"__:link: {Texts('useful', ctx).get('Links')}__",
|
||||
value="[tuxbot.gnous.eu](https://tuxbot.gnous.eu/) "
|
||||
|
|
|
@ -18,8 +18,8 @@ msgstr ""
|
|||
msgid 'main_page.description'
|
||||
msgstr "Made by {}\nWhen using commands, <> means a required argument and [] means an optional argument.\n***(These symbols shouldn't be written)***"
|
||||
|
||||
msgid 'main_page.categories'
|
||||
msgstr 'Categories'
|
||||
msgid 'main_page.commands'
|
||||
msgstr 'Commands'
|
||||
|
||||
msgid 'main_page.footer'
|
||||
msgstr '- Send {}help <Command> to see more help about a command.'
|
||||
|
@ -30,5 +30,14 @@ msgstr 'No command called "{}" found.'
|
|||
msgid 'command_help.subcommands'
|
||||
msgstr 'Subcommands'
|
||||
|
||||
msgid 'command_help.aliases'
|
||||
msgstr 'Aliases'
|
||||
|
||||
msgid 'command_help.no_aliases'
|
||||
msgstr 'No aliases'
|
||||
msgstr 'No aliases'
|
||||
|
||||
msgid 'command_help.params'
|
||||
msgstr 'Parameters'
|
||||
|
||||
msgid 'command_help.usage'
|
||||
msgstr 'Usage'
|
|
@ -22,7 +22,7 @@ msgid '_say'
|
|||
msgstr 'Permet de faire en sorte que le TuxBot envoi votre message'
|
||||
|
||||
msgid '_say__short'
|
||||
msgstr 'Fait parler TuxBot'
|
||||
msgstr 'Faire parler TuxBot'
|
||||
|
||||
msgid '_say_usage'
|
||||
msgstr '[sous-commande] <message>'
|
||||
|
@ -33,7 +33,7 @@ msgid '_say_edit'
|
|||
msgstr "Permet de modifier le contenu d'un message envoyé par TuxBot"
|
||||
|
||||
msgid '_say_edit__short'
|
||||
msgstr 'Edite un message envoyé par le TuxBot'
|
||||
msgstr 'Editer un message envoyé'
|
||||
|
||||
msgid '_say_edit__usage'
|
||||
msgstr '<ID/Lien du message> <message>'
|
||||
|
@ -44,7 +44,7 @@ msgid '_say_to'
|
|||
msgstr "Permet de faire en sorte que le TuxBot envoi votre message dans un autre salon ou en MP à quelqu'un"
|
||||
|
||||
msgid '_say_to__short'
|
||||
msgstr 'Fait parler TuxBot dans un autre salon'
|
||||
msgstr 'Faire parler TuxBot dans un autre salon'
|
||||
|
||||
msgid '_say_to__usage'
|
||||
msgstr "<ID/Mention du salon ou ID/Mention d'un membre> <message>"
|
||||
|
@ -79,174 +79,185 @@ msgstr '<ID/Mention du membre>'
|
|||
###########################################################################
|
||||
|
||||
msgid '_clear'
|
||||
msgstr ''
|
||||
msgstr 'Permet de supprimer un nombre donné de message'
|
||||
|
||||
msgid '_clear__short'
|
||||
msgstr ''
|
||||
msgstr 'Supprime X messages'
|
||||
|
||||
msgid '_clear__usage'
|
||||
msgstr ''
|
||||
msgstr '<quantité>'
|
||||
|
||||
###########################################################################
|
||||
########################## REACT ######################################
|
||||
###########################################################################
|
||||
|
||||
msgid '_react'
|
||||
msgstr ''
|
||||
msgstr "Affiche l'aide relative a la commande `react`"
|
||||
|
||||
msgid '_react__short'
|
||||
msgstr ''
|
||||
msgstr "Afficher l'aide pour `react`"
|
||||
|
||||
msgid '_react__usage'
|
||||
msgstr ''
|
||||
msgstr '[sous-commande]'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_react_add'
|
||||
msgstr "Permet d'ajouter une réaction à un message de la part de TuxBot"
|
||||
|
||||
msgid '_react_add__short'
|
||||
msgstr 'Ajouter une réaction'
|
||||
|
||||
msgid '_react_add__usage'
|
||||
msgstr '<ID/Lien du message> <émoji>'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_react_remove'
|
||||
msgstr ''
|
||||
msgstr "Permet d'enlever toutes les réactions d'un message"
|
||||
|
||||
msgid '_react_remove__short'
|
||||
msgstr ''
|
||||
msgstr "Enlever toutes les réactions d'un message"
|
||||
|
||||
msgid '_react_remove__usage'
|
||||
msgstr ''
|
||||
msgstr '<ID/Lien du message>'
|
||||
|
||||
###########################################################################
|
||||
########################## DELETE #####################################
|
||||
###########################################################################
|
||||
|
||||
msgid '_delete'
|
||||
msgstr ''
|
||||
msgstr 'Permet de supprimer un message'
|
||||
|
||||
msgid '_delete__short'
|
||||
msgstr ''
|
||||
msgstr 'Supprimer un message'
|
||||
|
||||
msgid '_delete__usage'
|
||||
msgstr ''
|
||||
msgstr '[sous-commande] <ID/Lien du message>'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_delete_from'
|
||||
msgstr ''
|
||||
msgstr 'Permet de supprimer un message dans un autre salon'
|
||||
|
||||
msgid '_delete_from__short'
|
||||
msgstr ''
|
||||
msgstr 'Supprimer un message dans un autre salon'
|
||||
|
||||
msgid '_delete_from__usage'
|
||||
msgstr ''
|
||||
msgstr '<ID/Mention du salon> <ID/Lien du message>'
|
||||
|
||||
###########################################################################
|
||||
########################## WARN #######################################
|
||||
###########################################################################
|
||||
|
||||
msgid '_warn'
|
||||
msgstr ''
|
||||
msgstr "Permet d'afficher les derniers avertissements donnés sur ce serveur"
|
||||
|
||||
msgid '_warn__short'
|
||||
msgstr ''
|
||||
msgstr 'Lister les derniers avertissements'
|
||||
|
||||
msgid '_warn__usage'
|
||||
msgstr ''
|
||||
msgstr '[sous-commande]'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_warn_new'
|
||||
msgstr ''
|
||||
msgstr "Permet d'ajouter un avertissement à un membre en donnant une raison"
|
||||
|
||||
msgid '_warn_new__short'
|
||||
msgstr ''
|
||||
msgstr 'Ajouter un avertissement a un membre'
|
||||
|
||||
msgid '_warn_new__usage'
|
||||
msgstr ''
|
||||
msgstr '<ID/Pseudo/Mention du membre> <raison>'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_warn_remove'
|
||||
msgstr ''
|
||||
msgstr "Permet de supprimer un avertissement qui a été donné à un membre"
|
||||
|
||||
msgid '_warn_remove__short'
|
||||
msgstr ''
|
||||
msgstr "Retirer l'avertissement d'un membre"
|
||||
|
||||
msgid '_warn_remove__usage'
|
||||
msgstr ''
|
||||
msgstr "<ID de l'avertissement>"
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_warn_show'
|
||||
msgstr ''
|
||||
msgstr "Permet d'afficher les derniers avertissements donnés à un membre"
|
||||
|
||||
msgid '_warn_show__short'
|
||||
msgstr ''
|
||||
msgstr "Lister les derniers avertissements d'un membre"
|
||||
|
||||
msgid '_warn_show__usage'
|
||||
msgstr ''
|
||||
msgstr '<ID/Pseudo/Mention du membre>'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_warn_edit'
|
||||
msgstr ''
|
||||
msgstr "Permet de modifier la raison de l'avertissement donné à un membre"
|
||||
|
||||
msgid '_warn_edit__short'
|
||||
msgstr ''
|
||||
msgstr "Modifier la raison d'un avertissement"
|
||||
|
||||
msgid '_warn_edit__usage'
|
||||
msgstr ''
|
||||
msgstr "<ID de l'avertissement> <raison>"
|
||||
|
||||
###########################################################################
|
||||
########################## LANGUAGE ###################################
|
||||
###########################################################################
|
||||
|
||||
msgid '_language'
|
||||
msgstr ''
|
||||
msgstr 'Permet de définir la langue utilisée sur ce serveur'
|
||||
|
||||
msgid '_language__short'
|
||||
msgstr ''
|
||||
msgstr 'Définir la langue de Tuxbot'
|
||||
|
||||
msgid '_language__usage'
|
||||
msgstr ''
|
||||
msgstr '<langue>'
|
||||
|
||||
###########################################################################
|
||||
########################## PREFIX #####################################
|
||||
###########################################################################
|
||||
|
||||
msgid '_prefix'
|
||||
msgstr ''
|
||||
msgstr "Affiche l'aide relative a la commande `prefix`"
|
||||
|
||||
msgid '_prefix__short'
|
||||
msgstr ''
|
||||
msgstr "Afficher l'aide pour `prefix`"
|
||||
|
||||
msgid '_prefix__usage'
|
||||
msgstr ''
|
||||
msgstr '[sous-commande]'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_prefix_add'
|
||||
msgstr ''
|
||||
msgstr "Permet d'ajouter un nouveau préfixe pour ce serveur"
|
||||
|
||||
msgid '_prefix_add__short'
|
||||
msgstr ''
|
||||
msgstr 'Ajouter un préfixe pour ce serveur'
|
||||
|
||||
msgid '_prefix_add__usage'
|
||||
msgstr ''
|
||||
msgstr '<prefixe>'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_prefix_remove'
|
||||
msgstr ''
|
||||
msgstr "Permet retirer un préfixe pour ce serveur"
|
||||
|
||||
msgid '_prefix_remove__short'
|
||||
msgstr ''
|
||||
msgstr 'Retirer un préfixe pour ce serveur'
|
||||
|
||||
msgid '_prefix_remove__usage'
|
||||
msgstr ''
|
||||
msgstr '<prefixe>'
|
||||
|
||||
###########################################################################
|
||||
|
||||
msgid '_prefix_list'
|
||||
msgstr ''
|
||||
msgstr "Permet d'afficher tous les prefixes définis pour ce serveur"
|
||||
|
||||
msgid '_prefix_list__short'
|
||||
msgstr ''
|
||||
msgstr 'Lister les prefixes pour ce servuer'
|
||||
|
||||
msgid '_prefix_list__usage'
|
||||
msgstr ''
|
||||
msgstr '⠀'
|
||||
|
|
|
@ -18,8 +18,8 @@ msgstr ""
|
|||
msgid 'main_page.description'
|
||||
msgstr "Créé par {}\nLorsque vous utilisez les commandes, <> correspond à un argument obligatoire et [] à un argument optionnel.\n***(Vous ne devez pas écrire ces symboles)***"
|
||||
|
||||
msgid 'main_page.categories'
|
||||
msgstr 'Catégories'
|
||||
msgid 'main_page.commands'
|
||||
msgstr 'Commandes'
|
||||
|
||||
msgid 'main_page.footer'
|
||||
msgstr "- Envoyez {}help <Commande> pour avoir plus d'aide sur la commande."
|
||||
|
@ -30,5 +30,14 @@ msgstr 'Impossible de trouver la commande {}.'
|
|||
msgid 'command_help.subcommands'
|
||||
msgstr 'Sous-commandes'
|
||||
|
||||
msgid 'command_help.aliases'
|
||||
msgstr 'Alias'
|
||||
|
||||
msgid 'command_help.no_aliases'
|
||||
msgstr 'Aucun alias'
|
||||
msgstr 'Aucun alias'
|
||||
|
||||
msgid 'command_help.params'
|
||||
msgstr 'Parametres'
|
||||
|
||||
msgid 'command_help.usage'
|
||||
msgstr 'Utilisation'
|
Loading…
Reference in a new issue