瀏覽代碼

Show @here only at 10 mins mark

Foppe Hemminga 6 年之前
父節點
當前提交
f44a5f9c87
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      main.py

+ 5 - 2
main.py

@@ -62,8 +62,11 @@ if __name__ == '__main__':
             name_alert = status['name']
             id_alert = status['id']
             url_alert = f'https://www.torn.com/profiles.php?XID={id_alert}'
-            alert = f'@here Alert: {minutes_to_go} mins to attack [{name_alert} [{id_alert}]]({url_alert}). ' + \
-                    f'Be there at {attack_time_time}!'
+            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}). ' + \
+                f'Be there at {attack_time_time}!'
             print('Sending alert')
             view.send_alert(alert)