diff --git a/bot.py b/bot.py index 82e94a3..5905c24 100755 --- a/bot.py +++ b/bot.py @@ -2,6 +2,7 @@ from collections import namedtuple import copy +from datetime import datetime, timedelta from functools import partial import json from pathlib import Path @@ -382,9 +383,16 @@ async def melanger(ctx: commands.Context, nb_defis: int = 5): await afficher_main(ctx, author_id=member_id) +@bot.command() async def de(ctx: commands.Context, nb_faces: int = 6): resultat = random.randint(1, nb_faces + 1) - await ctx.reply(f":dice: Résultat du dé à {nb_faces} faces : **{resultat}**") + await ctx.reply(f":game_die: Résultat du dé à {nb_faces} faces : **{resultat}**") + + +@bot.command() +async def chronometre(ctx: commands.Context, minutes: int = 30, secondes: int = 0): + fin = datetime.now() + timedelta(minutes=minutes, seconds=secondes) + await ctx.send(f"Chronomètre lancé pour **{minutes:02d}:{secondes:02d}** (fin à )\nFin ") @bot.command() @@ -437,6 +445,8 @@ async def save(ctx: commands.Context): @terminer.error @echange.error @melanger.error +@de.error +@chronometre.error @debug.error @reload.error @save.error