New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

polyskalov/botman-viber-driver

Viber driver for BotMan
1,516 6

Larablocks Analysis

polyskalov/botman-viber-driver works with Laravel 6 to 13 (latest release v1.1, Jun 14, 2020).

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Works with Laravel 13, the current version
  • No release in the last 12 months (last: Jun 14, 2020)
  • 16 downloads a month (needs 10,000)
  • 6 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jun 14, 2020.
  • No releases in the last 12 months.
  • First released: Jan 17, 2020.
  • Monthly downloads: 16.
  • 5 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 4, 2026.

Install
composer require polyskalov/botman-viber-driver
Latest Version:v1.1
PHP:>=7.1
Laravel:6 – 13
License:MIT
Last Updated:Oct 23, 2020
Links: GitHub  ·  Packagist
Maintainer: polyskalov

BotMan Viber Driver

Connect Viber with BotMan

Latest Version on Packagist

Installation & Setup

First you need to pull in the Viber Driver.

composer require polyskalov/botman-viber-driver

Then load the driver before creating the BotMan instance (only when you don't use BotMan Studio):

DriverManager::loadDriver(\TheArdent\Drivers\Viber\ViberDriver::class);

// Create BotMan instance
BotManFactory::create($config);

This driver requires a valid and secure URL in order to set up webhooks and receive events and information from the chat users. This means your application should be accessible through an HTTPS URL.

To connect BotMan with your Viber Bot, you first need to follow the official guide to create your Viber Bot and an access token.

Once you have obtained the access token, place it in your .env file like VIBER_TOKEN=YOUR-VIBER-TOKEN-HERE. There it gets automatically loaded to your config/botman/viber.php file.

If you don't use BotMan Studio, add these line to $config array that you pass when you create the object from BotManFactory.

'viber' => [
    'token' => 'YOUR-VIBER-TOKEN-HERE',
]

Register Your Webhook

To let your Viber Bot know, how it can communicate with your BotMan bot, you have to register the URL where BotMan is running at, with Viber.

You can do this by sending a POST request to this URL:

https://chatapi.viber.com/pa/set_webhook

This POST request needs parameter called url with the URL that points to your BotMan logic / controller. If you use BotMan Studio it will be: https://yourapp.domain/botman. HTTPS is a must, because of security reasons.

{
   "url":"https://my.host.com",
   "event_types":[
      "delivered",
      "seen",
      "failed",
      "subscribed",
      "unsubscribed",
      "conversation_started"
   ],
   "send_name": true,
   "send_photo": true
}

You can read about other fields in the request in the official documentation.

Instead of manually sending the request to Viber you can use a console command to register your Webhook.

php artisan botman:viber:register

Example

<?php

/** @var \BotMan\BotMan\BotMan $botman */
$botman = resolve('botman');

$botman->on(
    'conversation_started',
    static function (array $payload, BotMan $bot) {
        $bot->reply('Hi, ' . $bot->getUser()->getUsername());
    }
);

$botman->hears('hi', static function (BotMan $bot) {
    $bot->reply('👋');
});

$botman->fallback(static function (BotMan $bot) {
    $bot->reply('I do not understand');
});

$botman->listen();

Alternatives to polyskalov/botman-viber-driver

botman/botman

Create messaging bots in PHP with ease.

1,755,879 6,148
boyo/viberbot

Laravel package for Viber bot creation

5,436 1

Version History

Version Released PHP License
v1.1 >=7.1 MIT
v1.0 >=7.0 MIT