[refactor]: Clear some trash

This commit is contained in:
Sweetbread
2023-05-15 17:29:09 +03:00
parent c8bd9d21a5
commit f8de6d54a2
12 changed files with 18 additions and 352 deletions
+31
View File
@@ -0,0 +1,31 @@
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client['Koteika']
collection = db.members
def is_secret(ctx):
try: id_ = ctx.author.id
except: id_ = ctx.id
info = collection.find_one({"id": id_})["access_level"]
return 'secret' == info
def is_white(ctx):
try:
id_ = ctx.author.id
except:
id_ = ctx.id
info = collection.find_one({"id": id_})["access_level"]
return info in ('white', 'secret')
def is_not_black(ctx):
try:
id_ = ctx.author.id
except:
id_ = ctx.id
info = collection.find_one({"id": id_})["access_level"]
return "black" != info