Implement users command to see the mutual users of one or more channels and squash some bugs
This commit is contained in:
@@ -16,17 +16,32 @@ def getWho(query):
|
||||
result[i] = f
|
||||
return result
|
||||
|
||||
def getChansSingle(name, query):
|
||||
query = ["live.chan."+name+"."+i for i in query]
|
||||
result = main.r.sinter(*query)
|
||||
def getChansSingle(name, nick):
|
||||
nick = ["live.chan."+name+"."+i for i in nick]
|
||||
result = main.r.sinter(*nick)
|
||||
if len(result) == 0:
|
||||
return None
|
||||
return [i.decode() for i in result]
|
||||
|
||||
def getChans(query):
|
||||
def getChans(nick):
|
||||
result = {}
|
||||
for i in main.pool.keys():
|
||||
f = getChansSingle(i, query)
|
||||
f = getChansSingle(i, nick)
|
||||
if f:
|
||||
result[i] = f
|
||||
return result
|
||||
|
||||
def getUsersSingle(name, nick):
|
||||
nick = ["live.who."+name+"."+i for i in nick]
|
||||
result = main.r.sinter(*nick)
|
||||
if len(result) == 0:
|
||||
return None
|
||||
return [i.decode() for i in result]
|
||||
|
||||
def getUsers(nick):
|
||||
result = {}
|
||||
for i in main.pool.keys():
|
||||
f = getUsersSingle(i, nick)
|
||||
if f:
|
||||
result[i] = f
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user