Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyrc, markov
- m = markov.Markov()
- m.load("bbot.mchain")
- bot = pyrc.Irc_bot()
- bot.host, bot.port, bot.botnick = "irc.arg-irc.net", 6667, "BastardBot"
- bot.ident = "MCFTW" #just so it doesn't autojoin main channel, this can be omitted
- bot.connect()
- bot.join("#omgponies")
- while True:
- bot.parse()
- if bot.sender == "JimBastard":
- m.add(bot.msg.replace(bot.botnick, '')) #add message with the bot's nick stripped out, if it's there
- if bot.msg.find(bot.botnick) != -1: #on hilight
- bot.say(m.respondTo(bot.msg), bot.chan)
Add Comment
Please, Sign In to add comment