From 96c3ea2d8218c58d5ab44e13d5d1715d2c0f922e Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 9 Jul 2015 16:32:29 -0700 Subject: [PATCH] pr/insp: add topic/invite/knockClient commands Closes #34. --- protocols/inspircd.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 5c1bc9f..e30ff74 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -169,6 +169,31 @@ def noticeClient(irc, numeric, target, text): raise LookupError('No such PyLink PseudoClient exists.') _sendFromUser(irc, numeric, 'NOTICE %s :%s' % (target, text)) +def topicClient(irc, numeric, target, text): + """ + + Sets the topic for to from PyLink client .""" + if not utils.isInternalClient(irc, numeric): + raise LookupError('No such PyLink PseudoClient exists.') + _sendFromUser(irc, numeric, 'TOPIC %s :%s' % (target, text)) + +def inviteClient(irc, numeric, target, channel): + """ + + Invites to to from PyLink client .""" + if not utils.isInternalClient(irc, numeric): + raise LookupError('No such PyLink PseudoClient exists.') + _sendFromUser(irc, numeric, 'INVITE %s %s' % (target, channel)) + +def knockClient(irc, numeric, target, text): + """ + + Knocks on with from PyLink client .""" + if not utils.isInternalClient(irc, numeric): + raise LookupError('No such PyLink PseudoClient exists.') + _sendFromUser(irc, numeric, 'ENCAP * KNOCK %s :%s' % (target, text)) + + def connect(irc): irc.start_ts = ts = int(time.time()) irc.uidgen = {}