# License:: GPL v2
class SpotifyPlugin < Plugin
+ def initialize
+ super
+
+ unless Object.const_defined?('Spotify')
+ raise 'Spotify module not found (lib_spotify plugin probably not enabled)'
+ end
+ end
+
def help(plugin, topic)
_("spotify plugin - usage: spotify <spotify>, spotify artist <artist>, spotify album <album>")
end
def search(m, params)
method = params[:method] || 'track'
- result = Spotify.search(method, params[:query].to_s)
+ begin
+ result = Spotify.search(method, params[:query].to_s)
+ rescue
+ m.reply "problems connecting to Spotify"
+ end
if result.nil?
m.reply "no results"