diff options
-rw-r--r-- | data/rbot/plugins/translator.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/data/rbot/plugins/translator.rb b/data/rbot/plugins/translator.rb index d4f55444..8617c321 100644 --- a/data/rbot/plugins/translator.rb +++ b/data/rbot/plugins/translator.rb @@ -284,6 +284,8 @@ class TranslatorPlugin < Plugin rescue Exception warning _("Translator %{name} cannot be used: %{reason}") % {:name => name, :reason => $!} + map "#{name} [*args]", :action => :failed_translator, + :defaults => {:name => name, :reason => $!} end end @@ -295,6 +297,11 @@ class TranslatorPlugin < Plugin update_default end + def failed_translator(m, params) + m.reply _("Translator %{name} cannot be used: %{reason}") % + {:name => params[:name], :reason => params[:reason]} + end + def help(plugin, topic=nil) if @translators.has_key?(plugin) translator = @translators[plugin] |