Class: MoonBot::Plugin::Auth
- Inherits:
-
Object
- Object
- MoonBot::Plugin::Auth
- Defined in:
- lib/MoonBot/plugins/auth.rb
Instance Method Summary collapse
-
#initialize(bot) ⇒ Auth
constructor
A new instance of Auth.
- #on_notice(message) ⇒ Object
- #send_auth ⇒ Object
- #set_user(nick, login, name = nil) ⇒ Object
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 send_auth if [:trailing] == '*** No Ident response' end |
#send_auth ⇒ Object
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, login, name = nil @nick = nick @login = login @name = name || login end |