From c6988ab84d6471c1666bca6cf8182345a4f0faca Mon Sep 17 00:00:00 2001 From: czar Date: Sun, 31 Oct 2021 23:46:13 +0000 Subject: [PATCH] Merge git-svn-id: file:///srv/svn/repo/chen/trunk@10 32723744-9b23-0b4a-b1da-9b2e968f9461 --- main.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index a49ee0f..cdaa08e 100644 --- a/main.py +++ b/main.py @@ -7,7 +7,6 @@ import re import io import mimetypes import asyncio - from collections import defaultdict from PythonSed import Sed from slixmpp import ClientXMPP @@ -189,6 +188,7 @@ class AngelBot(ClientXMPP): def sed_command(self, msg, sender, mtype): try: text = msg["body"] + print(f"{text = }") if not sed_cmd.match(text): self.messages[sender]["messages"].add(text) return @@ -207,7 +207,7 @@ class AngelBot(ClientXMPP): self.messages[sender]["messages"].add(out) return self.send_message( mto=sender, - mbody=res, + mbody=out, mtype=mtype, ) @@ -239,8 +239,10 @@ class AngelBot(ClientXMPP): self.send_presence() await self.get_roster() for channel in self.autojoin: - self.plugin["xep_0045"].join_muc(channel, self.nick) - await self.update_info() + try: + self.plugin["xep_0045"].join_muc(channel, self.nick) + except: + ... async def update_info(self): with open("angel.png", "rb") as avatar_file: @@ -309,7 +311,6 @@ class AngelBot(ClientXMPP): if __name__ == "__main__": config = configparser.ConfigParser() config.read("config.ini") - jid = config["angel"]["jid"] password = config["angel"]["password"] autojoin = config["angel"]["autojoin"].split()