diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-15 19:34:58 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2006-10-15 19:34:58 +0000 |
commit | 21af4682361be8d6218d1ea9575da9e311b675a7 (patch) | |
tree | 30e76c2930f313a3168d36cc53d6c643924bb686 /lib/rbot/plugins.rb | |
parent | 72f035baa45e2428891924ac863f811317d28f5f (diff) |
Allow plugins to do things when the language is changed. Will be used e.g. by lart to use language-specific lart files
Diffstat (limited to 'lib/rbot/plugins.rb')
-rw-r--r-- | lib/rbot/plugins.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |