X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=inline;f=lib%2Frbot%2Fplugins.rb;h=66a7d84294778572ef7f3f2a53462cef379a279a;hb=21af4682361be8d6218d1ea9575da9e311b675a7;hp=8aa75d203f656790673b2abf4a9a826328e56c4e;hpb=72f035baa45e2428891924ac863f811317d28f5f;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/lib/rbot/plugins.rb b/lib/rbot/plugins.rb index 8aa75d20..66a7d842 100644 --- a/lib/rbot/plugins.rb +++ b/lib/rbot/plugins.rb @@ -88,6 +88,10 @@ module Plugins connect():: Called when a server is joined successfully, but before autojoin channels are joined (no params) + set_language(String):: + Called when the user sets a new language + whose name is the given String + save:: Called when you are required to save your plugin's state, if you maintain data between sessions @@ -111,6 +115,9 @@ module Plugins @registry = BotRegistryAccessor.new(@bot, self.class.to_s.gsub(/^.*::/, "")) @manager.add_botmodule(self) + if self.respond_to?('set_language') + self.set_language(@bot.lang.language) + end end def botmodule_class