diff --git a/core/config.py b/core/config.py index 7af9f8c..8ea8255 100755 --- a/core/config.py +++ b/core/config.py @@ -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 + diff --git a/plugins/factoids.py b/plugins/factoids.py index 6c5cc21..815f884 100755 --- a/plugins/factoids.py +++ b/plugins/factoids.py @@ -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): "? -- Shows what data is associated with ." + 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)