h1. gtalk-bot A very easy tool for creating Google Talk bots h2. It's really easy! h3. Installation sudo gem install gtalk-bot h3. Usage h4. Getting online
require 'gtalk-bot'

bot = GTalk::Bot.new(:email => "bot@gmail.com", :password => 'getbot')
bot.get_online
h4. On invitation
bot.on_invitation do |inviter|
  puts "I have been invited by #{inviter}. Yay!"

  # do something useful

  bot.accept_invitation(inviter)
  bot.message(inviter, "Hello there! Thanks for invitation!")
end
h4. On message
bot.on_message do |from, text|
  puts "I got message from #{from}: '#{text}'"

  # do something useful

  bot.message from, "I heard that!"
end
h4. Going infinite
# Don't be confused with the name of this method.
# We actually keep the current (main) thread alive while letting listener thread to do its job.
# So we have no need to set up an any infinite loop.
Thread.stop
h2. To-do bot.get_online :invisible => true bot.set_status :away GTalk::Account('john.smith@gmail.com').available? bot.contact_list # => Array bot.in_contact_list?('john.smith@gmail.com') Copyright © 2011 Brian Scott, released under the MIT license