mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-30 14:49:28 +01:00
corecommands: alias 'identify' to 'login' and 'id'
This commit is contained in:
parent
187ca11946
commit
21a39de0b4
@ -25,14 +25,13 @@ def _loginfail(irc, source, username):
|
|||||||
irc.error('Incorrect credentials.')
|
irc.error('Incorrect credentials.')
|
||||||
log.warning("(%s) Failed login to %r from %s", irc.name, username, irc.get_hostmask(source))
|
log.warning("(%s) Failed login to %r from %s", irc.name, username, irc.get_hostmask(source))
|
||||||
|
|
||||||
@utils.add_cmd
|
|
||||||
def identify(irc, source, args):
|
def identify(irc, source, args):
|
||||||
"""<username> <password>
|
"""<username> <password>
|
||||||
|
|
||||||
Logs in to PyLink using the configured administrator account."""
|
Logs in to PyLink using the configured administrator account."""
|
||||||
if utils.isChannel(irc.called_in):
|
if utils.isChannel(irc.called_in):
|
||||||
irc.reply('Error: This command must be sent in private. '
|
irc.reply('Error: This command must be sent in private. '
|
||||||
'(Would you really type a password inside a channel?)')
|
'(Would you really type a password inside a channel?)')
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
username, password = args[0], args[1]
|
username, password = args[0], args[1]
|
||||||
@ -52,7 +51,7 @@ def identify(irc, source, args):
|
|||||||
else:
|
else:
|
||||||
# Username not found.
|
# Username not found.
|
||||||
_loginfail(irc, source, username)
|
_loginfail(irc, source, username)
|
||||||
|
utils.add_cmd(identify, aliases=('login', 'id'))
|
||||||
|
|
||||||
@utils.add_cmd
|
@utils.add_cmd
|
||||||
def shutdown(irc, source, args):
|
def shutdown(irc, source, args):
|
||||||
|
Loading…
Reference in New Issue
Block a user