A Python robot that edits Wikipedia and interacts with people over IRC https://en.wikipedia.org/wiki/User:EarwigBot
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

25 行
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))