A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. # A simple command to test the bot.
  3. import random
  4. actions, data = None, None
  5. def call(a, d):
  6. global actions, data
  7. actions, data = a, d
  8. choices = ("say_hi()", "say_sup()")
  9. exec random.choice(choices)
  10. def say_hi():
  11. actions.say(data.chan, "Hey \x02%s\x0F!" % data.nick)
  12. def say_sup():
  13. actions.say(data.chan, "'sup \x02%s\x0F?" % data.nick)