fix(command): fix help spam

This commit is contained in:
Romain J 2020-04-08 00:26:26 +02:00
parent 68ca0cb2fc
commit daed469994

View file

@ -58,13 +58,13 @@ class Basics(commands.Cog):
"""---------------------------------------------------------------------""" """---------------------------------------------------------------------"""
@commands.command() @commands.command()
async def help(self, ctx): async def help(self, ctx, page: int = 1):
"""Affiches l'aide du bot""" """Affiches l'aide du bot"""
page = int(page) if 0 < int(page) < 5 else 1
text = open('texts/help.md').read().split("[split]") text = open('texts/help.md').read().split("[split]")
for txt in text: em = discord.Embed(title='Commandes de TuxBot', description=text[page - 1],
em = discord.Embed(title='Commandes de TuxBot', description=txt,
colour=0x89C4F9) colour=0x89C4F9)
await ctx.send(embed=em) await ctx.send(content=f"page {page}/{len(text)}", embed=em)
def setup(bot): def setup(bot):