Skip to content
This repository was archived by the owner on Mar 11, 2022. It is now read-only.

Commit 1d33da3

Browse files
authored
Update bot_functions.py
1 parent b2ca77b commit 1d33da3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

eSim/Help_functions/bot_functions.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ async def get_battle_id(server, battle_id, priorize_my_country=False):
6969
battle_id = tree.xpath('//tr[2]//td[1]//a/@href')
7070
if not battle_id:
7171
battle_id = [""]
72-
battle_id = battle_id[0].replace("battle.html?id=", "") or None
72+
7373
if priorize_my_country:
7474
sides = [x.replace("xflagsMedium xflagsMedium-", "").replace("-", " ").lower() for x in
7575
tree.xpath('//tr//td[1]//div//div//div/@class') if "xflagsMedium" in x]
76-
for battle_id, sides in (battle_id, sides):
76+
for _id, sides in (battle_id, sides):
7777
if apiCitizen["citizenship"].lower() in sides:
78-
return battle_id
79-
return battle_id
78+
return _id.replace("battle.html?id=", "")
79+
return battle_id[0].replace("battle.html?id=", "") or None
8080

8181

8282
async def random_sleep(restores_left="100"):

0 commit comments

Comments
 (0)