Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy over some gag commands from old zodbot #22

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions fedora/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .db import upgrade_table
from .distgit import DistGitHandler
from .fas import FasHandler
from .gags import MiscHandler
from .oncall import OnCallHandler
from .pagureio import PagureIOHandler

Expand All @@ -35,6 +36,7 @@ async def start(self) -> None:
self.register_handler_class(BugzillaHandler(self))
self.register_handler_class(OnCallHandler(self))
self.register_handler_class(CookieHandler(self))
self.register_handler_class(MiscHandler(self))

async def stop(self) -> None:
pass
Expand Down Expand Up @@ -77,6 +79,9 @@ async def bothelp(self, evt: MessageEvent, commandname: str) -> None:
else:
# list all the commands with the help arg from command.new
for cmd in self._get_handler_commands():
# Skip undocumented commands
if cmd.__mb_help__ is None:
continue
output.append(
f"* `{cmd.__mb_prefix__} {cmd.__mb_usage_args__}` - {cmd.__mb_help__}"
)
Expand Down
32 changes: 32 additions & 0 deletions fedora/gags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from __future__ import annotations

from maubot import MessageEvent
from maubot.handlers import command

from .handler import Handler

"""
Old zodbot had a lot of fun little gags.
Why not carry (some of) them over?
"""


class MiscHandler(Handler):
@command.new(name="fire")
@command.argument("firee", required=True)
async def fire(self, evt: MessageEvent, firee: str) -> None:
await evt.mark_read()
await evt.react("🔥")
await evt.reply(f"adamw fires {firee}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be @adamwill:fedora.im

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does Adam think about being pinged each time someone uses this command?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's @AdamWill's thing, we can ask. Though, he was pinged before when it was used.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think i'd rather not be pinged. thanks!


@command.new(name="cake")
async def cake(self, evt: MessageEvent) -> None:
await evt.mark_read()
await evt.react("🍰")
await evt.reply(f"here {evt.sender}, take your slice of cake")

@command.new(name="beefymiracle")
async def beefymiracle(self, evt: MessageEvent) -> None:
await evt.mark_read()
await evt.react("🌭")
await evt.reply("ALL HAIL THE BEEFY MIRACLE!! (The mustard indicates progress)")