[refactor]: Clear some trash
This commit is contained in:
@@ -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
|
||||
@@ -0,0 +1,7 @@
|
||||
check_mark = '<a:check_mark2:741399223655858216>'
|
||||
XX = '<a:XX:739832186428981340>'
|
||||
loading = '<a:loading2:741399347220054118>'
|
||||
right = 'a:cat_right:769920151143055361'
|
||||
left = 'a:cat_left:769919996615852042'
|
||||
center = 'a:cat_center:769922556241117185'
|
||||
chocolate = ":chocolate_bar:"
|
||||
@@ -0,0 +1,30 @@
|
||||
from bot import db
|
||||
|
||||
|
||||
def region_to_str(region):
|
||||
# if region == discord.VoiceRegion.russia:
|
||||
# return "RU"
|
||||
# elif region == discord.VoiceRegion.japan:
|
||||
# return "JP"
|
||||
# else:
|
||||
return "RU"
|
||||
|
||||
|
||||
def translate(string, region):
|
||||
if string is not None:
|
||||
if string.startswith("$"):
|
||||
string = string.replace("$", "")
|
||||
string = string.split("_")
|
||||
|
||||
print(region)
|
||||
|
||||
pack = db.strings.find_one({"lang": region})
|
||||
print(pack)
|
||||
|
||||
for i in string:
|
||||
pack = pack[i]
|
||||
print(pack)
|
||||
|
||||
return pack
|
||||
else:
|
||||
return string
|
||||
Reference in New Issue
Block a user