Browse Source

modified: handlers/sending_message.py

stucked_s 5 tháng trước cách đây
mục cha
commit
29f8be5798
2 tập tin đã thay đổi với 5 bổ sung13 xóa
  1. 0 8
      handlers/config_template.py
  2. 5 5
      handlers/sending_message.py

+ 0 - 8
handlers/config_template.py

@@ -1,8 +0,0 @@
-#rename this file to config.py
-BOTLIST=["open_template_bot","open_strequest_assigned","open_strequest_inprocess","open_strequest_new","open_strequest_reopened","open_strequest_wontfix","open_strequest_done","open_strequest_duplicate","open_strequest_closed","open_accessrequest_pending","open_accessrequest_accepted","open_accessrequest_declined","open_negrequest_pending","open_negrequest_accepted","open_negrequest_declined","open_servicerequest_template","open_servicerequest_booked","open_servicerequest_assigned","open_servicerequest_accepted","open_servicerequest_pending","open_servicerequest_declined","open_servicerequest_prestart","open_servicerequest_process","open_servicerequest_forcemajeure","open_servicerequest_forcemajeurecancelled","open_servicerequest_done","open_servicerequest_cancelled","open_servicerequest_closed"]
-JSERVER="ej.sharix-app.org"
-PASSWORD="12345"
-PORT=5222
-API_URL = "https://testopen.sharix-app.org"
-
-

+ 5 - 5
handlers/sending_message.py

@@ -12,7 +12,7 @@ import threading
 #test
 import jsonAndRequest as jsreq
 global tasklist
-botname="open_servicerequest_booked"
+botname="open_template_bot"
 operating_status=211
 JID=botname+"@"+config.JSERVER
 PORT=config.PORT
@@ -21,9 +21,9 @@ PASSWORD=hashlib.md5((botname+config.PASSWORD).encode('utf-8')).hexdigest()
 
 proceed_to=["open_servicerequest_booked@ej.sharix-app.org"]
 
-token = jsreq.requestGetToken(botname, PASSWORD, config.API_URL+"/api/v1/auth/token/login/")
-
-bot = JabberBot(JID, PASSWORD, PORT)
 
 def send_msg(msg):
-    bot.send_notification(msg)
+    bot = JabberBot(JID, PASSWORD, PORT)
+    bot.send_notification(proceed_to[0],msg)
+
+send_msg('hi')