Update parse_privmsg, now it returns sender, reciever, channel objects and the message

This commit is contained in:
adator
2025-11-02 20:58:56 +01:00
parent ff58cbb022
commit 34b5b4204e
5 changed files with 35 additions and 40 deletions

View File

@@ -62,13 +62,10 @@ def handle_on_mode(uplink: 'Defender', srvmsg: list[str]):
def handle_on_privmsg(uplink: 'Defender', srvmsg: list[str]):
# ['@mtag....',':python', 'PRIVMSG', '#defender', ':zefzefzregreg', 'regg', 'aerg']
sender = srvmsg[1].replace(':','')
channel = srvmsg[3]
message = srvmsg[4:]
message[0] = message[0].replace(':', '')
if uplink.ModConfig.sentinel == 1 and srvmsg[3] != uplink.Config.SERVICE_CHANLOG:
uplink.Protocol.send_priv_msg(uplink.Config.SERVICE_NICKNAME, f"{sender} say on {channel}: {' '.join(message)}", uplink.Config.SERVICE_CHANLOG)
sender, reciever, channel, message = uplink.Protocol.parse_privmsg(srvmsg)
if uplink.ModConfig.sentinel == 1 and channel.name != uplink.Config.SERVICE_CHANLOG:
uplink.Protocol.send_priv_msg(uplink.Config.SERVICE_NICKNAME, f"{sender.nickname} say on {channel.name}: {' '.join(message)}", uplink.Config.SERVICE_CHANLOG)
action_on_flood(uplink, srvmsg)
return None