aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-27 13:13:52 +0000
committerGravatar jesopo2019-11-27 13:13:52 +0000
commite1f527a374d14b7701cdec8867545ccee4564d9c (patch)
treeed434bbff889e0e53f6b82f74ae7df3bcb90bb2f /modules
parentadd !servers command (diff)
signature
prefix "hidden" channels in !channels with "*"
Diffstat (limited to 'modules')
-rw-r--r--modules/stats.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/stats.py b/modules/stats.py
index 8ccb88a2..1322976d 100644
--- a/modules/stats.py
+++ b/modules/stats.py
@@ -141,17 +141,19 @@ class Module(ModuleManager.BaseModule):
return channels
@utils.hook("received.command.channels")
- @utils.kwarg("help", "List all the channel I'm in on this network")
+ @utils.kwarg("help",
+ "List all the channel I'm in on this network (* = hidden)")
@utils.kwarg("permission", "listchannels")
def channels_command(self, event):
channels = []
for channel in event["server"].channels.values():
+ name = channel.name
hidden = bool(HIDDEN_MODES&set(channel.modes.keys()))
- if (hidden and
- event["is_channel"] and
- not channel == event["target"]):
- continue
- channels.append(channel.name)
+ if hidden:
+ if event["is_channel"] and not channel == event["target"]:
+ continue
+ name = "*%s" % name
+ channels.append(name)
event["stdout"].write("Current channels: %s" %
" ".join(sorted(channels)))