From d4cd540f1cf9891ed7f298ee1e565b4fd2c4ab57 Mon Sep 17 00:00:00 2001 From: jmf Date: Sat, 7 Sep 2013 00:02:57 +0200 Subject: [PATCH] Adding essential shortcut commands --- shortutils.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 shortutils.py diff --git a/shortutils.py b/shortutils.py new file mode 100644 index 0000000..253d89b --- /dev/null +++ b/shortutils.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +""" +shortutil.py - Phenny Custom Shortcut Module +Copyright 2013 jmf +Licensed under the WTFPL. +http://www.wtfpl.net/txt/copying/ + +Module for phenny: +http://inamidst.com/phenny/ +""" + +def rtfm(phenny, input): + """Manual reference command""" + for x in phenny.bot.commands["high"].values(): + if x[0].__name__ == "aa_hook": + if x[0](phenny, input): + return + phenny.say("Somebody thinks you should read the manual. The wiki for dev related questions is at http://dev.minetest.net , the regular wiki is at http://wiki.minetest.net. ") + +help.commands = ['rtfm'] + +def question(phenny, input): + """Ask smart questions""" + for x in phenny.bot.commands["high"].values(): + if x[0].__name__ == "aa_hook": + if x[0](phenny, input): + return + phenny.say("Someone thinks that your question is inaccurate or doesn't follow the guidelines. Read here how to make it right: http://catb.org/~esr/faqs/smart-questions.html") + +help.commands = ['question'] + +def next(phenny, input): + """Next one please""" + for x in phenny.bot.commands["high"].values(): + if x[0].__name__ == "aa_hook": + if x[0](phenny, input): + return + phenny.say("Another satisfied customer. Next!") + +help.commands = ['next'] \ No newline at end of file