Class: Artaius::Plugins::Autoopper

Inherits:
Object
  • Object
show all
Includes:
Cinch::Plugin
Defined in:
lib/artaius/plugins/autoopper.rb

Instance Method Summary collapse

Instance Method Details

#guard?(irc_authname) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/artaius/plugins/autoopper.rb', line 16

def guard?(irc_authname)
  Player.filter(:irc_authname => irc_authname).select_map(:role).first == 2
end

#listen(m) ⇒ Object



10
11
12
13
14
# File 'lib/artaius/plugins/autoopper.rb', line 10

def listen(m)
  return if m.user.nick == bot.nick

  m.channel.op(m.user) if guard?(m.user.authname)
end