Guest User

Untitled

a guest
Apr 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. import pyrc, markov
  2.  
  3. m = markov.Markov()
  4. m.load("bbot.mchain")
  5.  
  6. bot = pyrc.Irc_bot()
  7. bot.host, bot.port, bot.botnick = "irc.arg-irc.net", 6667, "BastardBot"
  8. bot.ident = "MCFTW" #just so it doesn't autojoin main channel, this can be omitted
  9. bot.connect()
  10. bot.join("#omgponies")
  11.  
  12. while True:
  13. bot.parse()
  14.  
  15. if bot.sender == "JimBastard":
  16. m.add(bot.msg.replace(bot.botnick, '')) #add message with the bot's nick stripped out, if it's there
  17.  
  18. if bot.msg.find(bot.botnick) != -1: #on hilight
  19. bot.say(m.respondTo(bot.msg), bot.chan)
Add Comment
Please, Sign In to add comment