added optional factoid prefix. closes #17
This commit is contained in:
parent
32c9e15b91
commit
bc3b61e57f
|
@ -41,6 +41,13 @@ if not os.path.exists('config'):
|
|||
"mc_user": "INSERT MINECRAFT USERNAME HERE",
|
||||
"mc_pass": "INSERT MINECRAFT PASSWORD HERE"
|
||||
},
|
||||
"plugins":
|
||||
{
|
||||
"factoids":
|
||||
{
|
||||
"prefix": false
|
||||
}
|
||||
},
|
||||
"censored_strings":
|
||||
[
|
||||
"mypass",
|
||||
|
@ -67,3 +74,4 @@ def config():
|
|||
|
||||
|
||||
bot._config_mtime = 0
|
||||
|
||||
|
|
|
@ -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)
|
||||
if prefix_on:
|
||||
say("\x02[%s]:\x02 %s" % (inp.group(1).strip(), out))
|
||||
else:
|
||||
say(out)
|
||||
|
|
Reference in a new issue