mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Must've forgotten to commit this earlier.
This commit is contained in:
parent
9253ce5adc
commit
e5c58089ce
@ -50,14 +50,13 @@ def getChannel(msg, args):
|
|||||||
If the channel was given in args, args is modified (the channel is
|
If the channel was given in args, args is modified (the channel is
|
||||||
removed).
|
removed).
|
||||||
"""
|
"""
|
||||||
if ircutils.isChannel(msg.args[0]):
|
if args and ircutils.isChannel(args[0]):
|
||||||
|
return args.pop(0)
|
||||||
|
elif ircutils.isChannel(msg.args[0]):
|
||||||
return msg.args[0]
|
return msg.args[0]
|
||||||
else:
|
else:
|
||||||
if len(args) > 0:
|
raise callbacks.Error, 'Command must be sent in a channel or ' \
|
||||||
return args.pop(0)
|
'include a channel in its arguments.'
|
||||||
else:
|
|
||||||
raise callbacks.Error, 'Command must be sent in a channel or ' \
|
|
||||||
'include a channel in its arguments.'
|
|
||||||
|
|
||||||
def getArgs(args, needed=1, optional=0):
|
def getArgs(args, needed=1, optional=0):
|
||||||
"""Take the needed arguments from args.
|
"""Take the needed arguments from args.
|
||||||
|
Loading…
Reference in New Issue
Block a user