Lady Yukari proceeds to smack Chen with her umbrella

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: https://svn.yakumo.dev/yakumo.izuru/chen/trunk@36 32723744-9b23-0b4a-b1da-9b2e968f9461
This commit is contained in:
yakumo.izuru 2024-04-01 17:52:39 +00:00
parent 27b7fde29b
commit 3ddd0ec51e
2 changed files with 16 additions and 11 deletions

View File

@ -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 = !

25
main.py
View File

@ -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)