juju/plugins/echo.py

25 lines
818 B
Python
Raw Normal View History

2023-06-26 15:31:30 +00:00
from pinhook import plugin as p
@p.command('&echo', ops=True, help_text='Replies the current message to the current channel/user')
def echo(msg):
if msg.nick in msg.ops:
return p.message(msg.arg)
@p.command('&ech', ops=True, help_text='Sends a message to a channel you specify')
def echo(msg):
if msg.nick in msg.ops:
arg = msg.arg.split(' ')
chan = arg[0]
mesg = ' '.join(arg[1:])
msg.privmsg(chan, mesg)
return p.message(f'"{mesg}" sent to {chan}')
@p.command('&nech', ops=True, help_text='Sends a notice to a channel you specify')
def notice(msg):
if msg.nick in msg.ops:
arg = msg.arg.split(' ')
chan = arg[0]
mesg = ' '.join(arg[1:])
msg.notice(chan, mesg)
return p.message(f'notice: "{mesg}" sent to {chan}')