sending_message.py 687 B

1234567891011121314151617181920212223242526272829
  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)
  24. send_msg('hi')