Explorar o código

细分gotify消息通道

jack hai 1 ano
pai
achega
fe59cbc3dc

+ 1 - 1
archive/message_coinmarketcap.py

@@ -53,7 +53,7 @@ class CheckCoinmarketcap:
             context += '\n{}'.format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
             print(context)
             # 推送到 message
-            GotifyNotifier('实时coin价格', context).send_message()
+            GotifyNotifier('实时coin价格', context, 'AgfOJESqDKftBTQ').send_message()
         else:
             print('no data!')
 

+ 2 - 2
archive/message_maizi_gas.py

@@ -51,10 +51,10 @@ try:
 
     if int(fastest) > 30 or int(fast) > 30 or int(standard) > 30 or int(low) > 30 or int(base) > 30:
         # 推送到 message
-        GotifyNotifier('gas 费大于 30', result).send_message()
+        GotifyNotifier('gas 费大于 30', result, 'AgfOJESqDKftBTQ').send_message()
     elif int(fastest) < 5 or int(fast) < 5 or int(standard) < 5 or int(low) < 5 or int(base) < 5:
         # 推送到 message
-        GotifyNotifier('gas 费小于 5', result).send_message()
+        GotifyNotifier('gas 费小于 5', result, 'AgfOJESqDKftBTQ').send_message()
 
 
 except Exception as e:

+ 1 - 1
archive/message_vix.py

@@ -65,7 +65,7 @@ class CheckVIX:
             print(f'发送消息: {context}')
             context += '\n{}'.format(datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
             # 推送到 message
-            GotifyNotifier('vix恐慌指数', context).send_message()
+            GotifyNotifier('vix恐慌指数', context, 'AgfOJESqDKftBTQ').send_message()
         else:
             print(f"VIX恐慌指数小于{self.check_value},不发送消息\n{context}")
 

+ 1 - 1
message/message_coinmarketcap.py

@@ -219,7 +219,7 @@ def main():
 
     if text:
         print(text)
-        GotifyNotifier('Real-time coin price\n', text).send_message()
+        GotifyNotifier('Real-time coin price\n', text, 'AgfOJESqDKftBTQ').send_message()
     else:
         print('No Data')
 

+ 1 - 1
message/message_dlt.py

@@ -144,7 +144,7 @@ class CheckDlt:
         title = f'大乐透 {subject} 期'
 
         # 推送到 message
-        GotifyNotifier(title, text).send_message()
+        GotifyNotifier(title, text, 'A3bqt9Dlbs.fPUb').send_message()
 
         # 发送到邮件
         SendEmail(title, title, text).send()

+ 1 - 1
message/message_get_one_week_weather.py

@@ -58,7 +58,7 @@ class Weather():
             one_week_weather)
 
         # 推送到 message
-        GotifyNotifier('天气预报数', text).send_message()
+        GotifyNotifier('天气预报数', text, 'A9KF--mx_12PjSu').send_message()
 
         self.logs_handle.logs_write('Weather forecast', '天气预报数据已获取', 'done', False)
 

+ 1 - 1
remind/auto_remind.py

@@ -48,7 +48,7 @@ class AutoRemind:
 
                     # 组装完标题和正文, 准备发送消息
                     # 推送到 message
-                    GotifyNotifier(title, context).send_message()
+                    GotifyNotifier(title, context, 'AT2QGp_vyCX4akW').send_message()
 
                     # 推送到 serverchan
                     ServerChanNotifier(title, context.replace('\n', '\n\n')).send_message()

+ 2 - 2
utils/utils_send_gotify.py

@@ -4,9 +4,9 @@ import httpx
 
 
 class GotifyNotifier:
-    def __init__(self, title, message):
+    def __init__(self, title, message, token='A9KF--mx_12PjSu'):
         self.gotify_url = 'https://gotify.erhe.top'
-        self.app_token = 'A9KF--mx_12PjSu'
+        self.app_token = token
         self.title = title
         self.message = message