A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.py 392 B

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