Deploy bombs

This commit is contained in:
Eriks Karls 2019-08-01 15:04:16 +03:00
parent dbeb6e9ba5
commit 4eccb339bb
2 changed files with 8 additions and 0 deletions

View File

@ -759,6 +759,10 @@ class Citizen(classes.CitizenAPI):
return hits, err, damage return hits, err, damage
def deploy_bomb(self, battle_id: int, bomb_id: int):
r = self._post_military_deploy_bomb(battle_id, bomb_id).json()
return not r.get('error')
def work_ot(self): def work_ot(self):
# I"m not checking for 1h cooldown. Beware of nightshift work, if calling more than once every 60min # I"m not checking for 1h cooldown. Beware of nightshift work, if calling more than once every 60min
self.update_job_info() self.update_job_info()

View File

@ -752,6 +752,10 @@ Class for unifying eRepublik known endpoints and their required/optional paramet
type="damage", leftPage=1, rightPage=1, _token=self.token) type="damage", leftPage=1, rightPage=1, _token=self.token)
return self.post("{}/military/battle-console".format(self.url, battle_id), data=data) return self.post("{}/military/battle-console".format(self.url, battle_id), data=data)
def _post_military_deploy_bomb(self, battle_id: int, bomb_id: int) -> Response:
data = dict(battleId=battle_id, bombId=bomb_id, _token=self.token)
return self.post("{}/military/deploy-bomb".format(self.url), data=data)
def _post_military_fight_air(self, battle_id: int, side_id: int) -> Response: def _post_military_fight_air(self, battle_id: int, side_id: int) -> Response:
data = dict(sideId=side_id, battleId=battle_id, _token=self.token) data = dict(sideId=side_id, battleId=battle_id, _token=self.token)
return self.post("{}/military/fight-shoooot/{}".format(self.url, battle_id), data=data) return self.post("{}/military/fight-shoooot/{}".format(self.url, battle_id), data=data)