https://github.com/rdbo/simplex-chat-ruby
Ruby API for SimpleX Chat
https://github.com/rdbo/simplex-chat-ruby
Last synced: 4 months ago
JSON representation
Ruby API for SimpleX Chat
- Host: GitHub
- URL: https://github.com/rdbo/simplex-chat-ruby
- Owner: rdbo
- License: agpl-3.0
- Created: 2025-02-22T16:39:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-03-19T19:40:15.000Z (about 1 year ago)
- Last Synced: 2025-11-15T21:10:08.982Z (7 months ago)
- Language: Ruby
- Size: 180 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simplex-chat-ruby
A port for the SimpleX Chat client API for Ruby
## License
This project is licensed under the GNU AGPL-3.0 (no later versions).
Read `LICENSE` for more information.
## Showcase

## Usage
1. Install the Gem from RubyGems
```shell
gem install simplex-chat
```
2. Start your local simplex-chat client on port 5225 (or any port you wish)
```shell
simplex-chat -p 5225
```
3. Connect the `SimpleXChat::ClientAgent` to your local client
```rb
require 'simplex-chat'
require 'net/http'
client = SimpleXChat::ClientAgent.new URI('ws://localhost:5225')
```
4. Now the client is connected and you can start using the APIs
```rb
# Get version
version = client.api_version
puts "SimpleX Chat version: #{version}"
# Listen to incoming client messages
loop do
chat_msg = client.next_chat_message
break if chat_msg == nil
# Reply if user sends '/say_hello'
if chat_msg[:msg_text] == "/say_hello"
client.api_send_text_message chat_msg[:chat_type], chat_msg[:sender], "Hello! This was sent automagically"
end
end
# Much more... Read the examples for more information
```