开发者

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

开发者 https://www.devze.com 2023-03-13 10:53 出处:网络
Here is my code开发者_Go百科: require \'xmpp4r/client\' jid = Jabber::JID::new(\'some.other@gmail.com/Home\')

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

精彩评论

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