Implement API endpoint for network listing
This commit is contained in:
@@ -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