From fa3fd7110c1def20cce78e09da2d749595cd8a5b Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 28 Jul 2011 10:48:40 -0400 Subject: [PATCH] Remove halbot, update slogan module to show usage when used improperly --- modules/halbot.py | 27 --------------------------- modules/slogan.py | 4 ++++ 2 files changed, 4 insertions(+), 27 deletions(-) delete mode 100755 modules/halbot.py diff --git a/modules/halbot.py b/modules/halbot.py deleted file mode 100755 index 4605b5a..0000000 --- a/modules/halbot.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python -""" -halbot.py - A module to connect to Halpy AI module -Copyright (c) 2011 Dafydd Crosby - http://www.dafyddcrosby.com - -Licensed under the Eiffel Forum License 2. -""" -from megahal import * -megahal = MegaHAL() - -def learn(phenny,input): - """Listens in on the room, gradually learning new phrases""" - megahal.learn(input.group()) -learn.rule = r'(.*)' -learn.priority = 'low' - -def megahalbot(phenny, input): - """Responds when someone mentions the bot nickname""" - # Clean the input so Halpy does not get confused - inp = input.group().replace(phenny.nick,'') - inp = inp.replace("\'","") - inp = inp.replace("\"","") - - phenny.say(input.nick + ": " + megahal.get_reply(inp)) - megahal.sync() -megahalbot.rule = r'(.*)$nickname(.*)' -megahalbot.priority = 'low' diff --git a/modules/slogan.py b/modules/slogan.py index d8e2666..2056e4b 100755 --- a/modules/slogan.py +++ b/modules/slogan.py @@ -17,6 +17,10 @@ def sloganize(word): def slogan(phenny, input): word = input.group(2) + if word is None: + phenny.say("You need to specify a word; try .slogan Granola") + return + slogan = sloganize(word) # Remove HTML tags