diff --git a/breadbot/plugins/ops.py b/breadbot/plugins/ops.py new file mode 100644 index 0000000..7c058da --- /dev/null +++ b/breadbot/plugins/ops.py @@ -0,0 +1,40 @@ +from pinhook import bot, plugin # type: ignore + + +@plugin.command( + '?say', + help_text='Make the bot talk.', + ops=True, + ops_msg='This is an administrators-only command.', +) +def say(ctx: bot.Bot.Message) -> None: + args = (ctx.arg or '').split(maxsplit=1) + if len(args) < 2: + return plugin.message('Usage: ?say ') + ctx.privmsg(*args) + + +@plugin.command( + '?action', + help_text='Make the bot do something (/me)', + ops=True, + ops_msg='This is an administrators-only command.', +) +def action(ctx: bot.Bot.Message) -> None: + args = (ctx.arg or '').split(maxsplit=1) + if len(args) < 2: + return plugin.message('Usage: ?action ') + ctx.action(*args) + + +@plugin.command( + '?notice', + help_text='Send a notice to someone from the bot.', + ops=True, + ops_msg='This is an administrators-only command.', +) +def notice(ctx: bot.Bot.Message) -> None: + args = (ctx.arg or '').split(maxsplit=1) + if len(args) < 2: + return plugin.message('Usage: ?notice ') + ctx.notice(*args)