Class: Login

Inherits:
Sponge::Plugin show all
Defined in:
lib/proto/plugins/login.rb

Constant Summary

Constants inherited from Sponge::Plugin

Sponge::Plugin::AUTH, Sponge::Plugin::LIST, Sponge::Plugin::LISTENERS

Instance Method Summary collapse

Methods inherited from Sponge::Plugin

command, has_listener?, inherited, #initialize, listen_to, requires_auth, #requires_auth?, #usage

Constructor Details

This class inherits a constructor from Sponge::Plugin

Instance Method Details

#helpObject



11
12
13
# File 'lib/proto/plugins/login.rb', line 11

def help
  "login <password>"
end

#reply(m, arg) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/proto/plugins/login.rb', line 3

def reply(m, arg)
  if @bot.auth.(m.nick, arg.to_s)
    m.answer "You're logged in"
  else
    m.answer "Unable to log in"
  end
end