diff --git a/config.ini.default b/config.ini.default index 6170b29..d10382e 100644 --- a/config.ini.default +++ b/config.ini.default @@ -1,6 +1,6 @@ [chen] jid = chen@example.com password = b0TPA55W0rD +prefix = ! nick = Chen autojoin = room1@muc.example.com room2@muc.example.com room3@muc.example.com -prefix = ! diff --git a/main.py b/main.py index 83144e1..c3addba 100644 --- a/main.py +++ b/main.py @@ -136,7 +136,7 @@ class ChenBot(ClientXMPP): fname = filename if filename else f"file{ext}" await self.embed_file(url, sender, mtype, ftype, fname, outfile) except Exception as e: - print(e) + print(e) async def embed_file(self, url, sender, mtype, ftype, fname, outfile): """Embed a file and send the result to the sender.""" @@ -295,24 +295,29 @@ class ChenBot(ClientXMPP): if ctx: return bot.send_message( - mto=sender, mbody=f"{msg['mucnick']}: https://git.chaotic.ninja/usr/yakumo_izuru/chen", mtype="groupchat", + mto=sender, + mbody=f"{msg['mucnick']}: https://git.chaotic.ninja/usr/yakumo_izuru/chen", + mtype="groupchat", + ) + + @self.word + def repo(msg, ctx, sender): + if ctx: + return + bot.send_message( + mto=sender, + mbody=f"{msg.get_from().bare}: https://git.chaotic.ninja/usr/yakumo_izuru/chen", + mtype="chat", ) - @self.word - def repo(msg, ctx, sender): - if ctx: - return - bot.send_message( - mto=sender, mbody=f"{msg.get_from().bare}: https://git.chaotic.ninja/usr/yakumo_izuru/chen", mtype="chat", - ) 2 if __name__ == "__main__": config = configparser.ConfigParser() config.read("config.ini") jid = config["chen"]["jid"] - prefix = config["chen"]["prefix"] password = config["chen"]["password"] + prefix = config["chen"]["prefix"] nick = config["chen"]["nick"] autojoin = config["chen"]["autojoin"].split() bot = ChenBot(jid, password, nick, prefix, autojoin=autojoin)