A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

32 Zeilen
982 B

  1. # -*- coding: utf-8 -*-
  2. # Voice/devoice/op/deop users in the channel.
  3. from irc.classes import BaseCommand
  4. from core import config
  5. class ChanOps(BaseCommand):
  6. def get_hooks(self):
  7. return ["msg"]
  8. def get_help(self, command):
  9. action = command.capitalize()
  10. return "%s users in the channel." % action
  11. def check(self, data):
  12. if data.is_command and data.command in ["voice", "devoice", "op", "deop"]:
  13. return True
  14. return False
  15. def process(self, data):
  16. if data.host not in config.irc.permissions["admins"]:
  17. self.connection.reply(data, "you must be a bot admin to use this command.")
  18. return
  19. if not data.args: # if it is just !op/!devoice/whatever without arguments, assume they want to do this to themselves
  20. target = data.nick
  21. else:
  22. target = data.args[0]
  23. self.connection.say("ChanServ", "%s %s %s" % (data.command, data.chan, target))