mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 03:29:28 +01:00
plugins: add global notice plugin
This commit is contained in:
parent
a6e38e7e20
commit
7e6ad089c0
23
plugins/global.py
Normal file
23
plugins/global.py
Normal file
@ -0,0 +1,23 @@
|
||||
# global.py: Global Noticing Plugin
|
||||
|
||||
__authors__ = [("Ken Spencer", "Iota <ken@electrocode.net>")]
|
||||
__version__ = "0.0.1"
|
||||
|
||||
from pylinkirc import conf, utils, world
|
||||
from pylinkirc.log import log
|
||||
from pylinkirc.coremods import permissions
|
||||
|
||||
def g(irc, source, args):
|
||||
"""<message text>
|
||||
|
||||
Sends out a Instance-wide notice.
|
||||
"""
|
||||
permissions.checkPermissions(irc, source, ["global.global"])
|
||||
message = " ".join(args)
|
||||
message = message + " (sent by %s@%s)" % (irc.getFriendlyName(irc.called_by), irc.getFullNetworkName())
|
||||
for name, ircd in world.networkobjects.items():
|
||||
for channel in ircd.pseudoclient.channels:
|
||||
ircd.msg(channel, message)
|
||||
|
||||
|
||||
utils.add_cmd(g, "global", featured=True)
|
Loading…
Reference in New Issue
Block a user