Added .botfight and .bothug
parent
f3c80c2ba7
commit
fe4721bb99
2
bot.py
2
bot.py
|
@ -159,6 +159,8 @@ class Phenny(irc.Bot):
|
|||
self.bot.msg(sender, origin.nick + ': ' + msg))
|
||||
elif attr == 'say':
|
||||
return lambda msg: self.bot.msg(sender, msg)
|
||||
elif attr == 'do':
|
||||
return lambda msg: self.bot.action(sender, msg)
|
||||
return getattr(self.bot, attr)
|
||||
|
||||
return PhennyWrapper(self)
|
||||
|
|
4
irc.py
4
irc.py
|
@ -154,6 +154,10 @@ class Bot(asynchat.async_chat):
|
|||
|
||||
self.sending.release()
|
||||
|
||||
def action(self, recipient, text):
|
||||
textu = unicode(chr(1) + "ACTION %s" % text)
|
||||
return self.msg(recipient, textu)
|
||||
|
||||
def notice(self, dest, text):
|
||||
self.write(('NOTICE', dest), text)
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/python2
|
||||
"""
|
||||
botfight.py - .botfight module
|
||||
author: mutantmonkey <mutantmonkey@gmail.com>
|
||||
"""
|
||||
|
||||
import random
|
||||
|
||||
otherbot = "truncatedcone"
|
||||
|
||||
def botfight(phenny, input):
|
||||
messages = ["hits %s", "punches %s", "kicks %s", "hits %s with a rubber hose", "stabs %s with a clean kitchen knife"]
|
||||
response = random.choice(messages)
|
||||
|
||||
phenny.do(response % otherbot)
|
||||
botfight.commands = ['botfight']
|
||||
botfight.priority = 'low'
|
||||
|
||||
def bothug(phenny, input):
|
||||
phenny.do("hugs %s" % otherbot)
|
||||
bothug.commands = ['bothug']
|
||||
bothug.priority = 'low'
|
||||
|
||||
if __name__ == '__main__':
|
||||
print __doc__.strip()
|
||||
|
Loading…
Reference in New Issue