所有するサーバーの 1 つでプライベート チャット サーバーを実行しています。例: company.server.com
。ポート上のチャット クライアントでこれに接続します5223
。
Jabber-bot をこのチャットに接続するにはどうすればよいですか? 特定の部屋に接続したい場合はどうすればよいですか?
以下は私が持っているものですが、ハングして何もしないようです。接続しているサーバーの名前を指定する必要があるプロパティがあるはずですが、そのプロパティがどこにも見つかりません。
require 'rubygems'
require './jabber/bot'
# Create a public Jabber::Bot
config = {
:jabber_id => 'name@mycompany.com',
:password => 'mypassword',
:master => 'name@mycompany.com',
: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