Remove halbot, update slogan module to show usage when used improperly

master
mutantmonkey 2011-07-28 10:48:40 -04:00
parent 04b31bb963
commit fa3fd7110c
2 changed files with 4 additions and 27 deletions

View File

@ -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'

View File

@ -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