1
0

sending_message.py 672 B

12345678910111213141516171819202122232425262728
  1. import requests
  2. import xmpp
  3. from xmpp import cli
  4. import config
  5. from BotClass import JabberBot
  6. import json
  7. #раскомментировать, когда перейдем на разные пароли
  8. import hashlib
  9. from datetime import datetime
  10. import time
  11. import threading
  12. #test
  13. import jsonAndRequest as jsreq
  14. global tasklist
  15. botname="open_template_bot"
  16. operating_status=211
  17. JID=botname+"@"+config.JSERVER
  18. PORT=config.PORT
  19. PASSWORD=hashlib.md5((botname+config.PASSWORD).encode('utf-8')).hexdigest()
  20. proceed_to=["open_servicerequest_booked@ej.sharix-app.org"]
  21. def send_msg(msg):
  22. bot = JabberBot(JID, PASSWORD, PORT)
  23. bot.send_notification(proceed_to[0],msg)