diff options
-rw-r--r-- | data/rbot/plugins/usermodes.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/data/rbot/plugins/usermodes.rb b/data/rbot/plugins/usermodes.rb new file mode 100644 index 00000000..99167569 --- /dev/null +++ b/data/rbot/plugins/usermodes.rb @@ -0,0 +1,26 @@ +#-- vim:sw=2:et +#++ +# +# :title: Usermodes plugin +# +# Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com> +# Copyright:: (C) 2007 Giuseppe Bilotta +# License:: rbot's licence +# + +class UserModesPlugin < Plugin + Config.register Config::StringValue.new('irc.usermodes', + :default => '', + :desc => "User modes to set when connecting to the server") + + def help(plugin, topic="") + "handles automatic usermode settings on connect. See the config variable irc.usermodes" + end + + def connect(m) + modes = @bot.config['irc.usermodes'] + @bot.mode(@bot.nick, modes, '') unless modes.empty? + end +end + +plugin = UserModesPlugin.new |