Return more info for api.servers and api.channels
This commit is contained in:
parent
187220c25e
commit
808694c113
1 changed files with 7 additions and 2 deletions
|
@ -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):
|
||||||
|
|
Loading…
Reference in a new issue