refactor(cogs): prepare the env for new help command

This commit is contained in:
Romain J 2020-01-04 21:16:37 +01:00
parent 07e683e7cb
commit 7b1fd7b463
43 changed files with 657 additions and 363 deletions

9
bot.py
View file

@ -28,7 +28,7 @@ l_extensions: List[str] = [
'cogs.Admin',
'cogs.Help',
'cogs.Logs',
'cogs.Monitoring',
# 'cogs.Monitoring',
'cogs.Polls',
'cogs.Useful',
'cogs.User',
@ -74,7 +74,8 @@ class TuxBot(commands.AutoShardedBot):
self.cluster = self.fallbacks.find('True', key='This', first=True)
self.version = Version(*version, pre_release='a5', build=build)
self.owner = int
self.owner: discord.User = discord.User
self.owners: List[discord.User] = []
for extension in l_extensions:
try:
@ -153,6 +154,10 @@ class TuxBot(commands.AutoShardedBot):
self.owner = await self.fetch_user(
int(self.config.get('permissions', 'Owners').split(', ')[0])
)
for owner in self.config.get('permissions', 'Owners').split(', '):
self.owners.append(
await self.fetch_user(int(owner))
)
@staticmethod
async def on_resumed():

View file

@ -66,7 +66,7 @@ class Admin(commands.Cog):
###########################################################################
@groupExtra(name='say', invoke_without_command=True, category='admin',
description=Texts('commands').get('admin._say'))
description=Texts('admin_help').get('_say'))
async def _say(self, ctx: commands.Context, *, content: str):
if ctx.invoked_subcommand is None:
try:
@ -77,7 +77,7 @@ class Admin(commands.Cog):
await ctx.send(content)
@_say.command(name='edit',
description=Texts('commands').get('admin._say_edit'))
description=Texts('admin_help').get('_say_edit'))
async def _say_edit(self, ctx: commands.Context, message_id: int, *,
content: str):
try:
@ -95,7 +95,7 @@ class Admin(commands.Cog):
delete_after=5)
@_say.command(name='to',
description=Texts('commands').get('admin._say_to'))
description=Texts('admin_help').get('_say_to'))
async def _say_to(self, ctx: commands.Context,
channel: Union[discord.TextChannel, discord.User], *,
content):
@ -109,7 +109,7 @@ class Admin(commands.Cog):
###########################################################################
@commandExtra(name='ban', category='admin',
description=Texts('commands').get('admin._ban'))
description=Texts('admin_help').get('_ban'))
async def _ban(self, ctx: commands.Context, user: discord.Member, *,
reason=""):
try:
@ -137,7 +137,7 @@ class Admin(commands.Cog):
###########################################################################
@commandExtra(name='kick', category='admin',
description=Texts('commands').get('admin._kick'))
description=Texts('admin_help').get('_kick'))
async def _kick(self, ctx: commands.Context, user: discord.Member, *,
reason=""):
try:
@ -165,7 +165,7 @@ class Admin(commands.Cog):
###########################################################################
@commandExtra(name='clear', category='admin',
description=Texts('commands').get('admin._clear'))
description=Texts('admin_help').get('_clear'))
async def _clear(self, ctx: commands.Context, count: int):
try:
await ctx.message.delete()
@ -176,13 +176,13 @@ class Admin(commands.Cog):
###########################################################################
@groupExtra(name='react', category='admin',
description=Texts('commands').get('admin._react'))
description=Texts('admin_help').get('_react'))
async def _react(self, ctx: commands.Context):
if ctx.invoked_subcommand is None:
await ctx.send_help('react')
@_react.command(name='add',
description=Texts('commands').get('admin._react_add'))
description=Texts('admin_help').get('admin._react_add'))
async def _react_add(self, ctx: commands.Context, message_id: int, *,
emojis: str):
emojis: list = emojis.split(' ')
@ -199,7 +199,7 @@ class Admin(commands.Cog):
delete_after=5)
@_react.command(name='clear',
description=Texts('commands').get('admin._react_remove'))
description=Texts('admin_help').get('_react_remove'))
async def _react_remove(self, ctx: commands.Context, message_id: int):
try:
message: discord.Message = await ctx.channel.fetch_message(
@ -214,7 +214,7 @@ class Admin(commands.Cog):
@groupExtra(name='delete', invoke_without_command=True,
category='admin',
description=Texts('commands').get('admin._delete'))
description=Texts('admin_help').get('_delete'))
async def _delete(self, ctx: commands.Context, message_id: int):
try:
await ctx.message.delete()
@ -231,7 +231,7 @@ class Admin(commands.Cog):
delete_after=5)
@_delete.command(name='from', aliases=['to', 'in'],
description=Texts('commands').get('admin._delete_from'))
description=Texts('admin_help').get('_delete_from'))
async def _delete_from(self, ctx: commands.Context,
channel: discord.TextChannel, message_id: int):
try:
@ -294,7 +294,7 @@ class Admin(commands.Cog):
self.bot.database.session.commit()
@groupExtra(name='warn', aliases=['warns'], category='admin',
description=Texts('commands').get('admin._warn'))
description=Texts('admin_help').get('_warn'))
async def _warn(self, ctx: commands.Context):
await ctx.trigger_typing()
if ctx.invoked_subcommand is None:
@ -307,7 +307,7 @@ class Admin(commands.Cog):
await ctx.send(embed=e)
@_warn.command(name='add', aliases=['new'],
description=Texts('commands').get('admin._warn_new'))
description=Texts('admin_help').get('_warn_new'))
async def _warn_new(self, ctx: commands.Context, member: discord.Member,
*, reason="N/A"):
member = await ctx.guild.fetch_member(member.id)
@ -386,8 +386,8 @@ class Admin(commands.Cog):
f"\n**{Texts('admin', ctx).get('Reason')}:** `{reason}`"
)
@_warn.command(name='remove', aliases=['revoke'],
description=Texts('commands').get('admin._warn_remove'))
@_warn.command(name='remove', aliases=['revoke', 'del', 'delete'],
description=Texts('admin_help').get('_warn_remove'))
async def _warn_remove(self, ctx: commands.Context, warn_id: int):
warn = self.bot.database.session \
.query(WarnModel) \
@ -399,8 +399,8 @@ class Admin(commands.Cog):
await ctx.send(f"{Texts('admin', ctx).get('Warn with id')} `{warn_id}`"
f" {Texts('admin', ctx).get('successfully removed')}")
@_warn.command(name='show', aliases=['list'],
description=Texts('commands').get('admin._warn_show'))
@_warn.command(name='show', aliases=['list', 'all'],
description=Texts('admin_help').get('_warn_show'))
async def _warn_show(self, ctx: commands.Context, member: discord.Member):
warns_list, warns = await self.get_warn(ctx, member)
@ -411,8 +411,8 @@ class Admin(commands.Cog):
await ctx.send(embed=e)
@_warn.command(name='edit', aliases=['change'],
description=Texts('commands').get('admin._warn_edit'))
@_warn.command(name='edit', aliases=['change', 'modify'],
description=Texts('admin_help').get('_warn_edit'))
async def _warn_edit(self, ctx: commands.Context, warn_id: int, *, reason):
warn = self.bot.database.session \
.query(WarnModel) \
@ -429,7 +429,7 @@ class Admin(commands.Cog):
@commandExtra(name='language', aliases=['lang', 'langue', 'langage'],
category='admin',
description=Texts('commands').get('admin._language'))
description=Texts('admin_help').get('_language'))
async def _language(self, ctx: commands.Context, locale: str):
available = self.bot.database.session \
.query(LangModel.value) \
@ -460,13 +460,13 @@ class Admin(commands.Cog):
###########################################################################
@groupExtra(name='prefix', aliases=['prefixes'], category='admin',
description=Texts('commands').get('admin._prefix'))
description=Texts('admin_help').get('_prefix'))
async def _prefix(self, ctx: commands.Context):
if ctx.invoked_subcommand is None:
await ctx.send_help('prefix')
@_prefix.command(name='add', aliases=['set', 'new'],
description=Texts('commands').get('admin._prefix_add'))
description=Texts('admin_help').get('_prefix_add'))
async def _prefix_add(self, ctx: commands.Context, prefix: str):
if str(ctx.guild.id) in self.bot.prefixes:
prefixes = self.bot.prefixes.get(
@ -500,7 +500,7 @@ class Admin(commands.Cog):
)
@_prefix.command(name='remove', aliases=['drop', 'del', 'delete'],
description=Texts('commands').get('admin._prefix_remove'))
description=Texts('admin_help').get('_prefix_remove'))
async def _prefix_remove(self, ctx: commands.Context, prefix: str):
if str(ctx.guild.id) in self.bot.prefixes:
prefixes = self.bot.prefixes.get(
@ -529,7 +529,7 @@ class Admin(commands.Cog):
)
@_prefix.command(name='list', aliases=['show', 'all'],
description=Texts('commands').get('admin._prefix_list'))
description=Texts('admin_help').get('_prefix_list'))
async def _prefix_list(self, ctx: commands.Context):
extras = ['.']
if ctx.message.guild is not None:

View file

@ -6,8 +6,7 @@ import discord
from discord.ext import commands
from bot import TuxBot
from utils import FieldPages
from utils import commandsPlus
from utils import Texts
log = logging.getLogger(__name__)
@ -18,197 +17,51 @@ class HelpCommand(commands.HelpCommand):
self.ignore_cogs = ["Monitoring", "Help", "Logs"]
self.owner_cogs = []
def get_command_signature(self, command):
return f"[{command.cog.qualified_name.upper()}] > {command.qualified_name}"
def common_command_formatting(self, emb, command):
emb.title = self.get_command_signature(command)
if command.cog_name != "Jishaku":
emb.set_thumbnail(url=command.cog.big_icon)
try:
emb.description = f"{command.cog.qualified_name.lower()}_help " \
f"{command.parent}_{command.name}_description"
except:
emb.description = f"{command.cog.qualified_name.lower()}_help " \
f"{command.name}_description"
usage = "help.command_help.usage"
try:
if command.parent:
try:
usg = f"{command.cog.qualified_name.lower()}_help " \
f"{command.parent}_{command.name}_usage"
except:
usg = f"{command.cog.qualified_name.lower()}_help " \
f"{command.name}_usage"
else:
usg = f"{command.cog.qualified_name.lower()}_help " \
f"{command.name}_usage"
emb.add_field(name=usage,
value=f"{self.context.prefix}{command.qualified_name} " + usg)
except KeyError:
emb.add_field(name=usage,
value=f"{self.context.prefix}{command.qualified_name}")
aliases = "`" + '`, `'.join(command.aliases) + "`"
if aliases == "``":
aliases = "help " \
"help.command_help.no_aliases"
emb.add_field(name="help "
"help.command_help.aliases",
value=aliases)
return emb
async def command_callback(self, ctx, *, command=None):
await self.prepare_help_command(ctx, command)
if command is None:
mapping = self.get_bot_mapping()
return await self.send_bot_help(mapping)
cog = ctx.bot.get_cog(command.title())
if cog is not None:
return await self.send_cog_help(cog)
maybe_coro = discord.utils.maybe_coroutine
keys = command.split(' ')
cmd = ctx.bot.all_commands.get(keys[0])
if cmd is None:
string = await maybe_coro(self.command_not_found,
self.remove_mentions(keys[0]))
return await self.send_error_message(string)
for key in keys[1:]:
try:
found = cmd.all_commands.get(key)
except AttributeError:
string = await maybe_coro(self.subcommand_not_found, cmd,
self.remove_mentions(key))
return await self.send_error_message(string)
else:
if found is None:
string = await maybe_coro(self.subcommand_not_found,
cmd,
self.remove_mentions(key))
return await self.send_error_message(string)
cmd = found
if isinstance(cmd, commands.Group):
return await self.send_group_help(cmd)
else:
return await self.send_command_help(cmd)
async def send_bot_help(self, mapping):
owner = self.context.bot.owner
emb = discord.Embed(color=discord.colour.Color.blue())
emb.description = "help " \
"help.main_page.description".format(owner)
emb.set_author(icon_url=self.context.author.avatar_url,
name=self.context.author)
owners = self.context.bot.owners
owners_name = [
f"{owner.name}#{owner.discriminator}"
for owner in owners
]
e = discord.Embed(
color=discord.colour.Color.blue(),
description=Texts(
'help', self.context
).get(
'main_page.description'
).format(
', '.join(owners_name[:-1]) + ' & ' + owners_name[-1]
)
)
e.set_author(
icon_url=self.context.author.avatar_url_as(format='png'),
name=self.context.author
)
cogs = ""
for extension in self.context.bot.cogs.values():
if self.context.author != owner and extension.qualified_name.upper() in self.owner_cogs:
if self.context.author not in owners \
and extension.qualified_name in self.owner_cogs:
continue
if self.context.author == owner and extension.qualified_name in self.ignore_cogs:
if self.context.author in owners \
and extension.qualified_name in self.ignore_cogs:
continue
if extension.qualified_name == "Jishaku":
continue
cogs += f"{extension.icon} **{extension.qualified_name}**\n"
emb.add_field(name="help "
"help.main_page.field_title.categories",
value=cogs)
e.add_field(
name=Texts(
'help', self.context
).get(
'main_page.categories'
),
value=cogs
)
await self.context.send(embed=emb)
async def send_command_help(self, command):
if command.cog_name in self.ignore_cogs:
return await self.send_error_message(
self.command_not_found(command.name))
if isinstance(command, commandsPlus):
if command.name == "jishaku":
pass
formatted = self.common_command_formatting(
discord.Embed(color=discord.colour.Color.blue()), command)
await self.context.send(embed=formatted)
async def send_group_help(self, group):
if group.cog_name in self.ignore_cogs:
return await self.send_error_message(
self.command_not_found(group.name))
formatted = self.common_command_formatting(
discord.Embed(color=discord.colour.Color.blue()), group)
sub_cmd_list = ""
for group_command in group.commands:
try:
sub_cmd_list += f"`╚╡` **{group_command.name}** - " \
f"{group.cog.qualified_name.lower()}_help " \
f"{group_command.parent}_{group_command.name}_brief\n"
except Exception:
sub_cmd_list += f"`╚╡` **{group_command.name}** - " \
f"{group.cog.qualified_name.lower()}_help" \
f"{group_command.name}_brief\n"
subcommands = "help.command_help.subcommands"
formatted.add_field(name=subcommands, value=sub_cmd_list,
inline=False)
await self.context.send(embed=formatted)
async def send_cog_help(self, cog):
if (
cog.qualified_name.upper() in self.owner_cogs
and not await self.context.bot.is_owner(self.context.author)
) or cog.qualified_name.upper() in self.ignore_cogs:
return
if cog.qualified_name == "Jishaku":
return
if cog.qualified_name in self.ignore_cogs:
return
pages = {}
for cmd in cog.get_commands():
if not await self.context.bot.is_owner(
self.context.author) and (
cmd.hidden or cmd.category == "Hidden"):
continue
if cmd.category not in pages:
pages[cmd.category] = "```asciidoc\n"
cmd_brief = f"{cog.qualified_name.lower()}_help " \
f"{cmd.name}_brief"
pages[
cmd.category] += f"{cmd.name}{' ' * int(17 - len(cmd.name))}:: {cmd_brief}\n"
if isinstance(cmd, commands.Group):
for group_command in cmd.commands:
try:
cmd_brief = f"{cog.qualified_name.lower()}_help " \
f"{group_command.parent}_{group_command.name}_brief"
except Exception:
cmd_brief = f"{cog.qualified_name.lower()}_help " \
f"{group_command.name}_brief"
pages[
cmd.category] += f"{group_command.name}{' ' * int(15 - len(group_command.name))}:: {cmd_brief}\n"
for e in pages:
pages[e] += "```"
formatted = []
for name, cont in pages.items():
formatted.append((name, cont))
footer_text = "help " \
"help.category_page.footer_info".format(self.context.prefix)
pages = FieldPages(self.context,
embed_color=discord.colour.Color.blue(),
entries=formatted,
title=cog.qualified_name.upper(),
thumbnail=cog.big_icon,
footertext=footer_text,
per_page=1)
await pages.paginate()
def command_not_found(self, string):
return 'No command called "{}" found.'.format(string)
await self.context.send(embed=e)
class Help(commands.Cog):

View file

@ -241,7 +241,7 @@ class Logs(commands.Cog):
await self.webhook.send(msg)
@commandExtra(name='commandstats', hidden=True, category='logs',
description=Texts('commands').get('logs._commandstats'))
description=Texts('logs_help').get('_commandstats'))
@commands.is_owner()
async def _commandstats(self, ctx, limit=20):
counter = self.bot.command_stats
@ -257,7 +257,7 @@ class Logs(commands.Cog):
await ctx.send(f'```\n{output}\n```')
@commandExtra(name='socketstats', hidden=True, category='logs',
description=Texts('commands').get('logs._socketstats'))
description=Texts('logs_help').get('_socketstats'))
@commands.is_owner()
async def _socketstats(self, ctx):
delta = datetime.datetime.utcnow() - self.bot.uptime
@ -268,7 +268,7 @@ class Logs(commands.Cog):
f'{total} socket events observed ({cpm:.2f}/minute):\n{self.bot.socket_stats}')
@commandExtra(name='uptime', category='logs',
description=Texts('commands').get('logs._uptime'))
description=Texts('logs_help').get('_uptime'))
async def _uptime(self, ctx):
"""Tells you how long the bot has been up for."""
uptime = humanize.naturaltime(

View file

@ -206,13 +206,13 @@ class Polls(commands.Cog):
@groupExtra(name='sondage', aliases=['poll'],
category='poll',
description=Texts('commands').get('poll._poll'))
description=Texts('poll_help').get('_poll'))
async def _poll(self, ctx: commands.Context):
if ctx.invoked_subcommand is None:
await ctx.send_help('sondage')
@_poll.group(name='create', aliases=['new', 'nouveau'],
description=Texts('commands').get('poll._poll_create'))
description=Texts('poll_help').get('_poll_create'))
async def _poll_create(self, ctx: commands.Context, *, poll: str):
is_anonymous = '--anonyme' in poll
poll = poll.replace('--anonyme', '')

View file

@ -38,8 +38,8 @@ class Useful(commands.Cog):
###########################################################################
@commandExtra(name='iplocalise', category='utility',
description=Texts('commands').get('utility._iplocalise'))
@commandExtra(name='iplocalise', category='useful',
description=Texts('useful_help').get('_iplocalise'))
async def _iplocalise(self, ctx: commands.Context, addr, ip_type=''):
addr = re.sub(r'http(s?)://', '', addr)
addr = addr[:-1] if addr.endswith('/') else addr
@ -52,7 +52,7 @@ class Useful(commands.Cog):
ip = socket.getaddrinfo(addr, None, AF_INET6)[1][4][0]
except socket.gaierror:
return await ctx.send(
Texts('utility', ctx).get('ipv6 not available'))
Texts('useful', ctx).get('ipv6 not available'))
else:
ip = socket.gethostbyname(addr)
@ -62,19 +62,19 @@ class Useful(commands.Cog):
if response.get('status') == 'success':
e = discord.Embed(
title=f"{Texts('utility', ctx).get('Information for')}"
title=f"{Texts('useful', ctx).get('Information for')}"
f" ``{addr}`` *`({response.get('query')})`*",
color=0x5858d7
)
e.add_field(
name=Texts('utility', ctx).get('Belongs to :'),
name=Texts('useful', ctx).get('Belongs to :'),
value=response.get('org', 'N/A'),
inline=False
)
e.add_field(
name=Texts('utility', ctx).get('Is located at :'),
name=Texts('useful', ctx).get('Is located at :'),
value=response.get('city', 'N/A'),
inline=True
)
@ -93,18 +93,18 @@ class Useful(commands.Cog):
await ctx.send(embed=e)
else:
await ctx.send(
content=f"{Texts('utility', ctx).get('info not available')}"
content=f"{Texts('useful', ctx).get('info not available')}"
f"``{response.get('query')}``")
except Exception:
await ctx.send(
f"{Texts('utility', ctx).get('Cannot connect to host')} {addr}"
f"{Texts('useful', ctx).get('Cannot connect to host')} {addr}"
)
###########################################################################
@commandExtra(name='getheaders', category='utility',
description=Texts('commands').get('utility._getheaders'))
@commandExtra(name='getheaders', category='useful',
description=Texts('useful_help').get('_getheaders'))
async def _getheaders(self, ctx: commands.Context, addr: str):
if (addr.startswith('http') or addr.startswith('ftp')) is not True:
addr = f"http://{addr}"
@ -114,7 +114,7 @@ class Useful(commands.Cog):
try:
async with self.bot.session.get(addr) as s:
e = discord.Embed(
title=f"{Texts('utility', ctx).get('Headers of')} {addr}",
title=f"{Texts('useful', ctx).get('Headers of')} {addr}",
color=0xd75858
)
e.add_field(name="Status", value=s.status, inline=True)
@ -129,18 +129,18 @@ class Useful(commands.Cog):
except aiohttp.client_exceptions.ClientError:
await ctx.send(
f"{Texts('utility', ctx).get('Cannot connect to host')} {addr}"
f"{Texts('useful', ctx).get('Cannot connect to host')} {addr}"
)
###########################################################################
@commandExtra(name='git', aliases=['sources', 'source', 'github'],
category='utility',
description=Texts('commands').get('utility._git'))
category='useful',
description=Texts('useful_help').get('_git'))
async def _git(self, ctx):
e = discord.Embed(
title=Texts('utility', ctx).get('git repo'),
description=Texts('utility', ctx).get('git text'),
title=Texts('useful', ctx).get('git repo'),
description=Texts('useful', ctx).get('git text'),
colour=0xE9D460
)
e.set_author(
@ -151,8 +151,8 @@ class Useful(commands.Cog):
###########################################################################
@commandExtra(name='quote', category='utility',
description=Texts('commands').get('utility._quote'))
@commandExtra(name='quote', category='useful',
description=Texts('useful_help').get('_quote'))
async def _quote(self, ctx, message_id: discord.Message):
e = discord.Embed(
colour=message_id.author.colour,
@ -174,8 +174,8 @@ class Useful(commands.Cog):
###########################################################################
@commandExtra(name='ping', category='basics',
description=Texts('commands').get('basics._ping'))
@commandExtra(name='ping', category='useful',
description=Texts('useful_help').get('_ping'))
async def _ping(self, ctx: commands.Context):
start = time.perf_counter()
await ctx.trigger_typing()
@ -183,7 +183,7 @@ class Useful(commands.Cog):
latency = round(self.bot.latency * 1000, 2)
typing = round((end - start) * 1000, 2)
discordapp = measure_latency(host='google.com', wait=0)[0]
discordapp = measure_latency(host='discordapp.com', wait=0)[0]
e = discord.Embed(title='Ping', color=discord.Color.teal())
e.add_field(name='Websocket', value=f'{latency}ms')
@ -195,44 +195,53 @@ class Useful(commands.Cog):
@staticmethod
def fetch_info():
total = 0
total_lines = 0
total_python_lines = 0
file_amount = 0
python_file_amount = 0
ENV = "env"
for path, _, files in os.walk("."):
for name in files:
file_dir = str(pathlib.PurePath(path, name))
if not name.endswith(".py") or ENV in file_dir:
if (
not name.endswith(".py")
and not name.endswith(".po")
and not name.endswith(".json")
) or ENV in file_dir:
continue
file_amount += 1
python_file_amount += 1 if name.endswith(".py") else 0
with open(file_dir, "r", encoding="utf-8") as file:
for line in file:
if not line.strip().startswith("#") \
or not line.strip():
total += 1
total_lines += 1
total_python_lines += 1 if name.endswith(".py") \
else 0
return total, file_amount
return (file_amount, total_lines), (python_file_amount, total_python_lines)
@commandExtra(name='info', aliases=['about'], category='basics',
description=Texts('commands').get('basics._info'))
@commandExtra(name='info', aliases=['about'], category='useful',
description=Texts('useful_help').get('_info'))
async def _info(self, ctx: commands.Context):
proc = psutil.Process()
lines, files = self.fetch_info()
total, python = self.fetch_info()
with proc.oneshot():
mem = proc.memory_full_info()
e = discord.Embed(
title=Texts('basics', ctx).get('Information about TuxBot'),
title=Texts('useful', ctx).get('Information about TuxBot'),
color=0x89C4F9)
e.add_field(
name=f"__{Texts('basics', ctx).get('Latest changes')}__",
name=f"__{Texts('useful', ctx).get('Latest changes')}__",
value=self._latest_commits(),
inline=False)
e.add_field(
name=f"__:busts_in_silhouette: "
f"{Texts('basics', ctx).get('Development')}__",
f"{Texts('useful', ctx).get('Development')}__",
value=f"**Romain#5117:** [git](https://git.gnous.eu/Romain)\n"
f"**Outout#4039:** [git](https://git.gnous.eu/mael)\n",
inline=True
@ -246,45 +255,46 @@ class Useful(commands.Cog):
e.add_field(
name="__:gear: Usage__",
value=f"**{humanize.naturalsize(mem.rss)}** "
f"{Texts('basics', ctx).get('physical memory')}\n"
f"{Texts('useful', ctx).get('physical memory')}\n"
f"**{humanize.naturalsize(mem.vms)}** "
f"{Texts('basics', ctx).get('virtual memory')}\n",
f"{Texts('useful', ctx).get('virtual memory')}\n",
inline=True
)
e.add_field(
name=f"__{Texts('basics', ctx).get('Servers count')}__",
name=f"__{Texts('useful', ctx).get('Servers count')}__",
value=str(len(self.bot.guilds)),
inline=True
)
e.add_field(
name=f"__{Texts('basics', ctx).get('Channels count')}__",
name=f"__{Texts('useful', ctx).get('Channels count')}__",
value=str(len([_ for _ in self.bot.get_all_channels()])),
inline=True
)
e.add_field(
name=f"__{Texts('basics', ctx).get('Members count')}__",
name=f"__{Texts('useful', ctx).get('Members count')}__",
value=str(len([_ for _ in self.bot.get_all_members()])),
inline=True
)
e.add_field(
name=f"__:file_folder: {Texts('basics', ctx).get('Files')}__",
value=str(files),
name=f"__:file_folder: {Texts('useful', ctx).get('Files')}__",
value=f"{total[0]} *({python[0]} <:python:596577462335307777>)*",
inline=True
)
e.add_field(
name=f"__¶ {Texts('basics', ctx).get('Lines')}__",
value=str(lines),
name=f"__¶ {Texts('useful', ctx).get('Lines')}__",
value=f"{total[1]} *({python[1]} <:python:596577462335307777>)*",
inline=True
)
e.add_field(
name=f"__:link: {Texts('basics', ctx).get('Links')}__",
name=f"__:link: {Texts('useful', ctx).get('Links')}__",
value="[tuxbot.gnous.eu](https://tuxbot.gnous.eu/) "
"| [gnous.eu](https://gnous.eu/) "
"| [git](https://git.gnous.eu/gnouseu/tuxbot-bot) "
f"| [{Texts('basics', ctx).get('Invite')}](https://discordapp.com/oauth2/authorize?client_id=301062143942590465&scope=bot&permissions=268749888)",
"| [status](https://status.gnous.eu/check/154250) "
f"| [{Texts('useful', ctx).get('Invite')}](https://discordapp.com/oauth2/authorize?client_id=301062143942590465&scope=bot&permissions=268749888)",
inline=False
)
@ -296,11 +306,11 @@ class Useful(commands.Cog):
###########################################################################
@commandExtra(name='credits', aliases=['contributors', 'authors'],
category='basics',
description=Texts('commands').get('basics._credits'))
category='useful',
description=Texts('useful_help').get('_credits'))
async def _credits(self, ctx: commands.Context):
e = discord.Embed(
title=Texts('basics', ctx).get('Contributors'),
title=Texts('useful', ctx).get('Contributors'),
color=0x36393f
)

View file

@ -20,13 +20,13 @@ class User(commands.Cog):
###########################################################################
@groupExtra(name='alias', aliases=['aliases'], category='user',
description=Texts('commands').get('user._alias'))
description=Texts('user_help').get('user._alias'))
async def _alias(self, ctx: commands.Context):
if ctx.invoked_subcommand is None:
await ctx.send_help('alias')
@_alias.command(name='add', aliases=['set', 'new'],
description=Texts('commands').get('user._alias_add'))
description=Texts('user_help').get('_alias_add'))
async def _alias_add(self, ctx: commands.Context, *, user_alias: str):
is_global = False
if '--global' in user_alias:
@ -54,12 +54,12 @@ class User(commands.Cog):
self.bot.database.session.commit()
@_alias.command(name='remove', aliases=['drop', 'del', 'delete'],
description=Texts('commands').get('user._alias_remove'))
description=Texts('user_help').get('_alias_remove'))
async def _alias_remove(self, ctx: commands.Context, prefix: str):
...
@_alias.command(name='list', aliases=['show', 'all'],
description=Texts('commands').get('user._alias_list'))
description=Texts('user_help').get('_alias_list'))
async def _alias_list(self, ctx: commands.Context):
...

View file

@ -0,0 +1,92 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
msgid '_say'
msgstr ''
msgid '_say_edit'
msgstr ''
msgid '_say_to'
msgstr ''
###########################################################################
msgid '_ban'
msgstr ''
###########################################################################
msgid '_kick'
msgstr ''
###########################################################################
msgid '_clear'
msgstr ''
###########################################################################
msgid '_react'
msgstr ''
msgid '_react_remove'
msgstr ''
###########################################################################
msgid '_delete'
msgstr ''
msgid '_delete_from'
msgstr ''
###########################################################################
msgid '_warn'
msgstr ''
msgid '_warn_new'
msgstr ''
msgid '_warn_remove'
msgstr ''
msgid '_warn_show'
msgstr ''
msgid '_warn_edit'
msgstr ''
###########################################################################
msgid '_language'
msgstr ''
###########################################################################
msgid '_prefix'
msgstr ''
msgid '_prefix_add'
msgstr ''
msgid '_prefix_remove'
msgstr ''
msgid '_prefix_list'
msgstr ''

View file

@ -15,41 +15,8 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
msgid "Information about TuxBot"
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 "Latest changes"
msgstr ""
msgid "Development"
msgstr ""
msgid "physical memory"
msgstr ""
msgid "virtual memory"
msgstr ""
msgid "Servers count"
msgstr ""
msgid "Channels count"
msgstr ""
msgid "Members count"
msgstr ""
msgid "Links"
msgstr ""
msgid "Files"
msgstr ""
msgid "Lines"
msgstr ""
msgid "Invite"
msgstr ""
msgid "Contributors"
msgstr ""
msgid 'main_page.categories'
msgstr 'Categories'

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -15,6 +15,45 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
msgid "Information about TuxBot"
msgstr ""
msgid "Latest changes"
msgstr ""
msgid "Development"
msgstr ""
msgid "physical memory"
msgstr ""
msgid "virtual memory"
msgstr ""
msgid "Servers count"
msgstr ""
msgid "Channels count"
msgstr ""
msgid "Members count"
msgstr ""
msgid "Links"
msgstr ""
msgid "Files"
msgstr ""
msgid "Lines"
msgstr ""
msgid "Invite"
msgstr ""
msgid "Contributors"
msgstr ""
msgid "ipv6 not available"
msgstr "Error, this address is not available in IPv6."

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -0,0 +1,92 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
msgid '_say'
msgstr ''
msgid '_say_edit'
msgstr ''
msgid '_say_to'
msgstr ''
###########################################################################
msgid '_ban'
msgstr ''
###########################################################################
msgid '_kick'
msgstr ''
###########################################################################
msgid '_clear'
msgstr ''
###########################################################################
msgid '_react'
msgstr ''
msgid '_react_remove'
msgstr ''
###########################################################################
msgid '_delete'
msgstr ''
msgid '_delete_from'
msgstr ''
###########################################################################
msgid '_warn'
msgstr ''
msgid '_warn_new'
msgstr ''
msgid '_warn_remove'
msgstr ''
msgid '_warn_show'
msgstr ''
msgid '_warn_edit'
msgstr ''
###########################################################################
msgid '_language'
msgstr ''
###########################################################################
msgid '_prefix'
msgstr ''
msgid '_prefix_add'
msgstr ''
msgid '_prefix_remove'
msgstr ''
msgid '_prefix_list'
msgstr ''

View file

@ -1,55 +0,0 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
msgid "Information about TuxBot"
msgstr "Informations sur TuxBot"
msgid "Latest changes"
msgstr "Derniers changements"
msgid "Development"
msgstr "Développement"
msgid "physical memory"
msgstr "mémoire physique"
msgid "virtual memory"
msgstr "mémoire virtuelle"
msgid "Servers count"
msgstr "Nombre de serveurs"
msgid "Channels count"
msgstr "Nombre de salons"
msgid "Members count"
msgstr "Nombre de membres"
msgid "Links"
msgstr "Liens"
msgid "Files"
msgstr "Fichiers"
msgid "Lines"
msgstr "Lignes"
msgid "Invite"
msgstr "Invitation"
msgid "Contributors"
msgstr "Contributeurs"

View file

@ -0,0 +1,22 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"
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'

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -15,6 +15,45 @@ msgstr ""
"Generated-By: pygettext.py 1.5\n"
msgid "Information about TuxBot"
msgstr "Informations sur TuxBot"
msgid "Latest changes"
msgstr "Derniers changements"
msgid "Development"
msgstr "Développement"
msgid "physical memory"
msgstr "mémoire physique"
msgid "virtual memory"
msgstr "mémoire virtuelle"
msgid "Servers count"
msgstr "Nombre de serveurs"
msgid "Channels count"
msgstr "Nombre de salons"
msgid "Members count"
msgstr "Nombre de membres"
msgid "Links"
msgstr "Liens"
msgid "Files"
msgstr "Fichiers"
msgid "Lines"
msgstr "Lignes"
msgid "Invite"
msgstr "Invitation"
msgid "Contributors"
msgstr "Contributeurs"
msgid "ipv6 not available"
msgstr "Erreur, cette adresse n'est pas disponible en IPv6."

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

View file

@ -0,0 +1,17 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR ORGANIZATION
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2019-09-08 19:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: pygettext.py 1.5\n"

17
generate_locales.sh Executable file
View file

@ -0,0 +1,17 @@
#!/bin/bash
BASEDIR=$(pwd)
cd "$BASEDIR/extras/locales/en/LC_MESSAGES"
for i in *.po ; do
[[ -f "$i" ]] || continue
/usr/lib/python3.8/Tools/i18n/msgfmt.py -o "${i%.po}.mo" "${i%.po}"
done
cd "$BASEDIR/extras/locales/fr/LC_MESSAGES"
for i in *.po ; do
[[ -f "$i" ]] || continue
/usr/lib/python3.8/Tools/i18n/msgfmt.py -o "${i%.po}.mo" "${i%.po}"
done

View file

@ -0,0 +1,60 @@
[INFO ] [2020-01-04 18:47:27] discord.client: logging in using static token
[INFO ] [2020-01-04 18:47:28] discord.gateway: Shard ID 0 has sent the IDENTIFY payload.
[INFO ] [2020-01-04 18:47:28] discord.gateway: Shard ID 0 has connected to Gateway: ["gateway-prd-main-1mb3",{"micros":59339,"calls":["discord-sessions-prd-1-26",{"micros":56634,"calls":["start_session",{"micros":36442,"calls":["api-prd-main-wpx2",{"micros":33053,"calls":["get_user",{"micros":2542},"add_authorized_ip",{"micros":1944},"get_guilds",{"micros":2441},"coros_wait",{"micros":1}]}]},"guilds_connect",{"micros":7,"calls":[]},"presence_connect",{"micros":1,"calls":[]}]}]}] (Session ID: 2e6c7d848985fce96ccf1d3a03a9878b).
[INFO ] [2020-01-04 18:47:38] discord.state: Processed a chunk for 462 members in guild ID 280805240977227776.
[INFO ] [2020-01-04 18:47:38] discord.state: Processed a chunk for 794 members in guild ID 331981755177238530.
[INFO ] [2020-01-04 18:47:38] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:39] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:39] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:40] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:40] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:41] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:41] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:42] discord.state: Processed a chunk for 1000 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:42] discord.state: Processed a chunk for 810 members in guild ID 296698073177128962.
[INFO ] [2020-01-04 18:47:45] cogs.Logs: 2020-01-04 17:48:03.502000: Romain#5117 in #general (Gnous): rm-dev01.info
[INFO ] [2020-01-04 18:49:07] cogs.Logs: 2020-01-04 17:49:25.331000: loup#8965 in #general (Gnous): rm-dev01.info
[INFO ] [2020-01-04 18:50:52] cogs.Logs: 2020-01-04 17:51:11.819000: Romain#5117 in #bot (Gnous): rm-dev01.jsk reloac cogs.Utility
[INFO ] [2020-01-04 18:50:58] cogs.Logs: 2020-01-04 17:51:16.650000: loup#8965 in #bot (Gnous): rm-dev01.info
[INFO ] [2020-01-04 18:50:58] cogs.Logs: 2020-01-04 17:51:17.057000: Romain#5117 in #bot (Gnous): rm-dev01.jsk reload cogs.Utility
[INFO ] [2020-01-04 18:51:09] cogs.Logs: 2020-01-04 17:51:28.317000: Romain#5117 in #bot (Gnous): rm-dev01.jsk reload cogs.Useful
[INFO ] [2020-01-04 18:51:18] cogs.Logs: 2020-01-04 17:51:36.366000: Romain#5117 in #bot (Gnous): rm-dev01.info
[INFO ] [2020-01-04 18:52:22] cogs.Logs: 2020-01-04 17:52:41.348000: loup#8965 in #bot (Gnous): rm-dev01.jsk
[INFO ] [2020-01-04 18:53:20] cogs.Logs: 2020-01-04 17:53:38.893000: Romain#5117 in #bots-spam (Mounak): rm-dev01.info
[INFO ] [2020-01-04 18:57:52] cogs.Logs: 2020-01-04 17:58:10.611000: Romain#5117 in #bot (Gnous): rm-dev01.jsk
[INFO ] [2020-01-04 18:59:40] cogs.Logs: 2020-01-04 17:59:59.117000: Romain#5117 in #tuxbot-test (Gnous): rm-dev01.jsk py
conf = _bot.config.get("permission", "Owners")
[INFO ] [2020-01-04 18:59:49] cogs.Logs: 2020-01-04 18:00:08.291000: Romain#5117 in #tuxbot-test (Gnous): rm-dev01.jsk py
conf = _bot.config.get("permissions", "Owners")
[INFO ] [2020-01-04 18:59:59] cogs.Logs: 2020-01-04 18:00:17.851000: Romain#5117 in #tuxbot-test (Gnous): rm-dev01.jsk py
conf = _bot.config.get("permissions", "Owners")
await _ctx.send(conf)
[INFO ] [2020-01-04 19:01:46] cogs.Logs: 2020-01-04 18:02:04.343000: Romain#5117 in #tuxbot-test (Gnous): rm-dev01.jsk py
conf = _bot.config.get("permissions", "Owners")
conf = conf.split(', ')
conf.append(str(329989396218773504))
conf = ', '.join(conf)
await _ctx.send(conf)
[INFO ] [2020-01-04 19:02:06] cogs.Logs: 2020-01-04 18:02:25.221000: Romain#5117 in #tuxbot-test (Gnous): rm-dev01.jsk py
conf = _bot.config.get("permissions", "Owners")
conf = conf.split(', ')
conf.append(str(a))
conf = ', '.join(conf)
_bot.config.set("permissions", "Owners", conf)
[INFO ] [2020-01-04 19:02:17] cogs.Logs: 2020-01-04 18:02:36.778000: Romain#5117 in #tuxbot-test (Gnous): rm-dev01.jsk py
conf = _bot.config.get("permissions", "Owners")
conf = conf.split(', ')
conf.append(str(123456789))
conf = ', '.join(conf)
_bot.config.set("permissions", "Owners", conf)
[INFO ] [2020-01-04 19:05:37] discord.client: Cleaning up tasks.
[INFO ] [2020-01-04 19:05:37] discord.client: Cleaning up after 6 tasks.
[INFO ] [2020-01-04 19:05:37] discord.client: All tasks finished cancelling.
[INFO ] [2020-01-04 19:05:37] discord.client: Closing the event loop.

View file

@ -37,7 +37,7 @@ deactivate () {
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/opt/tuxbot-bot/venv"
VIRTUAL_ENV="/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"

View file

@ -8,7 +8,7 @@ alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PA
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/opt/tuxbot-bot/venv"
setenv VIRTUAL_ENV "/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"

View file

@ -29,7 +29,7 @@ end
# unset irrelevant variables
deactivate nondestructive
set -gx VIRTUAL_ENV "/opt/tuxbot-bot/venv"
set -gx VIRTUAL_ENV "/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/bin" $PATH

View file

@ -1,4 +1,4 @@
#!/opt/tuxbot-bot/venv/bin/python
#!/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys

View file

@ -1,4 +1,4 @@
#!/opt/tuxbot-bot/venv/bin/python
#!/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys

View file

@ -1,4 +1,4 @@
#!/opt/tuxbot-bot/venv/bin/python
#!/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys

View file

@ -1,4 +1,4 @@
#!/opt/tuxbot-bot/venv/bin/python
#!/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys

View file

@ -1,4 +1,4 @@
#!/opt/tuxbot-bot/venv/bin/python
#!/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys

View file

@ -1,4 +1,4 @@
#!/opt/tuxbot-bot/venv/bin/python
#!/home/romain/gnousEU/rm-dev01/tuxbot-bot/venv/bin/python
# -*- coding: utf-8 -*-
import re
import sys