Add ops plugin
This commit is contained in:
parent
ea6b383476
commit
190b2ee7ec
|
@ -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 <channel/user> <message>')
|
||||||
|
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 <channel/user> <message>')
|
||||||
|
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 <channel/user> <message>')
|
||||||
|
ctx.notice(*args)
|
Loading…
Reference in New Issue