开发者

How can I keep my Jabber bot's status online?

Here is my code开发者_Go百科:

require 'xmpp4r/client'

jid = Jabber::JID::new('some.other@gmail.com/Home')
cl = Jabber::Client::new(jid)
cl.connect
cl.auth('pass')

cl.send(Jabber::Presence.new.set_show(:chat).set_status('my_status'))
#cl.send Jabber::Presence::new

salutation = Jabber::Message::new( 'here.again@gmail.com', '' )
salutation.set_type(:chat).set_id('1')
cl.send salutation

while 1
end

But when I close chat window jabber-bot goes offline. How can I keep it online?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜