Implement API endpoint for network listing
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import main
|
||||
from core.logstash import sendLogstashNotification
|
||||
from core.relay import sendRelayNotification
|
||||
from modules import userinfo
|
||||
from utils.dedup import dedup
|
||||
import main
|
||||
|
||||
order = [
|
||||
"type",
|
||||
|
||||
@@ -38,6 +38,14 @@ def getChanList(name, nick):
|
||||
return (i.decode() for i in result)
|
||||
|
||||
|
||||
def getTotalChanNum(net):
|
||||
"""
|
||||
Get the number of channels a network has.
|
||||
"""
|
||||
chans = main.r.keys(f"live.who.{net}.*")
|
||||
return len(chans)
|
||||
|
||||
|
||||
def getUserNum(name, channels):
|
||||
"""
|
||||
Get the number of users on a list of channels.
|
||||
|
||||
Reference in New Issue
Block a user