summaryrefslogtreecommitdiff
path: root/miniirc_idc.py
diff options
context:
space:
mode:
authorluk3yx <luk3yx@users.noreply.github.com>2022-05-07 16:58:34 +1200
committerluk3yx <luk3yx@users.noreply.github.com>2022-05-07 16:58:34 +1200
commitea3245d8b435a9da5ab960dc11e2141555a2634c (patch)
tree2999430c1cf7afa2d0870c36a728e374047dbf1d /miniirc_idc.py
parentb15d291025bd23dd1be9cfef1321e0d174015525 (diff)
downloadminiirc_idc-ea3245d8b435a9da5ab960dc11e2141555a2634c.tar.gz
miniirc_idc-ea3245d8b435a9da5ab960dc11e2141555a2634c.zip
IDC channels don't have a leading #
Diffstat (limited to 'miniirc_idc.py')
-rw-r--r--miniirc_idc.py11
1 files changed, 8 insertions, 3 deletions
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)