fix bot for latest slixmpp changes

This commit is contained in:
Jonny Rimkus 2022-01-16 14:47:50 +01:00
parent 9c3f6761e5
commit 4458a18258
3 changed files with 7 additions and 4 deletions

View file

@ -42,4 +42,4 @@ Copy the systemd dummy file into systemd service folder.
If it is neccecary to start the bot automatically when the system boots do `systemctl enable magicbot.service`. If it is neccecary to start the bot automatically when the system boots do `systemctl enable magicbot.service`.
#### starting the bot without systemd #### starting the bot without systemd
Got to the bots directory and run `./main.py &`. Go to the bots directory and run `./main.py &`.

View file

@ -55,7 +55,10 @@ class QueryBot(slixmpp.ClientXMPP):
if self.room: if self.room:
for rooms in self.room.split(sep=","): for rooms in self.room.split(sep=","):
logging.debug("joining: %s" % rooms) logging.debug("joining: %s" % rooms)
self.plugin['xep_0045'].join_muc(rooms, self.nick, wait=True) # join_muc will be deprecated in slixmpp 1.8.0
# see https://slixmpp.readthedocs.io/en/latest/api/plugins/xep_0045.html?highlight=join_muc_wait#slixmpp.plugins.xep_0045.XEP_0045.join_muc_wait
# self.plugin['xep_0045'].join_muc_wait(rooms, self.nick, maxstanzas=0)
self.plugin['xep_0045'].join_muc(rooms, self.nick)
async def message(self, msg): async def message(self, msg):
""" """

View file

@ -1,4 +1,4 @@
slixmpp>=1.2.2 slixmpp>=1.7.1
defusedxml>=0.5.0 defusedxml>=0.5.0
requests>=2.19.1 requests>=2.19.1
validators>=0.12.2 validators>=0.12.2