Class: MoonBot::Plugin::Auth

Inherits:
Object
  • Object
show all
Defined in:
lib/MoonBot/plugins/auth.rb

Instance Method Summary collapse

Constructor Details

#initialize(bot) ⇒ Auth

Returns a new instance of Auth.



5
6
7
# File 'lib/MoonBot/plugins/auth.rb', line 5

def initialize bot
  @bot = bot
end

Instance Method Details

#on_notice(message) ⇒ Object



9
10
11
# File 'lib/MoonBot/plugins/auth.rb', line 9

def on_notice message
  send_auth if message[:trailing] == '*** No Ident response'
end

#send_authObject



19
20
21
22
23
24
25
# File 'lib/MoonBot/plugins/auth.rb', line 19

def send_auth
  puts "Sending User Data"
  nick = "NICK #{@nick}"
  user = "USER #{@login} 8 * : #{@name}"
  @bot.command nick
  @bot.command user
end

#set_user(nick, login, name = nil) ⇒ Object



13
14
15
16
17
# File 'lib/MoonBot/plugins/auth.rb', line 13

def set_user nick, , name = nil
  @nick  = nick
  @login = 
  @name  = name || 
end