Project

xrc

0.01
No commit activity in last 3 years
No release in over 3 years
There's a lot of open issues
XMPP Ruby Client.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
>= 0
>= 0
= 2.14.1

Runtime

 Project Readme

Xrc

XMPP Ruby Client.

Usage

# Loads all classes & modules defined in this library.
require "xrc"

# Constructs a new Client class to connect to a XMPP server.
client = Xrc::Client.new(
  jid: "foo@example.com",      # required
  nickname: "bot"              # optional
  password: "xxx",             # optional
  hosts: [ "example.com" ],    # optional, automatically determined from JID in absence
  port: 5222,                  # optional, default: 5222
  room_jid: "bar@example.com", # optional, you can pass comma-separated multi room JIDs
)

# Responds to "ping" and returns "pong".
client.on_private_message do |message|
  if message.body == "ping"
    client.reply(body: "pong", to: message)
  end
end

# Responds to "Thank you" and returns "You're welcome".
client.on_room_message do |message|
  if message.body == "Thank you"
    client.reply(body: "You're welcome", to: message)
  end
end

# Connects to a XMPP server and waits for new messages.
client.connect