added optional factoid prefix. closes #17
This commit is contained in:
parent
32c9e15b91
commit
bc3b61e57f
2 changed files with 15 additions and 2 deletions
|
@ -111,11 +111,16 @@ def forget(inp, db=None, input=None, notice=None):
|
|||
|
||||
@hook.command("info")
|
||||
@hook.regex(r'^\? ?(.+)')
|
||||
def question(inp, say=None, db=None):
|
||||
def question(inp, say=None, db=None, bot=None):
|
||||
"?<word> -- Shows what data is associated with <word>."
|
||||
prefix_on = bot.config["plugins"]["factoids"]["prefix"]
|
||||
|
||||
db_init(db)
|
||||
|
||||
data = get_memory(db, inp.group(1).strip())
|
||||
if data:
|
||||
out = multiwordReplace(data, shortcodes)
|
||||
say(out)
|
||||
if prefix_on:
|
||||
say("\x02[%s]:\x02 %s" % (inp.group(1).strip(), out))
|
||||
else:
|
||||
say(out)
|
||||
|
|
Reference in a new issue