Return more info for api.servers and api.channels

This commit is contained in:
jesopo 2018-10-05 09:46:03 +01:00
parent 187220c25e
commit 808694c113

View file

@ -56,14 +56,19 @@ class Module(ModuleManager.BaseModule):
"hostname": server.target_hostname, "hostname": server.target_hostname,
"port": server.port, "port": server.port,
"tls": server.tls, "tls": server.tls,
"alias": server.alias "alias": server.alias,
"hostmask": "%s!%s@%s" % (
server.nickname, server.username, server.hostname),
"users": len(server.users)
} }
return servers return servers
def _channel_stats(self, channel): def _channel_stats(self, channel):
return { return {
"users": len(channel.users), "users": len(channel.users),
"topic": channel.topic "topic": channel.topic,
"topic-set-at": channel.topic_time,
"topic-set-by": channel.topic_setter_nickname
} }
@utils.hook("api.channels") @utils.hook("api.channels")
def channels_api(self, event): def channels_api(self, event):