3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00
PyLink/plugins/global.py
2017-03-13 13:23:22 -07:00

22 lines
737 B
Python

# global.py: Global Noticing Plugin
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():
if ircd.connected.is_set(): # Only attempt to send to connected networks
for channel in ircd.pseudoclient.channels:
ircd.msg(channel, message)
utils.add_cmd(g, "global", featured=True)