diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-10-17 07:52:22 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-10-17 07:52:22 +0000 |
commit | b60f397a9e92b6e6c8d3c8a5d0ba41a5b8bcb896 (patch) | |
tree | b38f2666e204859101a757008eb1bcdcc266a0f6 | |
parent | 42dc28f5e07332076ab373981c92847f4e376265 (diff) |
usermodes plugin: initial commit. handles automatico usermode setting on connect
-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 |