mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Made name and hostmask optional in addhostmask.
This commit is contained in:
parent
bbd401533f
commit
2bd7a31c27
12
src/User.py
12
src/User.py
@ -191,17 +191,23 @@ class User(callbacks.Privmsg):
|
|||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
|
||||||
def addhostmask(self, irc, msg, args):
|
def addhostmask(self, irc, msg, args):
|
||||||
"""<name> <hostmask> [<password>]
|
"""[<name>] [<hostmask>] [<password>]
|
||||||
|
|
||||||
Adds the hostmask <hostmask> to the user specified by <name>. The
|
Adds the hostmask <hostmask> to the user specified by <name>. The
|
||||||
<password> may only be required if the user is not recognized by
|
<password> may only be required if the user is not recognized by
|
||||||
hostmask. If you include the <password> parameter, this message must
|
hostmask. If you include the <password> parameter, this message must
|
||||||
be sent to the bot privately (not on a channel). <password> is also
|
be sent to the bot privately (not on a channel). <password> is also
|
||||||
not required if an owner user is giving the command on behalf of some
|
not required if an owner user is giving the command on behalf of some
|
||||||
other user.
|
other user. If <hostmask> is not given, it defaults to your current
|
||||||
|
hostmask. If <name> is not given, it defaults to your currently
|
||||||
|
identified name.
|
||||||
"""
|
"""
|
||||||
(name, hostmask, password) = privmsgs.getArgs(args, 2, 1)
|
(name, hostmask, password) = privmsgs.getArgs(args, 0, 3)
|
||||||
self._checkNotChannel(irc, msg, password)
|
self._checkNotChannel(irc, msg, password)
|
||||||
|
if not hostmask:
|
||||||
|
hostmask = msg.prefix
|
||||||
|
if not name:
|
||||||
|
name = msg.prefix
|
||||||
if not ircutils.isUserHostmask(hostmask):
|
if not ircutils.isUserHostmask(hostmask):
|
||||||
irc.error('That\'s not a valid hostmask. Make sure your hostmask '
|
irc.error('That\'s not a valid hostmask. Make sure your hostmask '
|
||||||
'includes a nick, then an exclamation point (!), then '
|
'includes a nick, then an exclamation point (!), then '
|
||||||
|
Loading…
Reference in New Issue
Block a user