A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

25 linhas
692 B

  1. # -*- coding: utf-8 -*-
  2. """Voice/devoice/op/deop users in the channel."""
  3. from config.irc_config import *
  4. connection, data = None, None
  5. def call(c, d):
  6. global connection, data
  7. connection, data = c, d
  8. if data.host not in ADMINS:
  9. connection.reply(data.chan, data.nick, "you must be a bot admin to use this command.")
  10. return
  11. if not data.args: # if it is just !op/!devoice/whatever without arguments, assume they want to do this to themselves
  12. target = data.nick
  13. else:
  14. target = data.args[0]
  15. action = data.command[1:] # strip ! at the beginning of the command
  16. connection.say("ChanServ", "%s %s %s" % (action, data.chan, target))