Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2013
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.52 KB | None | 0 0
  1. require 'cinch'
  2.  
  3. module Cinch::Plugins
  4.   class Oper
  5.   include Cinch::Plugin
  6.  
  7.   match /oper/
  8.  
  9.   def check_user(user)
  10.     user.refresh
  11.    
  12.     %w[Auth Auth1].include? user.authname
  13. end
  14.  
  15.   def execute(m)
  16.     if m.channel
  17.       unless check_user(m.user)
  18.         m.reply Format(:red, "You are not authorized to use this command!")
  19.       return;
  20.     end
  21.      bot.info("Received valid oper command from #{m.user.nick}")
  22.      m.reply Format(:green, "Oper Up!")
  23.      bot.irc.send ("OPER NAME PASS")
  24.    end
  25.   end
  26.  end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement