Passage des méthodes en membre protégé

This commit is contained in:
Mylloon 2020-11-24 09:22:24 +01:00
parent d963f743e6
commit 827d7b753f

View file

@ -18,8 +18,8 @@ class Commands(commands.Cog):
# dans le message envoyer : le premier chiffre est la latence du protocole Discord WebSocket,
# le deuxieme c'est le temps que le bot a pris pour faire les p'tits calculs,
# le troisième c'est le temps que le bot a pris pour réagir au message
@commands.command()
async def ping(self, ctx, *, question = '0'):
@commands.command(name='ping')
async def _ping(self, ctx, *, question = '0'):
"""Affiche mon ping.\n ➡ Syntaxe: .ping [help]"""
if question == 'help':
return await ctx.send(embed = discord.Embed(color = randint(0, 0xFFFFFF),
@ -36,8 +36,8 @@ class Commands(commands.Cog):
description = f':hourglass: {round(self.bot.latency * 1000)}ms\n\n:stopwatch: {ping2}ms\n\n:heartbeat: {ping}ms'))
await ctx.message.add_reaction(emoji = '')
@commands.command(aliases = ['calculatrice', 'calcu' 'calcul'])
async def calc(self, ctx, *, msg):
@commands.command(name='calc', aliases = ['calculatrice', 'calcu' 'calcul'])
async def _calc(self, ctx, *, msg):
"""Calculatrice.\n ➡ Syntaxe: .calc/calculatrice/calcu/calcul <calcul>"""
equation = msg.replace('^', '**').replace('x', '*').replace('×', '*').replace('÷', '/').replace('', '>=').replace('', '<=')
try:
@ -78,8 +78,8 @@ class Commands(commands.Cog):
async def calc_error(self, ctx, error):
await ctx.send("Tu n'as pas spécifié de calcul.")
@commands.command(aliases = ['syntaxe'])
async def syntax(self, ctx):
@commands.command(name='syntax', aliases = ['syntaxe'])
async def _syntax(self, ctx):
"""Informations pour bien éditer son texte.\n ➡ Syntaxe: .syntax/syntaxe"""
syntaxe = "-----------------------------------------------------\n"
syntaxe += discord.utils.escape_markdown("```Js\n")
@ -124,8 +124,8 @@ class Commands(commands.Cog):
await ctx.message.add_reaction(emoji = '')
await ctx.send(syntaxe)
@commands.command(aliases = ['info'])
async def infos(self, ctx):
@commands.command(name='infos', aliases = ['info'])
async def _infos(self, ctx):
"""Donne des infos sur le bot.\n ➡ Syntaxe: .infos/info"""
appinfo = await self.bot.application_info()
@ -156,8 +156,8 @@ class Commands(commands.Cog):
await ctx.message.add_reaction(emoji = '')
await ctx.send(embed=embed)
@commands.command()
async def whois(self, ctx, *user: discord.Member):
@commands.command(name='whois')
async def _whois(self, ctx, *user: discord.Member):
"""Affiche les infos sur l'utilisateur.\n ➡ Syntaxe: .whois [user]"""
if len(user) <= 1:
if user == ():
@ -215,9 +215,9 @@ class Commands(commands.Cog):
message = message + f", {tuple[i]} {time[i]}"
return message[2:]
@commands.command()
@commands.command(name='appel')
@commands.has_any_role("Professeur", "professeur", "Prof", "prof")
async def appel(self, ctx, *, voice_channel: int = None):
async def _appel(self, ctx, *, voice_channel: int = None):
voice_channels = []
voice_channels.extend(ctx.guild.voice_channels)
if voice_channel: