This commit is contained in:
NikolajDanger
2020-08-07 11:18:24 +02:00
parent b45aac1d1c
commit e0e74f5bc0
2 changed files with 15 additions and 15 deletions

View File

@ -132,14 +132,14 @@ def drawImage(channel):
startx -= placeGridSize[0]*3 + 90
starty -= gridBorder + 60
mask = winBar.copy()#.convert("L")
#mask.putalpha(128)
#mask.save("test.png")
winBarImage = Image.new("RGBA",mask.size,color=winBarColor)
background.paste(winBarImage,(startx,starty),mask)
# Bottom
textPadding = 20

View File

@ -168,10 +168,10 @@ def makeFiles():
for path, content in data["json"].items():
makeJsonFile(path,content)
for path, content in data["txt"].items():
makeTxtFile(path,content)
for path in data["folder"]:
makeFolder(path)
@ -183,7 +183,7 @@ def replaceMultiple(mainString, toBeReplaces, newString):
if elem in mainString :
# Replace the string
mainString = mainString.replace(elem, newString)
return mainString
def emojiToCommand(emoji):
@ -236,27 +236,27 @@ def monopolyReactionTest(channel,message):
def stopServer():
with open("resources/games/games.json","r") as f:
games = json.load(f)
games["trivia questions"] = {}
games["blackjack games"] = {}
games["4 in a row games"] = {}
with open("resources/games/games.json","w") as f:
json.dump(games,f,indent=4)
emptyDict = {}
with open("resources/games/monopolyGames.json", "w") as f:
json.dump(emptyDict,f,indent=4)
with open("resources/games/hexGames.json", "w") as f:
json.dump(emptyDict,f,indent=4)
def deleteGame(gameType,channel):
with open("resources/games/games.json", "r") as f:
data = json.load(f)
del data[gameType][channel]
with open("resources/games/games.json", "w") as f:
json.dump(data,f,indent=4)
@ -264,7 +264,7 @@ def deleteGame(gameType,channel):
def addToDict(userID,userName):
with open("resources/users.json", "r") as f:
data = json.load(f)
if userID in data:
if data[userID]["user name"] != userName:
logThis("changing name for "+userName)
@ -306,14 +306,14 @@ def getID(userName):
try:
with open("resources/users.json", "r") as f:
data = json.load(f)
userID = None
for key, value in data.items():
if userName.lower() == value["user name"].lower():
userID = key
break
return userID
except:
logThis("Error getting ID")
logThis("Error getting ID")