mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 14:40:51 +01:00
Added invite command with test, fixed docstrings.
This commit is contained in:
parent
976efd87cf
commit
f1e34ccfa9
@ -55,7 +55,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def op(self, irc, msg, args, channel):
|
def op(self, irc, msg, args, channel):
|
||||||
"""[<channel>] [<nick> ...]
|
"""[<channel>] [<nick> ...]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will give all the <nick>s
|
If you have the #channel,op capability, this will give all the <nick>s
|
||||||
you provide ops. If you don't provide any <nick>s, this will op you.
|
you provide ops. If you don't provide any <nick>s, this will op you.
|
||||||
<channel> is only necessary if the message isn't sent in the channel
|
<channel> is only necessary if the message isn't sent in the channel
|
||||||
itself.
|
itself.
|
||||||
@ -71,7 +71,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def halfop(self, irc, msg, args, channel):
|
def halfop(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
|
||||||
If you have the #channel.halfop capability, this will give all the
|
If you have the #channel,halfop capability, this will give all the
|
||||||
<nick>s you provide halfops. If you don't provide any <nick>s, this
|
<nick>s you provide halfops. If you don't provide any <nick>s, this
|
||||||
will give you halfops. <channel> is only necessary if the message isn't
|
will give you halfops. <channel> is only necessary if the message isn't
|
||||||
sent in the channel itself.
|
sent in the channel itself.
|
||||||
@ -87,7 +87,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def voice(self, irc, msg, args, channel):
|
def voice(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
|
||||||
If you have the #channel.voice capability, this will voice all the
|
If you have the #channel,voice capability, this will voice all the
|
||||||
<nick>s you provide. If you don't provide any <nick>s, this will
|
<nick>s you provide. If you don't provide any <nick>s, this will
|
||||||
voice you. <channel> is only necessary if the message isn't sent in the
|
voice you. <channel> is only necessary if the message isn't sent in the
|
||||||
channel itself.
|
channel itself.
|
||||||
@ -103,7 +103,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def deop(self, irc, msg, args, channel):
|
def deop(self, irc, msg, args, channel):
|
||||||
"""[<channel>] [<nick> ...]
|
"""[<channel>] [<nick> ...]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will remove operator
|
If you have the #channel,op capability, this will remove operator
|
||||||
privileges from all the nicks given. If no nicks are given, removes
|
privileges from all the nicks given. If no nicks are given, removes
|
||||||
operator privileges from the person sending the message.
|
operator privileges from the person sending the message.
|
||||||
"""
|
"""
|
||||||
@ -122,7 +122,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def dehalfop(self, irc, msg, args, channel):
|
def dehalfop(self, irc, msg, args, channel):
|
||||||
"""[<channel>] [<nick> ...]
|
"""[<channel>] [<nick> ...]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will remove half-operator
|
If you have the #channel,op capability, this will remove half-operator
|
||||||
privileges from all the nicks given. If no nicks are given, removes
|
privileges from all the nicks given. If no nicks are given, removes
|
||||||
half-operator privileges from the person sending the message.
|
half-operator privileges from the person sending the message.
|
||||||
"""
|
"""
|
||||||
@ -141,7 +141,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def devoice(self, irc, msg, args, channel):
|
def devoice(self, irc, msg, args, channel):
|
||||||
"""[<channel>] [<nick> ...]
|
"""[<channel>] [<nick> ...]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will remove voice from all
|
If you have the #channel,op capability, this will remove voice from all
|
||||||
the nicks given. If no nicks are given, removes voice from the person
|
the nicks given. If no nicks are given, removes voice from the person
|
||||||
sending the message.
|
sending the message.
|
||||||
"""
|
"""
|
||||||
@ -160,7 +160,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def cycle(self, irc, msg, args, channel):
|
def cycle(self, irc, msg, args, channel):
|
||||||
"""[<channel>] [<key>]
|
"""[<channel>] [<key>]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will cause the bot to
|
If you have the #channel,op capability, this will cause the bot to
|
||||||
"cycle", or PART and then JOIN the channel. If <key> is given, join
|
"cycle", or PART and then JOIN the channel. If <key> is given, join
|
||||||
the channel using that key. <channel> is only necessary if the message
|
the channel using that key. <channel> is only necessary if the message
|
||||||
isn't sent in the channel itself.
|
isn't sent in the channel itself.
|
||||||
@ -192,7 +192,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def kban(self, irc, msg, args):
|
def kban(self, irc, msg, args):
|
||||||
"""[<channel>] [--{exact,nick,user,host}] <nick> [<seconds>]
|
"""[<channel>] [--{exact,nick,user,host}] <nick> [<seconds>]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will kickban <nick> for
|
If you have the #channel,op capability, this will kickban <nick> for
|
||||||
as many seconds as you specify, or else (if you specify 0 seconds or
|
as many seconds as you specify, or else (if you specify 0 seconds or
|
||||||
don't specify a number of seconds) it will ban the person indefinitely.
|
don't specify a number of seconds) it will ban the person indefinitely.
|
||||||
--exact bans only the exact hostmask; --nick bans just the nick;
|
--exact bans only the exact hostmask; --nick bans just the nick;
|
||||||
@ -295,10 +295,24 @@ class Channel(callbacks.Privmsg):
|
|||||||
irc.error('How can I unban someone? I\'m not opped.')
|
irc.error('How can I unban someone? I\'m not opped.')
|
||||||
unban = privmsgs.checkChannelCapability(unban, 'op')
|
unban = privmsgs.checkChannelCapability(unban, 'op')
|
||||||
|
|
||||||
|
def invite(self, irc, msg, args, channel):
|
||||||
|
"""[<channel>] <nick>
|
||||||
|
|
||||||
|
If you have the #channel,op capability, this will invite <nick>
|
||||||
|
to join <channel>. <channel> is only necessary if the message isn't
|
||||||
|
sent in the channel itself.
|
||||||
|
"""
|
||||||
|
nick = privmsgs.getArgs(args)
|
||||||
|
if irc.nick in irc.state.channels[channel].ops:
|
||||||
|
irc.queueMsg(ircmsgs.invite(nick, channel))
|
||||||
|
else:
|
||||||
|
irc.error('How can I invite someone? I\'m not opped.')
|
||||||
|
invite = privmsgs.checkChannelCapability(invite, 'op')
|
||||||
|
|
||||||
def lobotomize(self, irc, msg, args, channel):
|
def lobotomize(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will "lobotomize" the
|
If you have the #channel,op capability, this will "lobotomize" the
|
||||||
bot, making it silent and unanswering to all requests made in the
|
bot, making it silent and unanswering to all requests made in the
|
||||||
channel. <channel> is only necessary if the message isn't sent in the
|
channel. <channel> is only necessary if the message isn't sent in the
|
||||||
channel itself.
|
channel itself.
|
||||||
@ -312,7 +326,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def unlobotomize(self, irc, msg, args, channel):
|
def unlobotomize(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
|
|
||||||
If you have the #channel.op capability, this will unlobotomize the bot,
|
If you have the #channel,op capability, this will unlobotomize the bot,
|
||||||
making it respond to requests made in the channel again.
|
making it respond to requests made in the channel again.
|
||||||
<channel> is only necessary if the message isn't sent in the channel
|
<channel> is only necessary if the message isn't sent in the channel
|
||||||
itself.
|
itself.
|
||||||
@ -326,7 +340,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def permban(self, irc, msg, args, channel):
|
def permban(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <nick|hostmask>
|
"""[<channel>] <nick|hostmask>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will effect a permanent
|
If you have the #channel,op capability, this will effect a permanent
|
||||||
(persistent) ban on the given <hostmask> (or the current hostmask
|
(persistent) ban on the given <hostmask> (or the current hostmask
|
||||||
associated with <nick>. <channel> is only necessary if the message
|
associated with <nick>. <channel> is only necessary if the message
|
||||||
isn't sent in the channel itself.
|
isn't sent in the channel itself.
|
||||||
@ -348,7 +362,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def unpermban(self, irc, msg, args, channel):
|
def unpermban(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <hostmask>
|
"""[<channel>] <hostmask>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will remove the permanent
|
If you have the #channel,op capability, this will remove the permanent
|
||||||
ban on <hostmask>. <channel> is only necessary if the message isn't
|
ban on <hostmask>. <channel> is only necessary if the message isn't
|
||||||
sent in the channel itself.
|
sent in the channel itself.
|
||||||
"""
|
"""
|
||||||
@ -362,7 +376,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def ignore(self, irc, msg, args, channel):
|
def ignore(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <nick|hostmask>
|
"""[<channel>] <nick|hostmask>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will set a permanent
|
If you have the #channel,op capability, this will set a permanent
|
||||||
(persistent) ignore on <hostmask> or the hostmask currently associated
|
(persistent) ignore on <hostmask> or the hostmask currently associated
|
||||||
with <nick>. <channel> is only necessary if the message isn't sent in
|
with <nick>. <channel> is only necessary if the message isn't sent in
|
||||||
the channel itself.
|
the channel itself.
|
||||||
@ -384,7 +398,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def unignore(self, irc, msg, args, channel):
|
def unignore(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <hostmask>
|
"""[<channel>] <hostmask>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will remove the permanent
|
If you have the #channel,op capability, this will remove the permanent
|
||||||
ignore on <hostmask> in the channel. <channel> is only necessary if the
|
ignore on <hostmask> in the channel. <channel> is only necessary if the
|
||||||
message isn't sent in the channel itself.
|
message isn't sent in the channel itself.
|
||||||
"""
|
"""
|
||||||
@ -418,7 +432,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def addcapability(self, irc, msg, args, channel):
|
def addcapability(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <name|hostmask> <capability>
|
"""[<channel>] <name|hostmask> <capability>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will give the user
|
If you have the #channel,op capability, this will give the user
|
||||||
currently identified as <name> (or the user to whom <hostmask> maps)
|
currently identified as <name> (or the user to whom <hostmask> maps)
|
||||||
the capability <capability> in the channel. <channel> is only necessary
|
the capability <capability> in the channel. <channel> is only necessary
|
||||||
if the message isn't sent in the channel itself.
|
if the message isn't sent in the channel itself.
|
||||||
@ -438,7 +452,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def removecapability(self, irc, msg, args, channel):
|
def removecapability(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <name|hostmask> <capability>
|
"""[<channel>] <name|hostmask> <capability>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will take from the user
|
If you have the #channel,op capability, this will take from the user
|
||||||
currently identified as <name> (or the user to whom <hostmask> maps)
|
currently identified as <name> (or the user to whom <hostmask> maps)
|
||||||
the capability <capability> in the channel. <channel> is only necessary
|
the capability <capability> in the channel. <channel> is only necessary
|
||||||
if the message isn't sent in the channel itself.
|
if the message isn't sent in the channel itself.
|
||||||
@ -458,7 +472,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def setdefaultcapability(self, irc, msg, args, channel):
|
def setdefaultcapability(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <default response to unknown capabilities> <True|False>
|
"""[<channel>] <default response to unknown capabilities> <True|False>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will set the default
|
If you have the #channel,op capability, this will set the default
|
||||||
response to non-power-related (that is, not {op, halfop, voice}
|
response to non-power-related (that is, not {op, halfop, voice}
|
||||||
capabilities to be the value you give. <channel> is only necessary if
|
capabilities to be the value you give. <channel> is only necessary if
|
||||||
the message isn't sent in the channel itself.
|
the message isn't sent in the channel itself.
|
||||||
@ -482,7 +496,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def setcapability(self, irc, msg, args, channel):
|
def setcapability(self, irc, msg, args, channel):
|
||||||
"""[<channel>] <capability>
|
"""[<channel>] <capability>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will add the channel
|
If you have the #channel,op capability, this will add the channel
|
||||||
capability <capability> for all users in the channel. <channel> is
|
capability <capability> for all users in the channel. <channel> is
|
||||||
only necessary if the message isn't sent in the channel itself.
|
only necessary if the message isn't sent in the channel itself.
|
||||||
"""
|
"""
|
||||||
@ -496,7 +510,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
def unsetcapability(self, irc, msg, args, channel):
|
def unsetcapability(self, irc, msg, args, channel):
|
||||||
"""[<chanel>] <capability>
|
"""[<chanel>] <capability>
|
||||||
|
|
||||||
If you have the #channel.op capability, this will unset the channel
|
If you have the #channel,op capability, this will unset the channel
|
||||||
capability <capability> so each user's specific capability or the
|
capability <capability> so each user's specific capability or the
|
||||||
channel default capability will take precedence. <channel> is only
|
channel default capability will take precedence. <channel> is only
|
||||||
necessary if the message isn't sent in the channel itself.
|
necessary if the message isn't sent in the channel itself.
|
||||||
|
@ -66,7 +66,7 @@ class ChannelTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
self.assertNoResponse(' ', 2)
|
self.assertNoResponse(' ', 2)
|
||||||
|
|
||||||
def testErrorsWithoutOps(self):
|
def testErrorsWithoutOps(self):
|
||||||
for s in 'op deop halfop dehalfop voice devoice kick'.split():
|
for s in 'op deop halfop dehalfop voice devoice kick invite'.split():
|
||||||
self.assertError('%s foo' % s)
|
self.assertError('%s foo' % s)
|
||||||
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
||||||
self.assertNotError('%s foo' % s)
|
self.assertNotError('%s foo' % s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user