tomservobot/src/tomservobot/reactions.py

34 lines
1.2 KiB
Python

"""
Reactions - Commands to that send media attachments. Usually used in to react to
certain messages.
"""
from pathlib import Path
from decouple import config # type: ignore
import niobot # type: ignore
ATTACH_PATH = Path(config("ATTACH_PATH", default="./attachments/", cast=str))
class ReactionsModule(niobot.Module):
"""Specifically for reactions/replies to certain comments/events."""
@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)
@niobot.command()
async def rimshot(self, ctx: niobot.Context):
"""Ba-Dum-Tsssssssss. . ."""
attachment = await niobot.ImageAttachment.from_file(ATTACH_PATH / "rimshot.gif")
await ctx.client.send_message(ctx.room, None, attachment)
@niobot.command()
async def weekend(self, ctx: niobot.Context):
"""Ladies and gentlemen--the weekend. . ."""
attachment = await niobot.VideoAttachment.from_file(ATTACH_PATH / "weekend.mp4")
await ctx.client.send_message(ctx.room, None, attachment)