mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +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:
|
else:
|
||||||
irc.errorInvalid('url', args[0])
|
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):
|
def getNow(irc, msg, args, state):
|
||||||
state.args.append(int(time.time()))
|
state.args.append(int(time.time()))
|
||||||
|
|
||||||
@ -494,6 +500,7 @@ wrappers = ircutils.IrcDict({
|
|||||||
'color': getIrcColor,
|
'color': getIrcColor,
|
||||||
'now': getNow,
|
'now': getNow,
|
||||||
'url': getUrl,
|
'url': getUrl,
|
||||||
|
'httpUrl': getHttpUrl,
|
||||||
'float': getFloat,
|
'float': getFloat,
|
||||||
'nonInt': getNonInt,
|
'nonInt': getNonInt,
|
||||||
'positiveInt': getPositiveInt,
|
'positiveInt': getPositiveInt,
|
||||||
|
Loading…
Reference in New Issue
Block a user