浏览代码

Minor bug

Foppe Hemminga 6 年之前
父节点
当前提交
49778fdf39
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      main.py

+ 4 - 4
main.py

@@ -2,7 +2,7 @@
 import json
 # import sys
 import math
-from pprint import pprint
+# from pprint import pprint
 
 import arrow
 
@@ -61,7 +61,7 @@ if __name__ == '__main__':
 
         if minutes_to_go < 20 and minutes_to_go % 5 == 0 and minutes_to_go != 0:
             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']
             else:
                 alerts = {'15': False, '10': False, '5': False, '0': False}
@@ -73,7 +73,8 @@ if __name__ == '__main__':
                 add_here = ''
                 if 8 < minutes_to_go < 12:
                     add_here = '@here '
-                alert = add_here + f'Alert: {minutes_to_go} mins to attack [{name_alert} [{id_alert}]]({url_alert}). ' + \
+                alert = add_here + \
+                    f'Alert: {minutes_to_go} mins to attack [{name_alert} [{id_alert}]]({url_alert}). ' + \
                     f'Be there at {attack_time_time}!'
                 print('Sending alert')
                 view.send_alert(alert)
@@ -86,6 +87,5 @@ if __name__ == '__main__':
                 write_file.close()
                 write_file.close()
 
-
         if send_message:
             view.send_message(status)