Changed code around a bit

This commit is contained in:
lukeroge 2012-03-29 11:19:54 +13:00
parent 90aa412a00
commit 36d7d0a1cc

View file

@ -111,11 +111,9 @@ def forget(inp, db=None, input=None, notice=None):
@hook.regex(r'^\? ?(.+)') @hook.regex(r'^\? ?(.+)')
def factoid(inp, say=None, db=None, bot=None): def factoid(inp, say=None, db=None, bot=None):
"?<word> -- Shows what data is associated with <word>." "?<word> -- Shows what data is associated with <word>."
try:
prefix_on = bot.config["plugins"]["factoids"]["prefix"] prefix_on = bot.config["plugins"]["factoids"].get("prefix", False)
except KeyError:
prefix_on = False
db_init(db) db_init(db)
data = get_memory(db, inp.group(1).strip()) data = get_memory(db, inp.group(1).strip())