Added check for factoid input

This commit is contained in:
Luke Rogers 2012-05-13 19:58:17 +12:00
parent bdc35a48b9
commit 119b4fdebd

View file

@ -148,9 +148,13 @@ def factoid(inp, say=None, db=None, bot=None, me=None, conn=None, input=None):
data = data.replace("$chan", input.chan) data = data.replace("$chan", input.chan)
data = data.replace("$botnick", conn.nick) data = data.replace("$botnick", conn.nick)
# if factoid had arguments, replace $inp with that # if factoid needs input, do that
if "$inp" in data:
if arguments: if arguments:
data = data.replace("$inp", arguments) data = data.replace("$inp", arguments)
else:
return "This factoid requires input. You can provide this" \
" with ?%s <input>" % factoid_id
# if <py>, execute python code # if <py>, execute python code
if data.startswith("<py>"): if data.startswith("<py>"):