A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324
  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))