real correction due to the new slash command whose commands were bugging if they had arguments
This commit is contained in:
parent
34459adc5e
commit
e96fad8bf1
5 changed files with 29 additions and 11 deletions
|
@ -119,14 +119,16 @@ class Fun(commands.Cog):
|
|||
return await self._love(ctx, user1, True)
|
||||
|
||||
@commands.command(name='8ball', aliases=['8b', '8balls'])
|
||||
async def _8ball(self, ctx, fromSlash = False):
|
||||
async def _8ball(self, ctx, fromSlash = None):
|
||||
"""Répond à ta question 🔮.\n ➡ Syntaxe: {PREFIX}8ball/8b"""
|
||||
if fromSlash == None:
|
||||
fromSlash = False
|
||||
reponses=["c'est sûr.","il en est décidément ainsi.","incontestablement.","oui sans aucun doute.","tu peux t'y fier.","tel que je le vois, oui.","c'est le plus probable.",
|
||||
"cela montre de bonnes perspectives.","certes.","les signes indiquent que oui.","ma réponse est oui.","ta question est trop floue, réessaie.","redemandes plus tard stp.",
|
||||
"je ferais mieux de pas te le dire maintenant...","je ne peux pas le prédire actuellement :/","concentre-toi et redemande.","n'y comptes pas trop.","ma réponse est non.",
|
||||
"mes sources disent que non.", "les perspectives ne sont pas si bonnes...","c'est très douteux."]
|
||||
if fromSlash != True:
|
||||
await ctx.message.add_reaction(emoji = '✅')
|
||||
if fromSlash != True: await ctx.message.add_reaction(emoji = '✅')
|
||||
return await ctx.send(f"{ctx.author.mention}, {choice(reponses)}")
|
||||
@_8ball.error
|
||||
async def _8ball_error(self, ctx, error):
|
||||
|
|
|
@ -103,8 +103,10 @@ class Games(commands.Cog):
|
|||
await ctx.send(f"T'as pas trouvé {ctx.author.mention}... dommage, c'était {number}.")
|
||||
|
||||
@commands.command(name='pileouface', aliases=['pf'])
|
||||
async def _pileouface(self, ctx, fromSlash = False):
|
||||
async def _pileouface(self, ctx, fromSlash = None):
|
||||
"""Pile ou face.\n ➡ Syntaxe: {PREFIX}pileouface/pf"""
|
||||
if fromSlash == None:
|
||||
fromSlash = False
|
||||
if fromSlash != True:
|
||||
await ctx.message.add_reaction(emoji = '✅')
|
||||
return await ctx.send(f"{'Pile' if randint(0,1) == 1 else 'Face'} !")
|
||||
|
|
|
@ -107,8 +107,10 @@ class Internet(commands.Cog):
|
|||
return await self._cat(ctx, True)
|
||||
|
||||
@commands.command(name='dog', aliases = ['chien'])
|
||||
async def _dog(self, ctx, fromSlash = False):
|
||||
async def _dog(self, ctx, fromSlash = None):
|
||||
"""Te montre un magnifique chien\n ➡ Syntaxe: {PREFIX}dog/chien"""
|
||||
if fromSlash == None:
|
||||
fromSlash = False
|
||||
|
||||
if ctx.author.nick:
|
||||
name = f"{ctx.author.nick} ({ctx.author.name}#{ctx.author.discriminator})"
|
||||
|
|
|
@ -76,8 +76,10 @@ class School(commands.Cog):
|
|||
pass
|
||||
|
||||
@commands.command(name='getid', hidden = True)
|
||||
async def _getid(self, ctx, fromSlash = False):
|
||||
async def _getid(self, ctx, fromSlash = None):
|
||||
"""Tuto vidéo sur comment récupérer l'ID d'un utilisateur/salon"""
|
||||
if fromSlash == None:
|
||||
fromSlash = False
|
||||
if fromSlash != True:
|
||||
await ctx.message.add_reaction(emoji = '✅')
|
||||
return await ctx.send("Explication sur comment récuperer l'ID d'un utilisateur/salon : https://cdn.discordapp.com/attachments/640312926892195842/780802253258358834/GetID.mp4")
|
||||
|
|
|
@ -123,8 +123,10 @@ class Utils(commands.Cog):
|
|||
return await self._calc(ctx, calcul, True)
|
||||
|
||||
@commands.command(name='syntax')
|
||||
async def _syntax(self, ctx, fromSlash = False):
|
||||
async def _syntax(self, ctx, fromSlash = None):
|
||||
"""Informations pour bien éditer son texte."""
|
||||
if fromSlash == None:
|
||||
fromSlash = False
|
||||
syntaxe = "-----------------------------------------------------\n"
|
||||
syntaxe += discord.utils.escape_markdown("```Js\n")
|
||||
syntaxe += discord.utils.escape_markdown("//code en js (possible de remplacer 'js' par d'autres languages . adaptez le !)\n")
|
||||
|
@ -165,8 +167,11 @@ class Utils(commands.Cog):
|
|||
syntaxe += "-----------------------------------------------------\n"
|
||||
syntaxe += discord.utils.escape_markdown(">>> cette ligne est cité\ncelle là aussi (et elles le seront toutes!)\n")
|
||||
syntaxe += ">>> cette ligne est cité\ncelle là aussi (et elles le seront toutes!)\n"
|
||||
try:
|
||||
if fromSlash != True:
|
||||
await ctx.message.add_reaction(emoji = '✅')
|
||||
except:
|
||||
pass
|
||||
await ctx.send(syntaxe)
|
||||
@cog_ext.cog_slash(name="syntax", description = "Informations pour bien éditer son texte.")
|
||||
async def __syntax(self, ctx):
|
||||
|
@ -210,8 +215,10 @@ class Utils(commands.Cog):
|
|||
return await self._memo(ctx, memo, True)
|
||||
|
||||
@commands.command(name='infos', aliases = ['info'])
|
||||
async def _infos(self, ctx, fromSlash = False):
|
||||
async def _infos(self, ctx, fromSlash = None):
|
||||
"""Donne des infos sur le bot.\n ➡ Syntaxe: {PREFIX}infos/info"""
|
||||
if fromSlash == None:
|
||||
fromSlash = False
|
||||
appinfo = await self.client.application_info()
|
||||
|
||||
embed = discord.Embed(color = discord.Colour.random())
|
||||
|
@ -244,8 +251,11 @@ class Utils(commands.Cog):
|
|||
embed.add_field(name = "Timezone", value = f"`{self.customTimezone}`")
|
||||
embed.add_field(name = "Version", value = f"`{version}`")
|
||||
embed.set_footer(text = f"Basé sur discord.py {discord.__version__}")
|
||||
try:
|
||||
if fromSlash != True:
|
||||
await ctx.message.add_reaction(emoji = '✅')
|
||||
except:
|
||||
pass
|
||||
await ctx.send(embed = embed)
|
||||
@cog_ext.cog_slash(name="infos", description = "Donne des infos sur le bot.")
|
||||
async def __infos(self, ctx):
|
||||
|
|
Reference in a new issue