Class: Cinch::Plugins::Authtest

Inherits:
Object
  • Object
show all
Includes:
Admin, Cinch::Plugin
Defined in:
lib/cinch/plugins/authtest.rb

Constant Summary

Constants included from Admin

Admin::TYPES

Instance Method Summary collapse

Methods included from Admin

#add_admin, #add_trusted, #delete_admin, #delete_trusted, #each_controlchannel, #each_online_admin, #each_online_trusted, #get_admins, #get_trusted, #is_admin?, #is_trusted?, #no_admins?

Methods included from Helpers

#check_user, #is_channel_disabled?, table_format

Instance Method Details

#execute(m, question_context) ⇒ Object


15
16
17
18
19
20
21
22
23
# File 'lib/cinch/plugins/authtest.rb', line 15

def execute(m, question_context)
  test = (question_context.eql?("an admin") ? is_admin?(m.user) : is_trusted?(m.user))
  if test
    #m.channel.action "hugs #{m.user.nick}" if m.channel?
    m.reply "You are #{question_context}!"
  else
    m.reply "Sorry to say this #{m.user.nick}, but you are not #{question_context}."
  end
end