mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Added httpUrl converter.
This commit is contained in:
parent
e3bdd34f3f
commit
1a73603e22
@ -434,6 +434,12 @@ def getUrl(irc, msg, args, state):
|
||||
else:
|
||||
irc.errorInvalid('url', args[0])
|
||||
|
||||
def getHttpUrl(irc, msg, args, state):
|
||||
if webutils.urlRe.match(args[0]) and args[0].startswith('http://'):
|
||||
state.args.append(args.pop(0))
|
||||
else:
|
||||
irc.errorInvalid('http url', args[0])
|
||||
|
||||
def getNow(irc, msg, args, state):
|
||||
state.args.append(int(time.time()))
|
||||
|
||||
@ -494,6 +500,7 @@ wrappers = ircutils.IrcDict({
|
||||
'color': getIrcColor,
|
||||
'now': getNow,
|
||||
'url': getUrl,
|
||||
'httpUrl': getHttpUrl,
|
||||
'float': getFloat,
|
||||
'nonInt': getNonInt,
|
||||
'positiveInt': getPositiveInt,
|
||||
|
Loading…
Reference in New Issue
Block a user