EmperorFred/libs/Cog.py

24 lines
678 B
Python
Raw Normal View History

2025-12-06 02:21:47 +00:00
from __future__ import annotations
import discord
from discord.ext import commands as discord_commands
class Cog(discord_commands.Cog):
"""Lightweight wrapper around discord.py's Cog used across bots.
Provides a typed `bot` attribute on instances.
"""
def __init__(self, bot: discord_commands.Bot) -> None:
self.bot: discord_commands.Bot = bot
self.messages_deletable = False
@discord_commands.Cog.listener()
async def on_ready(self):
print(f"{self.__name__} is ready")
async def delete_message(self, interaction: discord.Interaction):
if self.messages_deletable:
await interaction.message.delete()