<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>.gitignore</filename>
    </added>
    <added>
      <filename>config.example.yml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,7 @@
+- provide a way for plugins to buffer themselves, so they don't run too many times
+
+- buffer the &quot;speak&quot; calls so that they can be uniq'ed before printed to the channel?
+
 - plugins should be able to register respond_to blocks with a notion of priority.
   eg. a low-priority command can say it doesn't need to be processed if something else matches.
   conversely, a high-priority command can cause to bot to stop processing the message once it has matched.
\ No newline at end of file</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,6 @@
 #!/usr/bin/env ruby
 
+# External Libs
 require 'rubygems'
 require 'tinder'
 require 'icalendar'
@@ -8,6 +9,9 @@ require 'uri'
 require 'activesupport'
 require 'yaml'
 
+# Local Libs
+require 'plugin'
+
 class Bot
   # this is necessary so the room and campfire objects can be accessed by plugins.
   include Singleton
@@ -31,8 +35,8 @@ class Bot
     catch(:stop_listening) do
       trap('INT') { throw :stop_listening }
       loop do
-        ping
-        @room.messages.each {|msg| handle_message(msg) }
+        @room.ping
+        @room.listen.each {|msg| handle_message(msg) }
         sleep interval
       end
     end
@@ -41,16 +45,21 @@ class Bot
   private
   
   def handle_message(msg)
+    puts
+    puts msg
+    
     # Look for commands
-    if m[:message][0..0] == '!'
+    if msg[:message][0..0] == '!'
       Plugin.registered_commands.each do |handler|
-        handler[1].call(msg) if handler[0] == m[:message].gsub(/^!/, '').split(' ').first
+        puts &quot;MATCHED COMMAND: #{msg.inspect}&quot;
+        handler[1].call(msg) if handler[0] == msg[:message].gsub(/^!/, '').split(' ').first
       end
     end
     
     # Look for speakers
     Plugin.registered_speakers.each do |handler|
-      handler[1].call(msg) if handler[0] == m[:person]
+      puts &quot;MATCHED SPEAKER: #{msg.inspect}&quot;
+      handler[1].call(msg) if handler[0] == msg[:person]
     end
   end
 end</diff>
      <filename>bot.rb</filename>
    </modified>
    <modified>
      <diff>@@ -28,12 +28,16 @@ class Plugin
     private :new
   end
 
+  # Building plugins
+
   def self.define(name, &amp;block)
     plugin = new
     plugin.instance_eval(&amp;block)
     Plugin.registered_plugins[name] = plugin
   end
   
+  # Event handlers
+  
   def respond_to_command(command, &amp;block)
     Plugin.registered_commands &lt;&lt; [command, block]
   end
@@ -57,8 +61,13 @@ class Plugin
   end
 
   # Shortcuts to access the room
-  def speak
-    Bot.instance.room.speak
+  
+  def speak(words)
+    Bot.instance.room.speak(words)
+  end
+  
+  def paste(words)
+    Bot.instance.room.paste(words)
   end
   
   extend PluginSugar</diff>
      <filename>plugin.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,21 @@
 Plugin.define 'fun' do
   author 'Tim R.'
   version '1.0.0'
+        
+  respond_to_command('test') do |m|
+    speak(@test)
+  end
   
   respond_to_command('say') do |m|
     speak(m[:message].gsub(/^!\w+/, ''))
   end
   
+  # @last_agreed = 20.minutes.ago
+  
   respond_to_speaker('Tim R.') do |m|
-    speak('I agree with Tim.')
+    @last_agreed ||= 20.minutes.ago
+    puts &quot;AGREED AT #{@last_agreed.inspect}&quot;
+    speak('I agree with Tim.') unless @last_agreed &gt; 15.minutes.ago
+    @last_agreed ||= Time.now
   end
 end
\ No newline at end of file</diff>
      <filename>plugins/fun.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2e04c257a60f108ea504ec3046292352d734df49</id>
    </parent>
  </parents>
  <author>
    <name>Tim Riley</name>
    <email>tim@openmonkey.com</email>
  </author>
  <url>http://github.com/timriley/campfire-bot/commit/254d6d841e1f94634a3a01eab962b7ec725ef5b2</url>
  <id>254d6d841e1f94634a3a01eab962b7ec725ef5b2</id>
  <committed-date>2008-07-21T07:16:55-07:00</committed-date>
  <authored-date>2008-07-21T07:16:55-07:00</authored-date>
  <message>some more testing and prep the repo for github upload</message>
  <tree>7635358b83c1b8f280309a86b4f976620063cb4d</tree>
  <committer>
    <name>Tim Riley</name>
    <email>tim@openmonkey.com</email>
  </committer>
</commit>
