summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rbot/plugins/figlet.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/data/rbot/plugins/figlet.rb b/data/rbot/plugins/figlet.rb
index 64be496c..0eebc813 100644
--- a/data/rbot/plugins/figlet.rb
+++ b/data/rbot/plugins/figlet.rb
@@ -122,10 +122,16 @@ class FigletPlugin < Plugin
exec_params = [send(:"#{key}_path")] + @params[key] + [message]
# run the program
- m.reply Utils.safe_exec(*exec_params), :max_lines => 0
+ m.reply strip_first_last_empty_line(Utils.safe_exec(*exec_params)), :max_lines => 0
end
alias :toilet :figlet
+ private
+
+ def strip_first_last_empty_line(txt)
+ txt.gsub(/\A(?:^\s*\r?\n)+/m,'').rstrip
+ end
+
end
plugin = FigletPlugin.new