A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

37 рядки
982 B

  1. # -*- coding: utf-8 -*-
  2. # Check what events on IRC we can respond to.
  3. from irc.commands import test, help, git, link, chanops
  4. def check(connection, data, hook):
  5. data.parse_args() # parse command arguments into data.command and data.args
  6. if hook == "join":
  7. pass
  8. if hook == "msg_private":
  9. pass
  10. if hook == "msg_public":
  11. pass
  12. if hook == "msg":
  13. if data.command == "!test":
  14. test.call(connection, data)
  15. elif data.command == "!help":
  16. help.call(connection, data)
  17. elif data.command == "!git":
  18. git.call(connection, data)
  19. elif (data.command == "!link" or
  20. ("[[" in data.msg and "]]" in data.msg) or
  21. ("{{" in data.msg and "}}" in data.msg)):
  22. link.call(connection, data)
  23. elif (data.command == "!voice" or data.command == "!devoice" or
  24. data.command == "!op" or data.command == "!deop"):
  25. chanops.call(connection, data)