BotDelive

BotDelive is a Push Notification and 2-factor authentication API service that works over the chat bots (Telegram and Messenger).


Installation

Add this line to your application's Gemfile:

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"

require 'bot_delive'

BotDelive.configure do |config|
  config.app_id = 'test_id'
  config.secret_key = 'test_secret'
end

Verify the "Access Code":

@response = BotDelive.verify(access_code: 'ByffboUAX')
if @response.success?
    @response.payload.user_id
end

Send 2-factor authentication request (long polling):

@response = BotDelive.auth(user_id: 'user-id')
if @response.success?
    @response.payload.respond
end

Send Push Notification request:

@response = BotDelive.push(
    user_id: 'UjplD0x56P4E-Y_XsZRFM3TPivpSLWB-rqy5Y0Xv',
    message: 'test message from ruby test'
)

if @response.success?
    puts "push notification sent successfully"
end

Documentation

Complete documentation available at: https://botdelive.com/docs

License

The gem is available as open source under the terms of the MIT License.