mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-24 17:30:51 +01:00
global: reply with a confirmation
We can also use this space to show the number of channels and networks announced to.
This commit is contained in:
parent
f82ddb5336
commit
180da83b4e
@ -24,8 +24,12 @@ def g(irc, source, args):
|
|||||||
template = string.Template(global_conf.get('format', DEFAULT_FORMAT))
|
template = string.Template(global_conf.get('format', DEFAULT_FORMAT))
|
||||||
|
|
||||||
exempt_channels = set(global_conf.get('exempt_channels', set()))
|
exempt_channels = set(global_conf.get('exempt_channels', set()))
|
||||||
|
|
||||||
|
netcount = 0
|
||||||
|
chancount = 0
|
||||||
for netname, ircd in world.networkobjects.items():
|
for netname, ircd in world.networkobjects.items():
|
||||||
if ircd.connected.is_set(): # Only attempt to send to connected networks
|
if ircd.connected.is_set(): # Only attempt to send to connected networks
|
||||||
|
netcount += 1
|
||||||
for channel in ircd.pseudoclient.channels:
|
for channel in ircd.pseudoclient.channels:
|
||||||
|
|
||||||
local_exempt_channels = exempt_channels | set(ircd.serverdata.get('global_exempt_channels', set()))
|
local_exempt_channels = exempt_channels | set(ircd.serverdata.get('global_exempt_channels', set()))
|
||||||
@ -51,5 +55,8 @@ def g(irc, source, args):
|
|||||||
# Disable relaying or other plugins handling the global message.
|
# Disable relaying or other plugins handling the global message.
|
||||||
ircd.msg(channel, template.safe_substitute(subst), loopback=False)
|
ircd.msg(channel, template.safe_substitute(subst), loopback=False)
|
||||||
|
|
||||||
|
chancount += 1
|
||||||
|
|
||||||
|
irc.reply('Done. Sent to %d channels across %d networks.' % (chancount, netcount))
|
||||||
|
|
||||||
utils.add_cmd(g, "global", featured=True)
|
utils.add_cmd(g, "global", featured=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user