]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blob - data/rbot/plugins/usermodes.rb
fix: TCPSocked.gethostbyname is deprecated
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / usermodes.rb
1 #-- vim:sw=2:et
2 #++
3 #
4 # :title: Usermodes plugin
5 #
6 # Author:: Giuseppe "Oblomov" Bilotta <giuseppe.bilotta@gmail.com>
7 # Copyright:: (C) 2007 Giuseppe Bilotta
8 # License:: rbot's licence
9 #
10
11 class UserModesPlugin < Plugin
12   Config.register Config::StringValue.new('irc.usermodes',
13     :default => '',
14     :desc => "User modes to set when connecting to the server")
15
16   def help(plugin, topic="")
17     "handles automatic usermode settings on connect. See the config variable irc.usermodes"
18   end
19
20   def connect
21     modes = @bot.config['irc.usermodes']
22     @bot.mode(@bot.nick, modes, '') unless modes.empty?
23   end
24 end
25
26 plugin = UserModesPlugin.new