Class: SoupIRC
- Inherits:
-
Object
- Object
- SoupIRC
- Includes:
- Muzang::Plugins::Helpers
- Defined in:
- lib/muzang-plugins/muzang-soupirc.rb
Instance Method Summary collapse
- #call(connection, message) ⇒ Object
-
#initialize(bot, soup) ⇒ SoupIRC
constructor
A new instance of SoupIRC.
Methods included from Muzang::Plugins::Helpers
#create_database, #match, #on_channel, #on_join
Constructor Details
#initialize(bot, soup) ⇒ SoupIRC
Returns a new instance of SoupIRC.
6 7 8 9 |
# File 'lib/muzang-plugins/muzang-soupirc.rb', line 6 def initialize(bot, soup) @bot = bot @soup = soup || File.open(ENV["HOME"] + "/.muzang/" + "soup").read.split(":") rescue nil end |
Instance Method Details
#call(connection, message) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/muzang-plugins/muzang-soupirc.rb', line 11 def call(connection, ) ..match(/^!soup (.*?)$/) do |m| soup = Soup::Client.new(@soup.first, @soup.last.chomp) soup.login soup.new_image(m[1]) connection.msg(@bot.channels.first, "soup updated :) | http://#{@soup.first}.soup.io/") end end |