summaryrefslogtreecommitdiff
path: root/data/rbot/plugins
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-10-17 07:52:22 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-10-17 07:52:22 +0000
commitb60f397a9e92b6e6c8d3c8a5d0ba41a5b8bcb896 (patch)
treeb38f2666e204859101a757008eb1bcdcc266a0f6 /data/rbot/plugins
parent42dc28f5e07332076ab373981c92847f4e376265 (diff)
usermodes plugin: initial commit. handles automatico usermode setting on connect
Diffstat (limited to 'data/rbot/plugins')
-rw-r--r--data/rbot/plugins/usermodes.rb26
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