Parcourir la source

add group list

ming il y a 3 ans
Parent
commit
bf9e5e4a23
1 fichiers modifiés avec 9 ajouts et 15 suppressions
  1. 9 15
      main.py

+ 9 - 15
main.py

@@ -157,21 +157,15 @@ async def history_input():
     return logs
 
 def notify_group(msg):
-    
-    headers = {
-            "Authorization": "Bearer " + "WekCRfnAirSiSxALiD6gcm0B56EejsoK89zFbIaiZQD",
-            "Content-Type": "application/x-www-form-urlencoded"
-    }
-    params = {"message": msg}   
-    r = requests.post("https://notify-api.line.me/api/notify",headers=headers, params=params)
-
-    headers = {
-            "Authorization": "Bearer " + "1dbtJHbWVbrooXmQqc4r8OyRWDryjD4TMJ6DiDsdgsX",
-            "Content-Type": "application/x-www-form-urlencoded"
-    }
-    params = {"message": msg}   
-    r = requests.post("https://notify-api.line.me/api/notify",headers=headers, params=params)
-    print(r)
+    glist=['7vilzohcyQMPLfAMRloUawiTV4vtusZhxv8Czo7AJX8','WekCRfnAirSiSxALiD6gcm0B56EejsoK89zFbIaiZQD','1dbtJHbWVbrooXmQqc4r8OyRWDryjD4TMJ6DiDsdgsX']
+    for gid in glist():
+        headers = {
+                "Authorization": "Bearer " + gid,
+                "Content-Type": "application/x-www-form-urlencoded"
+        }
+        params = {"message": msg}   
+        r = requests.post("https://notify-api.line.me/api/notify",headers=headers, params=params)
+
 
 def save_history(req,name_hash):
     db = dataset.connect('mysql://choozmo:pAssw0rd@db.ptt.cx:3306/AI_anchor?charset=utf8mb4')