https://github.com/0x2c6/botdelive-ruby
A Ruby gem of BotDelive API
https://github.com/0x2c6/botdelive-ruby
api bot botdelive botdelive-ruby chatbox gem
Last synced: 12 months ago
JSON representation
A Ruby gem of BotDelive API
- Host: GitHub
- URL: https://github.com/0x2c6/botdelive-ruby
- Owner: 0x2C6
- License: mit
- Created: 2018-11-24T10:55:53.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-24T21:29:23.000Z (over 7 years ago)
- Last Synced: 2025-07-01T05:04:13.545Z (about 1 year ago)
- Topics: api, bot, botdelive, botdelive-ruby, chatbox, gem
- Language: Ruby
- Homepage: https://rubygems.org/gems/bot_delive
- Size: 12.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# BotDelive
**BotDelive** is a Push Notification and 2-factor authentication API service that works over the chat bots (Telegram and Messenger).
-------------
Requirements
-------------
1. [Create an account](https://botdelive.com/login).
2. Create an app on the dashboard to get appId and secretKey credentials.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'bot_delive'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install bot_delive
## Usage
Let's require the gem first. Don't forget to define "app_id" and "secret_key"
```ruby
require 'bot_delive'
BotDelive.configure do |config|
config.app_id = 'test_id'
config.secret_key = 'test_secret'
end
```
**Verify the "Access Code":**
```ruby
@response = BotDelive.verify(access_code: 'access-code')
if @response.success?
@response.payload.user_id
end
```
**Send 2-factor authentication request (long polling):**
```ruby
@response = BotDelive.auth(user_id: 'user-id')
if @response.success?
@response.payload.respond
end
```
**Send Push Notification request:**
```ruby
@response = BotDelive.push(
user_id: 'user-id',
message: 'test message from ruby test'
)
if @response.success?
puts "push notification sent successfully"
end
```
Documentation
-------------
Complete documentation available at: [https://botdelive.com/docs](https://botdelive.com/docs)
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).