summaryrefslogtreecommitdiff
path: root/data/rbot/plugins/usermodes.rb
blob: bc85f8f4a05657f2b1a5e0951011eef424e49afe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
    modes = @bot.config['irc.usermodes']
    @bot.mode(@bot.nick, modes, '') unless modes.empty?
  end
end

plugin = UserModesPlugin.new