|
@@ -8,7 +8,6 @@ import arrow
|
|
|
import model
|
|
import model
|
|
|
import view
|
|
import view
|
|
|
|
|
|
|
|
-
|
|
|
|
|
if __name__ == '__main__':
|
|
if __name__ == '__main__':
|
|
|
for player_id in [4, 15]:
|
|
for player_id in [4, 15]:
|
|
|
status = model.get_loot_level(player_id)
|
|
status = model.get_loot_level(player_id)
|
|
@@ -53,10 +52,17 @@ if __name__ == '__main__':
|
|
|
player_name = status['name']
|
|
player_name = status['name']
|
|
|
attack_time_object = arrow.get(attack_time)
|
|
attack_time_object = arrow.get(attack_time)
|
|
|
attack_time_time = attack_time_object.format('hh:mm A')
|
|
attack_time_time = attack_time_object.format('hh:mm A')
|
|
|
- minutes_to_go = int(seconds_to_go//60)
|
|
|
|
|
|
|
+ minutes_to_go = int(seconds_to_go // 60)
|
|
|
t = f'In < {minutes_to_go} mins ({attack_time_time}) {player_name} [{player_id}] reaches level IV'
|
|
t = f'In < {minutes_to_go} mins ({attack_time_time}) {player_name} [{player_id}] reaches level IV'
|
|
|
print(t)
|
|
print(t)
|
|
|
status['time_string'] = t
|
|
status['time_string'] = t
|
|
|
|
|
|
|
|
|
|
+ if 0 < minutes_to_go < 6:
|
|
|
|
|
+ name_alert = status['name']
|
|
|
|
|
+ id_alert = status['id']
|
|
|
|
|
+ url_alert = f'https://www.torn.com/profiles.php?XID={id_alert}'
|
|
|
|
|
+ alert = f"Alert: {minutes_to_go} to attack [{name_alert} \[{id_alert}\]]({url_alert})!"
|
|
|
|
|
+ view.send_alert(alert)
|
|
|
|
|
+
|
|
|
if send_message:
|
|
if send_message:
|
|
|
view.send_message(status)
|
|
view.send_message(status)
|