Class: SeenPlugin
- Inherits:
-
Sponge::Plugin
- Object
- Sponge::Plugin
- SeenPlugin
- Defined in:
- lib/proto/plugins/seen.rb
Constant Summary
Constants inherited from Sponge::Plugin
Sponge::Plugin::AUTH, Sponge::Plugin::LIST, Sponge::Plugin::LISTENERS
Instance Method Summary collapse
-
#initialize(bot) ⇒ SeenPlugin
constructor
A new instance of SeenPlugin.
- #listen(message) ⇒ Object
- #reply(m, arg) ⇒ Object
Methods inherited from Sponge::Plugin
command, has_listener?, #help, inherited, listen_to, requires_auth, #requires_auth?, #usage
Constructor Details
#initialize(bot) ⇒ SeenPlugin
Returns a new instance of SeenPlugin.
4 5 6 |
# File 'lib/proto/plugins/seen.rb', line 4 def initialize(bot) @users = {} end |
Instance Method Details
#listen(message) ⇒ Object
8 9 10 |
# File 'lib/proto/plugins/seen.rb', line 8 def listen() @users[.nick] = end |
#reply(m, arg) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/proto/plugins/seen.rb', line 12 def reply(m, arg) if @users.include?(arg) m.reply "I have seen #{arg}" else m.reply "I haven't seen #{arg}" end end |