class Admin::Oper

Public Instance Methods

oper_clearchan(m, chan, confirm=false) click to toggle source
# File lib/Zeta/admin/oper.rb, line 30
def oper_clearchan(m, chan, confirm=false)
  if confirm == 'yes' || confirm == 'true'
    Channel(chan).join
    User('OperServ').send("mode #{chan} +o #{Zeta}")
    User('OperServ').send("mode #{chan} +mi")
    Channel(chan).send('This channel is being cleared')

    number_killed = 0
    Channel(chan).users.each_key do |u|
      if u != Zeta
        number_killed += 1
        @bot.irc.send("KILL #{u.nick} This channel is being cleared")
      end
    end
    m.safe_reply "#{chan} has been cleared, #{number_killed} clients killed"

  end
end
oper_kill(m, nick, message) click to toggle source
# File lib/Zeta/admin/oper.rb, line 22
def oper_kill(m, nick, message)
  return if User(nick).oper?
  message = message || 'We do not condone such behavior!'
  if @bot.irc.send("KILL #{nick} #{message}")
    m.reply "#{nick}: has been killed by #{m.user.nick} for #{message}"
  end
end
oper_up(m) click to toggle source

Methods

# File lib/Zeta/admin/oper.rb, line 16
def oper_up(m)
  if Config.oper_username && Config.oper_password
    @bot.oper(Config.oper_password, Config.oper_username)
  end
end
operserv_mode(m, modes) click to toggle source
# File lib/Zeta/admin/oper.rb, line 49
def operserv_mode(m, modes)
  User('OperServ').send("MODE #{m.channel} #{modes}")
end