IRC->Shoutbox: Add support for ACTION (aka /me)

This commit is contained in:
Eragon 2023-01-23 16:18:08 +01:00
parent 04b0106b2a
commit ce6a7e1ba4
Signed by: Eragon
GPG Key ID: 087126EBFC725006
1 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,8 @@ shoutbox = Shoutbox(cookies)
@irc.on(lambda m: m.to[1:] in channels and not m.author.endswith("[s]"))
def handle_irc(m):
if (m.text.startswith("\x01ACTION ")):
m.text = m.text.replace("ACTION ", "[i]")
shoutbox.post(m.author, m.text, m.to[1:], USERS)