Add api.servers endpoint
This commit is contained in:
parent
7fc0359e3d
commit
b341320e37
1 changed files with 12 additions and 0 deletions
|
@ -48,6 +48,18 @@ class Module(ModuleManager.BaseModule):
|
||||||
networks, channels, users = self._stats()
|
networks, channels, users = self._stats()
|
||||||
return {"networks": networks, "channels": channels, "users": users}
|
return {"networks": networks, "channels": channels, "users": users}
|
||||||
|
|
||||||
|
@utils.hook("api.servers")
|
||||||
|
def servers_api(self, event):
|
||||||
|
servers = {}
|
||||||
|
for server in self.bot.servers.values():
|
||||||
|
servers[server.id] = {
|
||||||
|
"hostname": server.target_hostname,
|
||||||
|
"port": server.port,
|
||||||
|
"tls": server.tls,
|
||||||
|
"alias": server.alias
|
||||||
|
}
|
||||||
|
return servers
|
||||||
|
|
||||||
@utils.hook("api.channels")
|
@utils.hook("api.channels")
|
||||||
def channels_api(self, event):
|
def channels_api(self, event):
|
||||||
print(event["path"])
|
print(event["path"])
|
||||||
|
|
Loading…
Reference in a new issue