|
@@ -42,7 +42,7 @@ if __name__ == '__main__':
|
|
|
if write_file_next:
|
|
if write_file_next:
|
|
|
# summary = {'text': status["status"], 'roman': status["roman"], 'integer': status["integer"]}
|
|
# summary = {'text': status["status"], 'roman': status["roman"], 'integer': status["integer"]}
|
|
|
if status['integer'] <= 2:
|
|
if status['integer'] <= 2:
|
|
|
- status['alert'] = {'15': False, '10': False, '5': False, '0': False}
|
|
|
|
|
|
|
+ status['alert'] = {'15': False, '10': False, '5': False, '1': False}
|
|
|
summary_json = json.dumps(status, indent=2)
|
|
summary_json = json.dumps(status, indent=2)
|
|
|
print(summary_json)
|
|
print(summary_json)
|
|
|
write_file = open(f'status-{player_id}.json', 'w')
|
|
write_file = open(f'status-{player_id}.json', 'w')
|
|
@@ -59,18 +59,20 @@ if __name__ == '__main__':
|
|
|
# print(t)
|
|
# print(t)
|
|
|
status['time_string'] = t
|
|
status['time_string'] = t
|
|
|
|
|
|
|
|
- if minutes_to_go < 20 and minutes_to_go % 5 == 0 and minutes_to_go != 0:
|
|
|
|
|
|
|
+ if (minutes_to_go < 20 and minutes_to_go % 5 == 0 and minutes_to_go != 0) or minutes_to_go == 1:
|
|
|
temp_status_json, _ = model.get_json_file(player_id)
|
|
temp_status_json, _ = model.get_json_file(player_id)
|
|
|
if 'alert' in temp_status_json:
|
|
if 'alert' in temp_status_json:
|
|
|
alerts = old_status['alert']
|
|
alerts = old_status['alert']
|
|
|
else:
|
|
else:
|
|
|
- alerts = {'15': False, '10': False, '5': False, '0': False}
|
|
|
|
|
|
|
+ alerts = {'15': False, '10': False, '5': False, '1': False}
|
|
|
if not alerts[str(minutes_to_go)]:
|
|
if not alerts[str(minutes_to_go)]:
|
|
|
# We have not sent this alert before
|
|
# We have not sent this alert before
|
|
|
name_alert = status['name']
|
|
name_alert = status['name']
|
|
|
id_alert = status['id']
|
|
id_alert = status['id']
|
|
|
url_alert = f'https://www.torn.com/profiles.php?XID={id_alert}'
|
|
url_alert = f'https://www.torn.com/profiles.php?XID={id_alert}'
|
|
|
add_here = ''
|
|
add_here = ''
|
|
|
|
|
+ if minutes_to_go == 1:
|
|
|
|
|
+ add_here = '@here '
|
|
|
if 8 < minutes_to_go < 12:
|
|
if 8 < minutes_to_go < 12:
|
|
|
add_here = '@here '
|
|
add_here = '@here '
|
|
|
alert = add_here + \
|
|
alert = add_here + \
|