11
11
from multiprocessing import Process , freeze_support
12
12
from subprocess import Popen , PIPE
13
13
from nest_asyncio import apply
14
+ from json import loads
14
15
15
16
if __name__ == "__main__" :
16
17
@@ -55,9 +56,9 @@ async def connect(connection):
55
56
addLog ({"internalName" : internalName , "displayName" : displayName , "summonerId" : summonerId , "locale" : locale })
56
57
57
58
async with request ("GET" , localeDiscordStrings (locale )) as resp :
58
- discord_strings = await resp .json ( )
59
+ discord_strings = loads (( await resp .text ()). encode (). decode ( 'utf-8-sig' ) )
59
60
async with request ("GET" , localeChatStrings (locale )) as resp :
60
- chat_strings = await resp .json ( )
61
+ chat_strings = loads (( await resp .text ()). encode (). decode ( 'utf-8-sig' ) )
61
62
62
63
discStrings = {
63
64
"bot" : discord_strings ["Disc_Pres_QueueType_BOT" ],
@@ -81,12 +82,15 @@ async def disconnect(_):
81
82
@connector .ws .register ("/lol-gameflow/v1/session" , event_types = ("CREATE" , "UPDATE" , "DELETE" ))
82
83
async def gameFlow (connection , event ):
83
84
data = event .data
85
+ phase = data ['phase' ]
86
+
87
+ if phase not in ("Lobby" , "Matchmaking" , "ChampSelect" , "InProgress" ): return
84
88
85
89
gameData = data ['gameData' ]
86
90
queueData = gameData ['queue' ]
87
91
mapData = data ['map' ]
88
92
mapIconData = mapData ["assets" ]["game-select-icon-active" ]
89
- phase = data [ 'phase' ]
93
+
90
94
91
95
lobbyMem = len (await (await connection .request ('get' , '/lol-lobby/v2/lobby/members' )).json ())
92
96
0 commit comments