Add api.servers endpoint

This commit is contained in:
jesopo 2018-10-04 17:18:40 +01:00
parent 7fc0359e3d
commit b341320e37

View file

@ -48,6 +48,18 @@ class Module(ModuleManager.BaseModule):
networks, channels, users = self._stats()
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")
def channels_api(self, event):
print(event["path"])