From ea3245d8b435a9da5ab960dc11e2141555a2634c Mon Sep 17 00:00:00 2001 From: luk3yx Date: Sat, 7 May 2022 16:58:34 +1200 Subject: IDC channels don't have a leading # --- miniirc_idc.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'miniirc_idc.py') diff --git a/miniirc_idc.py b/miniirc_idc.py index 7ede26d..ed42afd 100644 --- a/miniirc_idc.py +++ b/miniirc_idc.py @@ -77,7 +77,7 @@ class IDC(miniirc.IRC): args = [self.current_nick, msg] elif idc_cmd == 'CHANMSG': command = 'PRIVMSG' - args = [idc_args['CHAN'], idc_args['MESSAGE']] + args = ['#' + idc_args['CHAN'], idc_args['MESSAGE']] elif idc_cmd == 'LOGIN_GOOD': command = '001' args = [self.current_nick, f'Welcome to IDC {self.current_nick}'] @@ -154,8 +154,13 @@ class IDC(miniirc.IRC): else: msg_type = None - self.idc_send('CHANMSG' if target.startswith('#') else 'PRIVMSG', - target=target, type=msg_type, message=msg, + if target.startswith('#'): + idc_cmd = 'CHANMSG' + target = target[1:] + else: + idc_cmd = 'PRIVMSG' + + self.idc_send(idc_cmd, target=target, type=msg_type, message=msg, label=label) elif cmd == 'PING': self.idc_send('PING', cookie=args[0], label=label) -- cgit v1.2.3