From 520097460bd69bb49f6415d5403a20f77dc52730 Mon Sep 17 00:00:00 2001 From: jodhus Date: Thu, 11 Jul 2024 22:16:46 -0400 Subject: [PATCH] Added panic reaction. Cleaned up debug prints. --- src/tomservobot/reactions.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/tomservobot/reactions.py b/src/tomservobot/reactions.py index 7123492..e4cfb7e 100644 --- a/src/tomservobot/reactions.py +++ b/src/tomservobot/reactions.py @@ -1,7 +1,12 @@ +""" +Reactions - Commands to that send media attachments. Usually used in to react to +certain messages. +""" + from pathlib import Path -from decouple import config -import niobot +from decouple import config # type: ignore +import niobot # type: ignore ATTACH_PATH = Path(config("ATTACH_PATH", default="./attachments/", cast=str)) @@ -10,12 +15,14 @@ ATTACH_PATH = Path(config("ATTACH_PATH", default="./attachments/", cast=str)) class ReactionsModule(niobot.Module): """Specifically for reactions/replies to certain comments/events.""" - def __init__(self, bot: niobot.NioBot): - self.bot = bot - @niobot.command() async def weekend(self, ctx: niobot.Context): """Ladies and gentlemen--the weekend. . .""" - print(ATTACH_PATH / "weekend.mp4") attachment = await niobot.VideoAttachment.from_file(ATTACH_PATH / "weekend.mp4") await ctx.client.send_message(ctx.room, None, attachment) + + @niobot.command() + async def panic(self, ctx: niobot.Context): + """AAAAAAHHHHHHHHHHHHHH!!!!!!!""" + attachment = await niobot.ImageAttachment.from_file(ATTACH_PATH / "panic.gif") + await ctx.client.send_message(ctx.room, None, attachment)