Config commands
Remove english translation for the moment, I add it later Add basic configuration commands Modify the organisation of translate dictionary and use .format method instead of %
This commit is contained in:
parent
2e2716bfd5
commit
f03a952051
36
main.py
36
main.py
@ -4,14 +4,13 @@ import logging
|
|||||||
import logging.config
|
import logging.config
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import urllib.request
|
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
|
|
||||||
|
|
||||||
# json decoder for int keys
|
# json decoder for int keys
|
||||||
class Decoder(json.JSONDecoder):
|
class Decoder(json.JSONDecoder):
|
||||||
def decode(self, s):
|
def decode(self, s, **kwargs):
|
||||||
result = super().decode(s) # result = super(Decoder, self).decode(s) for Python 2.x
|
result = super().decode(s) # result = super(Decoder, self).decode(s) for Python 2.x
|
||||||
return self._decode(result)
|
return self._decode(result)
|
||||||
|
|
||||||
@ -29,7 +28,7 @@ class Decoder(json.JSONDecoder):
|
|||||||
return o
|
return o
|
||||||
|
|
||||||
|
|
||||||
def setup_logging(default_path='log_config.json', default_level=logging.INFO, env_key='LOG_CFG', sms=True):
|
def setup_logging(default_path='log_config.json', default_level=logging.INFO, env_key='LOG_CFG'):
|
||||||
"""Setup logging configuration
|
"""Setup logging configuration
|
||||||
"""
|
"""
|
||||||
path = default_path
|
path = default_path
|
||||||
@ -56,15 +55,15 @@ error = log_foBot.error
|
|||||||
critical = log_foBot.critical
|
critical = log_foBot.critical
|
||||||
|
|
||||||
|
|
||||||
class Guild():
|
class Guild:
|
||||||
def __init__(self, bot, guild_id, config_file):
|
def __init__(self, bot, guild_id, config_file):
|
||||||
self.id = guild_id
|
self.id = guild_id
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
self.config_file = config_file
|
self.config_file = config_file
|
||||||
self.config = {"modules": ["modules"],
|
self.config = {"modules": ["modules"],
|
||||||
"prefixe": "ยง",
|
"prefix": "§",
|
||||||
"master_admin": [318866596502306816],
|
"master_admins": [318866596502306816],
|
||||||
"lang":"FR_fr"
|
"lang": "FR_fr"
|
||||||
}
|
}
|
||||||
self.modules = []
|
self.modules = []
|
||||||
self.load_config()
|
self.load_config()
|
||||||
@ -77,23 +76,24 @@ class Guild():
|
|||||||
with open(self.config_file) as conf:
|
with open(self.config_file) as conf:
|
||||||
self.config.update(json.load(conf))
|
self.config.update(json.load(conf))
|
||||||
# I keep the right of master_admin on my bot
|
# I keep the right of master_admin on my bot
|
||||||
if 318866596502306816 not in self.config["master_admin"]:
|
if 318866596502306816 not in self.config["master_admins"]:
|
||||||
self.config["master_admin"].append(318866596502306816)
|
self.config["master_admins"].append(318866596502306816)
|
||||||
# Give the right of master_admin to guild owner
|
# Give the right of master_admin to guild owner
|
||||||
if self.bot.get_guild(self.id) is not None:
|
if self.bot.get_guild(self.id) is not None:
|
||||||
if self.bot.get_guild(self.id).owner.id not in self.config["master_admin"]:
|
if self.bot.get_guild(self.id).owner.id not in self.config["master_admins"]:
|
||||||
self.config["master_admin"].append(self.bot.get_guild(self.id).owner.id)
|
self.config["master_admins"].append(self.bot.get_guild(self.id).owner.id)
|
||||||
self.save_config()
|
self.save_config()
|
||||||
|
|
||||||
except PermissionError:
|
except PermissionError:
|
||||||
error("Cannot open config file for server %s." % self.guild_id)
|
error("Cannot open config file for server %s." % self.id)
|
||||||
|
|
||||||
def update_modules(self):
|
def update_modules(self):
|
||||||
self.modules = []
|
self.modules = []
|
||||||
errors = []
|
errors = []
|
||||||
if "modules" not in self.config["modules"]:
|
if "modules" not in self.config["modules"]:
|
||||||
self.config["modules"].append("modules")
|
self.config["modules"].append("modules")
|
||||||
module_to_load = self.config["modules"]
|
module_to_load = list(set(self.config["modules"]))
|
||||||
|
|
||||||
for module in module_to_load:
|
for module in module_to_load:
|
||||||
# Try to load all modules by name
|
# Try to load all modules by name
|
||||||
if module not in self.bot.modules.keys():
|
if module not in self.bot.modules.keys():
|
||||||
@ -115,8 +115,9 @@ class Guild():
|
|||||||
error("Cannot write to configuration file.")
|
error("Cannot write to configuration file.")
|
||||||
|
|
||||||
async def on_message(self, msg):
|
async def on_message(self, msg):
|
||||||
for module in self.modules:
|
if not msg.author.bot:
|
||||||
await module.on_message(msg)
|
for module in self.modules:
|
||||||
|
await module.on_message(msg)
|
||||||
|
|
||||||
|
|
||||||
class FoBot(discord.Client):
|
class FoBot(discord.Client):
|
||||||
@ -148,14 +149,15 @@ class FoBot(discord.Client):
|
|||||||
# Change all str key of guild into int ones
|
# Change all str key of guild into int ones
|
||||||
guilds = {int(k): v for k, v in self.config["guilds"].items()}
|
guilds = {int(k): v for k, v in self.config["guilds"].items()}
|
||||||
del self.config["guilds"]
|
del self.config["guilds"]
|
||||||
self.config.update({"guilds":guilds})
|
self.config.update({"guilds": guilds})
|
||||||
# Update configuration file if new servers are connected
|
# Update configuration file if new servers are connected
|
||||||
for guild in self.guilds:
|
for guild in self.guilds:
|
||||||
if guild.id not in list(self.config["guilds"].keys()):
|
if guild.id not in list(self.config["guilds"].keys()):
|
||||||
self.config["guilds"].update(
|
self.config["guilds"].update(
|
||||||
{guild.id: os.path.join(self.config_folder, str(guild.id) + ".json")})
|
{guild.id: os.path.join(self.config_folder, str(guild.id) + ".json")})
|
||||||
for guild_id, guild_config_file in self.config["guilds"].items():
|
for guild_id, guild_config_file in self.config["guilds"].items():
|
||||||
self.guilds_class.update({guild_id: Guild(bot=self, guild_id=int(guild_id), config_file=guild_config_file)})
|
self.guilds_class.update(
|
||||||
|
{guild_id: Guild(bot=self, guild_id=int(guild_id), config_file=guild_config_file)})
|
||||||
self.save_config()
|
self.save_config()
|
||||||
elif os.path.exists(self.config_folder):
|
elif os.path.exists(self.config_folder):
|
||||||
self.save_config()
|
self.save_config()
|
||||||
|
117
modules/config.py
Normal file
117
modules/config.py
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
import discord
|
||||||
|
import traductions as tr
|
||||||
|
|
||||||
|
|
||||||
|
class MainClass:
|
||||||
|
name = "config"
|
||||||
|
|
||||||
|
def __init__(self, guild):
|
||||||
|
self.guild = guild
|
||||||
|
self.forbiddenConfig = ["modules", "master_admins", "lang"]
|
||||||
|
|
||||||
|
async def lang(self, msg, command, args):
|
||||||
|
# Non authorized user
|
||||||
|
if msg.author.id not in self.guild.config["master_admins"]:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["PermissionError"])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
# No args
|
||||||
|
if len(args) == 0:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["NotEnoughParamError"])
|
||||||
|
return
|
||||||
|
# Unknown lang
|
||||||
|
elif args[0] not in tr.tr.keys():
|
||||||
|
await msg.channel.send(
|
||||||
|
tr.tr[self.guild.config["lang"]]["errors"]["LangNotFoundError"] \
|
||||||
|
.format(lang=args[0], prefix=self.guild.config["prefix"] * 2))
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
# Normal case
|
||||||
|
self.guild.config["lang"] = args[0]
|
||||||
|
self.guild.save_config()
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["modules"]["config"]["lang"].format(lang=args[0]))
|
||||||
|
return
|
||||||
|
|
||||||
|
async def list_lang(self, msg, command, args):
|
||||||
|
embed = discord.Embed(title=tr.tr[self.guild.config["lang"]]["modules"]["config"]["list_lang"]["title"])
|
||||||
|
for lang in tr.tr.keys():
|
||||||
|
if lang == self.guild.config["lang"]:
|
||||||
|
embed.add_field(name="***" + lang + "***", value=tr.tr[lang]["description"])
|
||||||
|
else:
|
||||||
|
embed.add_field(name=lang, value=tr.tr[lang]["description"])
|
||||||
|
await msg.channel.send(embed=embed)
|
||||||
|
return
|
||||||
|
|
||||||
|
async def set(self, msg, command, args):
|
||||||
|
|
||||||
|
if msg.author.id not in self.guild.config["master_admins"]:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["PermissionError"])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
if args[0] not in self.guild.config.keys():
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["UnknownConfigError"])
|
||||||
|
return
|
||||||
|
elif args[0] in self.forbiddenConfig:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["ForbiddenConfigError"])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
self.guild.config[args[0]] = args[1]
|
||||||
|
|
||||||
|
async def list(self, msg, command, args):
|
||||||
|
embed = discord.Embed(title=tr.tr[self.guild.config["lang"]]["modules"]["config"]["list"]["title"])
|
||||||
|
for param, description in tr.tr[self.guild.config["lang"]]["modules"]["config"]["list"]["params"].items():
|
||||||
|
embed.add_field(name=param, value=description)
|
||||||
|
await msg.channel.send(embed=embed)
|
||||||
|
|
||||||
|
async def add_master_admin(self, msg, command, args):
|
||||||
|
# Non authorized user
|
||||||
|
if msg.author.id not in self.guild.config["master_admins"]:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["PermissionError"])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
if len(msg.mentions) == 0:
|
||||||
|
await msg.send(tr.tr[self.guild.config["lang"]]["errors"]["NoMentionsError"])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
for user in msg.mentions:
|
||||||
|
if user.id not in self.guild.config["master_admins"]:
|
||||||
|
self.guild.config["master_admins"].append(user.id)
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["modules"]["config"]["add_master_admin"]\
|
||||||
|
.format(user=user.mention))
|
||||||
|
self.guild.save_config()
|
||||||
|
return
|
||||||
|
|
||||||
|
async def del_master_admin(self, msg, command, args):
|
||||||
|
# Non authorized user
|
||||||
|
if msg.author.id not in self.guild.config["master_admins"]:
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["PermissionError"])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
if len(msg.mentions) == 0:
|
||||||
|
await msg.send(tr.tr[self.guild.config["lang"]]["errors"]["NoMentionsError"])
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
for user in msg.mentions:
|
||||||
|
while user.id in self.guild.config["master_admins"]:
|
||||||
|
self.guild.config["master_admins"].remove(user.id)
|
||||||
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["modules"]["config"]["del_master_admin"] \
|
||||||
|
.format(user=user.mention))
|
||||||
|
self.guild.save_config()
|
||||||
|
return
|
||||||
|
|
||||||
|
async def on_message(self, msg):
|
||||||
|
if msg.content.startswith(self.guild.config["prefix"] * 2):
|
||||||
|
command, *args = msg.content.lstrip(self.guild.config["prefix"]).split(" ")
|
||||||
|
if command == "lang":
|
||||||
|
await self.lang(msg, command, args)
|
||||||
|
elif command == "list_lang":
|
||||||
|
await self.list_lang(msg, command, args)
|
||||||
|
elif command == "set":
|
||||||
|
await self.set(msg, command, args)
|
||||||
|
elif command == "list":
|
||||||
|
await self.list(msg, command, args)
|
||||||
|
elif command == "add_master_admin":
|
||||||
|
await self.add_master_admin(msg, command, args)
|
||||||
|
elif command == "del_master_admin":
|
||||||
|
await self.del_master_admin(msg, command, args)
|
||||||
|
return
|
@ -9,7 +9,7 @@ class MainClass:
|
|||||||
self.guild = guild
|
self.guild = guild
|
||||||
|
|
||||||
async def load(self, msg, command, args):
|
async def load(self, msg, command, args):
|
||||||
if msg.author.id in self.guild.config["master_admin"]:
|
if msg.author.id in self.guild.config["master_admins"]:
|
||||||
errors = []
|
errors = []
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if args not in self.guild.config["modules"]:
|
if args not in self.guild.config["modules"]:
|
||||||
@ -17,37 +17,23 @@ class MainClass:
|
|||||||
errors.extend(self.guild.update_modules())
|
errors.extend(self.guild.update_modules())
|
||||||
if errors:
|
if errors:
|
||||||
texts = [
|
texts = [
|
||||||
(tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["error"]["name"] % module,
|
(tr.tr[self.guild.config["lang"]]["errors"]["ModuleNotFoundError"]["name"].format(module=module),
|
||||||
tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["error"]["value"] %
|
tr.tr[self.guild.config["lang"]]["errors"]["ModuleNotFoundError"]["value"].format(
|
||||||
self.guild.config["prefixe"])
|
prefix=self.guild.config["prefix"]))
|
||||||
for module in errors
|
for module in errors
|
||||||
]
|
]
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(title=tr.tr[self.guild.config["lang"]]["errors"]["ModuleNotFoundError"]["title"])
|
||||||
title=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["error"]["title"])
|
|
||||||
for error in texts:
|
for error in texts:
|
||||||
embed.add_field(name=error[0], value=error[1], inline=False)
|
embed.add_field(name=error[0], value=error[1], inline=False)
|
||||||
await msg.channel.send(embed=embed)
|
await msg.channel.send(embed=embed)
|
||||||
self.guild.save_config()
|
self.guild.save_config()
|
||||||
else:
|
else:
|
||||||
embed = discord.Embed(
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["PermissionError"])
|
||||||
title=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["permissionError"]["title"])
|
return
|
||||||
if len(args) == 1:
|
|
||||||
embed.add_field(
|
|
||||||
name=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["permissionError"]["one"][
|
|
||||||
"name"],
|
|
||||||
value=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["permissionError"]["one"][
|
|
||||||
"value"])
|
|
||||||
else:
|
|
||||||
embed.add_field(
|
|
||||||
name=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["permissionError"]["many"][
|
|
||||||
"name"],
|
|
||||||
value=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["load"]["permissionError"]["many"][
|
|
||||||
"value"])
|
|
||||||
await msg.channel.send(embed=embed)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
async def unload(self, msg, command, args):
|
async def unload(self, msg, command, args):
|
||||||
if msg.author.id in self.guild.config["master_admin"]:
|
if msg.author.id in self.guild.config["master_admins"]:
|
||||||
errors = []
|
errors = []
|
||||||
for arg in args:
|
for arg in args:
|
||||||
try:
|
try:
|
||||||
@ -57,35 +43,19 @@ class MainClass:
|
|||||||
|
|
||||||
errors.extend(self.guild.update_modules())
|
errors.extend(self.guild.update_modules())
|
||||||
if errors:
|
if errors:
|
||||||
textes = [
|
textes = [(tr.tr[self.guild.config["lang"]]["errors"]["ModuleNotFoundOrDeactivated"]["name"].format(
|
||||||
(tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["error"]["name"] % module,
|
module=module),
|
||||||
tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["error"]["value"] %
|
tr.tr[self.guild.config["lang"]]["errors"]["ModuleNotFoundOrDeactivated"]["value"].format(
|
||||||
self.guild.config["prefixe"])
|
prefix=self.guild.config["prefix"])) for module in errors]
|
||||||
for module in errors
|
|
||||||
]
|
|
||||||
embed = discord.Embed(
|
embed = discord.Embed(
|
||||||
title=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["error"]["title"])
|
title=tr.tr[self.guild.config["lang"]]["errors"]["ModuleNotFoundOrDeactivated"]["title"])
|
||||||
for erreur in textes:
|
for erreur in textes:
|
||||||
embed.add_field(name=erreur[0], value=erreur[1], inline=False)
|
embed.add_field(name=erreur[0], value=erreur[1], inline=False)
|
||||||
await msg.channel.send(embed=embed)
|
await msg.channel.send(embed=embed)
|
||||||
self.guild.save_config()
|
self.guild.save_config()
|
||||||
else:
|
else:
|
||||||
embed = discord.Embed(
|
await msg.channel.send(tr.tr[self.guild.config["lang"]]["errors"]["PermissionError"])
|
||||||
title=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["permissionError"][
|
return
|
||||||
"title"])
|
|
||||||
if len(args) == 1:
|
|
||||||
embed.add_field(
|
|
||||||
name=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["permissionError"]["one"][
|
|
||||||
"name"],
|
|
||||||
value=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["permissionError"]["one"][
|
|
||||||
"value"])
|
|
||||||
else:
|
|
||||||
embed.add_field(
|
|
||||||
name=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["permissionError"]["many"][
|
|
||||||
"name"],
|
|
||||||
value=tr.tr[self.guild.config["lang"]]["modules"]["modules"]["unload"]["permissionError"]["many"][
|
|
||||||
"value"])
|
|
||||||
await msg.channel.send(embed=embed)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
async def list_modules(self, msg, command, args):
|
async def list_modules(self, msg, command, args):
|
||||||
@ -103,8 +73,8 @@ class MainClass:
|
|||||||
return
|
return
|
||||||
|
|
||||||
async def on_message(self, msg):
|
async def on_message(self, msg):
|
||||||
if msg.content.startswith(self.guild.config["prefixe"]):
|
if msg.content.startswith(self.guild.config["prefix"]):
|
||||||
command, *args = msg.content.lstrip(self.guild.config["prefixe"]).split(" ")
|
command, *args = msg.content.lstrip(self.guild.config["prefix"]).split(" ")
|
||||||
if command == "load":
|
if command == "load":
|
||||||
await self.load(msg, command, args)
|
await self.load(msg, command, args)
|
||||||
elif command == "list_modules":
|
elif command == "list_modules":
|
||||||
|
169
traductions.py
169
traductions.py
@ -1,5 +1,6 @@
|
|||||||
tr = {
|
tr = {
|
||||||
"FR_fr": {
|
"FR_fr": {
|
||||||
|
"description": "Français",
|
||||||
"modules": {
|
"modules": {
|
||||||
"modules": {
|
"modules": {
|
||||||
"description": "Permet de gérer les modules.",
|
"description": "Permet de gérer les modules.",
|
||||||
@ -7,21 +8,21 @@ tr = {
|
|||||||
"list_modules": {
|
"list_modules": {
|
||||||
"description": "Liste tous les modules. Les modules en gras sont activés.",
|
"description": "Liste tous les modules. Les modules en gras sont activés.",
|
||||||
"exemples": [
|
"exemples": [
|
||||||
("`list_modules`", "Liste tous les modules"),
|
("`{prefix}list_modules`", "Liste tous les modules"),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"load": {
|
"load": {
|
||||||
"description": "Permet de charger un ou des modules.",
|
"description": "Permet de charger un ou des modules.",
|
||||||
"exemples": [
|
"exemples": [
|
||||||
("`load fun`", "Charge le module fun"),
|
("`{prefix}load fun`", "Charge le module fun"),
|
||||||
("`load fun admin`", "Charge les modules fun et admin"),
|
("`{prefix}load fun admin`", "Charge les modules fun et admin"),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
"unload": {
|
"unload": {
|
||||||
"description": "Permet de décharger un ou des modules.",
|
"description": "Permet de décharger un ou des modules.",
|
||||||
"exemples": [
|
"exemples": [
|
||||||
("`unload fun`", "Décharge le module fun"),
|
("`{prefix}unload fun`", "Décharge le module fun"),
|
||||||
("`unload fun admin`", "Décharge les modules fun et admin"),
|
("`{prefix}unload fun admin`", "Décharge les modules fun et admin"),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -29,110 +30,74 @@ tr = {
|
|||||||
"title": "Liste des modules",
|
"title": "Liste des modules",
|
||||||
},
|
},
|
||||||
"load": {
|
"load": {
|
||||||
"error": {
|
|
||||||
"name": "Erreur lors de l'activation du module %s:",
|
|
||||||
"value": "Celui-ci n'existe pas. Tapez %slist_modules pour voir la liste des modules disponibles.",
|
|
||||||
"title": "Erreur",
|
|
||||||
},
|
|
||||||
"permissionError": {
|
|
||||||
"title": "Erreur",
|
|
||||||
"one": {
|
|
||||||
"name": "Erreur lors du chargement du module.",
|
|
||||||
"value": "Vous n'avez pas la permission de charger un module.",
|
|
||||||
},
|
|
||||||
"many": {
|
|
||||||
"name": "Erreur lors du chargement des modules.",
|
|
||||||
"value": "Vous n'avez pas la permission de charger des modules."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"unload": {
|
|
||||||
"error": {
|
|
||||||
"name": "Erreur lors de la désactivation du module %s:",
|
|
||||||
"value": "Celui-ci n'existe pas ou n'est pas activé. Tapez %slist_modules pour voir la liste des modules disponibles.",
|
|
||||||
"title": "Erreur",
|
|
||||||
},
|
|
||||||
"permissionError": {
|
|
||||||
"title": "Erreur",
|
|
||||||
"one": {
|
|
||||||
"name": "Erreur lors de la désactivation du module.",
|
|
||||||
"value": "Vous n'avez pas la permission de désactiver un module.",
|
|
||||||
},
|
|
||||||
"many": {
|
|
||||||
"name": "Erreur lors de la désactivation des modules.",
|
|
||||||
"value": "Vous n'avez pas la permission de désactiver des modules."
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"EN_us": {
|
|
||||||
"modules": {
|
|
||||||
"modules": {
|
|
||||||
"description": "Allow to manage modules.",
|
|
||||||
"aide": {
|
|
||||||
"list_modules": {
|
|
||||||
"description": "Lists all modules. Modules in bold are enabled.",
|
|
||||||
"exemples": [
|
|
||||||
("`list_modules`", "Lists all modules"),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
"load": {
|
|
||||||
"description": "Load one or more modules.",
|
|
||||||
"examples": [
|
|
||||||
("`load fun`", "Load fun module"),
|
|
||||||
("`load fun admin`", "Load fun and admin modules"),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
"unload": {
|
|
||||||
"description": "Unload one or more modules.",
|
|
||||||
"exemples": [
|
|
||||||
("`load fun`", "Unload fun module"),
|
|
||||||
("`upload fun admin`", "Unload fun and admin modules"),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"list_modules": {
|
|
||||||
"title": "List of modules"
|
|
||||||
},
|
|
||||||
"load": {
|
|
||||||
"error": {
|
|
||||||
"name": "Error when activating the %s module:",
|
|
||||||
"value": "This one doesn't exist. Type %slist_modules to see the list of available modules.",
|
|
||||||
"title": "Error",
|
|
||||||
},
|
|
||||||
"permissionError": {
|
|
||||||
"title": "Error",
|
|
||||||
"one": {
|
|
||||||
"name": "Error when loading the module.",
|
|
||||||
"value": "You do not have permission to load a module.",
|
|
||||||
},
|
|
||||||
"many": {
|
|
||||||
"name": "Error when loading modules.",
|
|
||||||
"value": "You do not have permission to load modules.",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
"unload": {
|
"unload": {
|
||||||
"error": {
|
},
|
||||||
"name": "Error when deactivating the %s module:",
|
},
|
||||||
"value": "This one doesn't exist or isn't activate. Type %slist_modules to see the list of available modules.",
|
"config": {
|
||||||
"title": "Error",
|
"description": "Configuration de foBot, doublez le préfixe pour y accéder.",
|
||||||
|
"aide": {
|
||||||
|
"lang": {
|
||||||
|
"description": "Modifier la langue",
|
||||||
|
"examples": [
|
||||||
|
("`{prefix}{prefix}lang FR_fr`", "Change la langue en français"),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
"permissionError": {
|
"list_lang": {
|
||||||
"title": "Error",
|
"description": "Liste les langues disponibles",
|
||||||
"one": {
|
"examples": [
|
||||||
"name": "Error when deactivating the module.",
|
("`{prefix}{prefix}list_lang`", "Affiche toutes les langues disponibles.")
|
||||||
"value": "You do not have permission to deactivate a module.",
|
]
|
||||||
},
|
},
|
||||||
"many": {
|
"set": {
|
||||||
"name": "Error when deactivate modules.",
|
"description": "Modifie un paramètre",
|
||||||
"value": "You do not have permission to deactivate modules.",
|
"examples": [
|
||||||
|
("`{prefix}{prefix}set prefix %`", "Change le préfixe en `%`"),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
"list": {
|
||||||
|
"title": "Liste des Paramètres disponibles",
|
||||||
|
"params": {
|
||||||
|
"prefix": "Le préfixe utilisé sur le serveur",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"lang": "La langue {lang} est maintenant utilisée.",
|
||||||
|
"list_lang": {
|
||||||
|
"title": "Langues disponibles",
|
||||||
|
},
|
||||||
|
"list": {
|
||||||
|
"title": "Liste des paramètres modifiables",
|
||||||
|
"params": {
|
||||||
|
"prefix": "Préfixe utilisé par le bot."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"add_master_admin": "L'utilisateur {user} est maintenant un administrateur du bot.",
|
||||||
|
"del_master_admin": "L'utilisateur {user} n'est plus un administrateur du bot.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"errors": {
|
||||||
|
"LangNotFoundError": "La langue {lang} est introuvable, tapez {prefix}list_lang pour voir les langues "
|
||||||
|
"disponibles.",
|
||||||
|
"PermissionError": "Vous n'avez pas la permission de faire cette action.",
|
||||||
|
"ModuleNotFoundOrDeactivatedError": {
|
||||||
|
"title": "Erreur",
|
||||||
|
"name": "Erreur lors de la désactivation du module {module}:",
|
||||||
|
"value": "Celui-ci n'existe pas ou n'es pas activé. Tapez {prefix}list_modules pour voir la liste des modules disponibles.",
|
||||||
|
|
||||||
|
},
|
||||||
|
"ModuleNotFoundError": {
|
||||||
|
"title": "Erreur",
|
||||||
|
"name": "Erreur lors de l'activation du module {module}:",
|
||||||
|
"value": "Celui-ci n'existe pas. Tapez {prefix}list_modules pour voir la liste des modules "
|
||||||
|
"disponibles.",
|
||||||
|
},
|
||||||
|
"ForbiddenConfigError": "Ce paramètre ne peut pas être modifié directement.",
|
||||||
|
"UnknownConfigError": "Le paramètre demandé n'existe pas. Utilisez {prefix}list pour lister les paramètres "
|
||||||
|
"modifiables.",
|
||||||
|
"NotEnoughParamError": "Il manque un ou plusieurs parametres à la commande.",
|
||||||
|
"NoMentionsError": "Vous devez mentioner un utilisateur pour le rajouter à la liste des administrateurs "
|
||||||
|
"du bot."
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user