Permalink
Browse files

Merge branch 'master' of git@github.com:davglass/rbot-plugins

  • Loading branch information...
2 parents 6fdbc19 + 2433c13 commit cb354a440f90a57c655efb42b797b450d8fd9f13 @davglass committed Feb 7, 2009
Showing with 48 additions and 1 deletion.
  1. +4 −1 README.textile
  2. +12 −0 joinmsg/README.textile
  3. +32 −0 joinmsg/joinmsg.rb
View
@@ -6,9 +6,12 @@ h3. Current List:
* logger: MySQL channel logging. Supports being logged into multiple channels.
+h3. In progress:
+
+ * First Join Message: support for sending the user a message the first time they are seen. Kind of like a channel rules message.
+
h3. Ideas:
- * First Join Message: support for sending the user a message the first time they are seen. Kind of like a channel rules message.
* github stats: Ask the bot to fetch GitHub commits from the GitHub API
* jseval: A plugin to eval JavaScript
* docs: YUI doc search
View
@@ -0,0 +1,12 @@
+h2. Join Message
+
+This is a rough starter for this plugin.
+
+Currently, it will send a message to the user when they join the channel.
+
+TODO:
+
+ * Set different messages for different channels
+ * Setup config attributes
+ * List messages
+ * List users that have seen the messages
View
@@ -0,0 +1,32 @@
+class JoinMsg < Plugin
+
+ Config.register Config::StringValue.new('joinmsg.message',
+ :default => 'Default Welcome Message',
+ :desc => "Default Welcome Message...")
+
+ def help(plugin, topic="")
+ return "Help for Join Message"
+ end
+
+ def join(m)
+ nick = m.source.nick
+ channel = m.channel.to_s
+ key = "#{channel}::#{nick}"
+ if !@registry[key]
+ @registry[key] = true
+ @bot.say nick, "#{nick}, #{@bot.config['joinmsg.message']}"
+ end
+ return
+ end
+
+ def rm(m, params)
+ @registry.clear()
+ m.okay
+ end
+end
+
+plugin = JoinMsg.new
+
+plugin.map 'joinmsg rm', :action => 'rm'
+
+plugin.default_auth('*',false)

0 comments on commit cb354a4

Please sign in to comment.