mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-11 20:52:42 +01:00
pr/insp: add kickServer
This commit is contained in:
parent
7de8f1509d
commit
8942c2fa08
@ -136,13 +136,11 @@ def quitClient(irc, numeric, reason):
|
||||
"a user that's not a PyLink PseudoClient from "
|
||||
"the internal state, use removeClient() instead.")
|
||||
|
||||
def kickClient(irc, numeric, channel, target, reason=None):
|
||||
def _sendKick(irc, numeric, channel, target, reason=None):
|
||||
"""<irc object> <kicker client numeric>
|
||||
|
||||
Sends a kick from a PyLink PseudoClient."""
|
||||
channel = channel.lower()
|
||||
if not utils.isInternalClient(irc, numeric):
|
||||
raise LookupError('No such PyLink PseudoClient exists.')
|
||||
if not reason:
|
||||
reason = 'No reason given'
|
||||
_sendFromUser(irc, numeric, 'KICK %s %s :%s' % (channel, target, reason))
|
||||
@ -151,6 +149,16 @@ def kickClient(irc, numeric, channel, target, reason=None):
|
||||
# handle_part() does that just fine.
|
||||
handle_part(irc, target, 'KICK', [channel])
|
||||
|
||||
def kickClient(irc, numeric, channel, target, reason=None):
|
||||
if not utils.isInternalClient(irc, numeric):
|
||||
raise LookupError('No such PyLink PseudoClient exists.')
|
||||
_sendKick(irc, numeric, channel, target, reason=reason)
|
||||
|
||||
def kickServer(irc, numeric, channel, target, reason=None):
|
||||
if not utils.isInternalServer(irc, numeric):
|
||||
raise LookupError('No such PyLink PseudoServer exists.')
|
||||
_sendKick(irc, numeric, channel, target, reason=reason)
|
||||
|
||||
def nickClient(irc, numeric, newnick):
|
||||
"""<irc object> <client numeric> <new nickname>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user