Aller au contenu

Misc

MiscCog(bot)

Bases: Cog

Source code in etuutt_bot/commands/misc.py
def __init__(self, bot: EtuUTTBot) -> None:
    self.bot = bot
    # Circumvent impossibility to add context menu commands in cogs
    self.ctx_pin = app_commands.ContextMenu(
        name="Épingler/Désépingler",
        callback=self.pin,
    )
    self.ctx_delete = app_commands.ContextMenu(
        name="Supprimer jusqu'ici",
        callback=self.delete,
    )
    self.bot.tree.add_command(self.ctx_pin)
    self.bot.tree.add_command(self.ctx_delete)