You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
exclamation-mark-charity/exclamation_mark_charity/modules/charity/cog.py

25 lines
765 B
Python

from logging import Logger
import interactions
from interactions import Extension, Client, Message
from exclamation_mark_charity.logger_factory import LoggerFactory
class Charity(Extension):
def __init__(self, bot: Client):
self.bot: Client = bot
self.logger: Logger = LoggerFactory.get_logger(__name__)
@interactions.extension_listener(name="on_message_create")
async def on_message_create(self, message: Message):
if int(message.author.id) != int(self.bot.me.id):
if message.content.strip() == "!charity":
channel = await message.get_channel()
await channel.send("!charity")
self.logger.info("!charity command fired!")
def setup(bot: Client):
Charity(bot)