summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaine Virta <rane@kapsi.fi>2009-12-16 22:33:30 +0200
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2009-12-21 10:30:45 +0100
commitb7fad38870b04450feafaf3e96ba4b3011816049 (patch)
treec54f6b8b1bf23a1b2b2bee14c485efcf202bd67a
parent682e7f1708b9534385467b3d707433cb256b6405 (diff)
spotify: fail on load if Spotify module is not available
-rw-r--r--data/rbot/plugins/spotify.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/data/rbot/plugins/spotify.rb b/data/rbot/plugins/spotify.rb
index 95fe5842..29331c00 100644
--- a/data/rbot/plugins/spotify.rb
+++ b/data/rbot/plugins/spotify.rb
@@ -10,6 +10,14 @@
# 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