Commit 3fb75e1a authored by cath's avatar cath
Browse files

the spanish mispelling bot

parent 45ac2aa5
import irc.bot
class HelloBot(irc.bot.SingleServerIRCBot):
def __init__(self, channel, nickname, server, port=6667):
irc.bot.SingleServerIRCBot.__init__(self, [(server, port)], nickname, nickname)
self.channel = channel
def on_welcome(self, c, e):
print "Bot connected"
c.join(self.channel)
def on_privmsg(self, c, e):
self.on_pubmsg(c, e)
def on_pubmsg(self, c, e):
# print e.target, e.source, e.arguments, e.type
m=e.arguments[0].lower()
b=m.replace('v','b')
c.privmsg(self.channel,b)
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description='BashBot')
parser.add_argument('--host', default="localhost", help='host')
parser.add_argument('--port', type=int, default=6667, help='port')
parser.add_argument('channel', help='channel to join')
parser.add_argument('nickname', help='bot nickname')
args = parser.parse_args()
if not args.channel.startswith("#"):
args.channel = "#"+args.channel
bot = HelloBot(args.channel, args.nickname, args.host, args.port)
bot.start()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment