diff options
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/figlet.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/data/rbot/plugins/figlet.rb b/data/rbot/plugins/figlet.rb index d95b0c58..7a3d1935 100644 --- a/data/rbot/plugins/figlet.rb +++ b/data/rbot/plugins/figlet.rb @@ -54,6 +54,8 @@ class FigletPlugin < Plugin @bot.config['toilet.filters'] end + attr_reader :has, :params + def test_figlet #check that figlet is present @has[:figlet] = File.exist?(figlet_path) @@ -102,7 +104,7 @@ class FigletPlugin < Plugin end def figlet(m, params) - key = m.plugin.intern + key = params[:plugin] || m.plugin.intern unless @has[key] m.reply("%{cmd} couldn't be found. if it's installed, you should set the %{cmd}.path config key to its path" % { :cmd => key @@ -117,7 +119,7 @@ class FigletPlugin < Plugin end # collect the parameters to pass to safe_exec - exec_params = [send(:"#{m.plugin}_path")] + @params[key] + [message] + exec_params = [send(:"#{key}_path")] + @params[key] + [message] # run the program m.reply Utils.safe_exec(*exec_params), :max_lines => 0 |