Ignore empty string
This commit is contained in:
parent
569c2aa752
commit
ed47cc1d76
9
bot.py
9
bot.py
|
@ -135,9 +135,12 @@ def find_uids(forum: int, s: str) -> list | None:
|
|||
people = db.read(str(forum) + ".people")
|
||||
if people is None:
|
||||
return None
|
||||
if s[0] == "@":
|
||||
s = s[1:]
|
||||
f = [i for i in people.keys() if len([j for j in people[i].values() if s in j]) > 0]
|
||||
if len(s) > 0:
|
||||
if s[0] == "@":
|
||||
s = s[1:]
|
||||
f = [i for i in people.keys() if len([j for j in people[i].values() if s in j]) > 0]
|
||||
else:
|
||||
f = list(people.keys())
|
||||
if len(f) == 0:
|
||||
return None
|
||||
return f
|
||||
|
|
Loading…
Reference in New Issue