Reputation: 9646
we have a private chat server running on one of the servers we own. for example: company.server.com
. We connect to this with our chat clients on port 5223
.
How can I get Jabber-bot to connect to this chat? What if I want to connect to a particular room?
Below is what I have but it seems to just hang and do nothing. I believe there should be a property where I should provide the name of the server I'm connecting to but I can't find that property anyplace.
require 'rubygems'
require './jabber/bot'
# Create a public Jabber::Bot
config = {
:jabber_id => '[email protected]',
:password => 'mypassword',
:master => '[email protected]',
:presence => :chat,
}
bot = Jabber::Bot.new(config)
# Give your bot a private command, 'rand'
bot.add_command(
:syntax => 'rand',
:description => 'Produce a random number from 0 to 10',
:regex => /^rand$/
) { rand(10).to_s }
# Bring your new bot to life
bot.connect
Upvotes: 1
Views: 625
Reputation: 929
session = Jabber::Session.bind('account@host/resource', 'password')
Upvotes: 1