PHPackages                             paragraf-lex/viber-bot - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. paragraf-lex/viber-bot

ActiveLibrary

paragraf-lex/viber-bot
======================

Viber bot for PHP for Laravel

v0.0.7(7y ago)62.4k↓100%6MITPHPPHP ^7.1.3CI failing

Since Jan 8Pushed 5y ago2 watchersCompare

[ Source](https://github.com/paragraf-lex/viber-bot)[ Packagist](https://packagist.org/packages/paragraf-lex/viber-bot)[ Docs](https://github.com/paragraf-lex/viber-bot)[ RSS](/packages/paragraf-lex-viber-bot/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

Viber Bot
=========

[](#viber-bot)

[![Latest Version](https://camo.githubusercontent.com/69d19cd094fe219ca8fb67acbf68e2658ccf8c33cf9e287a4b971f249ee0a6c8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f70617261677261662d6c65782f76696265722d626f742e7376673f7374796c653d666c61742d737175617265)](https://github.com/paragraf-lex/viber-bot/releases)[![StyleCI](https://camo.githubusercontent.com/9f5a0a7a2daf268052fb3db274c133ebc49ec218ee3400f4ceef548185e2d283/68747470733a2f2f7374796c6563692e696f2f7265706f732f3136343631313933372f736869656c64)](https://styleci.io/repos/164611937)

Installation
------------

[](#installation)

This package can be installed through Composer.

```
composer require paragraf-lex/viber-bot
```

In Laravel 5.5 and above the package will autoregister the service provider. In Laravel 5.4 you must install this service provider.

```
// config/app.php
'providers' => [
    ...
    Paragraf\ViberBot\ViberBotServiceProvider::class,
    ...
];
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Configuration
-------------

[](#configuration)

You need to set in `.env` and setup `webhook`.

#### Env

[](#env)

```
VIBERBOT_API=your_viber_token
VIBERBOT_NAME=name
VIBERBOT_PHOTO=photo
```

You can find Viber token on [Viber Partners](https://partners.viber.com) after creating bot on Info tab.

#### WebHook

[](#webhook)

You must run artisan command for webhoook with url parameter

```
php artisan viber-bot:webhook https://example-url.com/some-route
```

Note: It must be full url and must be HTTPS.

#### Config file

[](#config-file)

Optionally, you can publish the config file of this package with this command:

```
php artisan vendor:publish --provider="Paragraf\ViberBot\ViberBotServiceProvider"
```

The following config file will be published in `config/viberbot.php`

Usage
-----

[](#usage)

When the installation is done you have access to `Bot` and `Client` class.

### Bot class

[](#bot-class)

With bot class you naivgate your ViberBot how to work.

```
(new Bot($request, new TextMessage()))
  ->on(new MessageEvent($request->timestamp, $request->message_token,
  new ViberUser($request->sender['id'],$request->sender['name']), $request->message))
  ->hears("Hi!")
  ->replay("Hello World!")
  ->send();
```

Note: If viber user not set `name` you will get error.

You can change responding type Message and Event who listen that event.

APIAcceptDescription`on(new MessageEvent(...))``Event object`Listen specific Event`hears("Hi!")``string, array, regex`ViberBot listen key word `Hi!`, can be array for more words for one event`body($callback)``callback`ViberBot can do some business logic.`replay("Hello World!")``string, array, Model`ViberBot respond with `Hello World!`, can be array or Model`send()`---Send respond to Viber server.#### List of Events:

[](#list-of-events)

- ConversationStartedEvent
- DeliveredEvent
- FailedEvent
- MessageEvent
- SeenEvent
- SubscribedEvent
- UnsubscribedEvent

Note: If you don't want to listen all events you can change `event_types` in `config/viberbot.php`. If you change you must run again `php artisan viber-bot:webhook your-url` in oreder to apply changes.

#### List of Messages:

[](#list-of-messages)

- TextMessage
- BroadcastMessage
- ContactMessage
- FileMessage
- KeyboardMessage
- LocationMessage
- PictureMessage
- StickerMessage
- URLMessage
- VideoMessage
- WelcomeMessage
- CarouselMessage - ToDo

### Client class

[](#client-class)

Client class, provide to you extra utility.

```
 (new Client())->broadcast('Hello', User::all(), 'viber_id');
```

APIDescription`broadcast($text, $model, $method)`Broadcast message to all subscribed user on Viber Chat, 300 users per request.`getUserDetails($user_id)`Get details for specific user`getOnlineStatus(array $viberIds)`Get online statuses for users, 100 users per request`getAccountInfo()`Get account information (Your Public Account)`removeWebhook()`Remove WebHookNote: `$method` in `broadcast()` must point to viber\_id. Also `getOnlineStatus()` need `viber_ids`.

If you want more information about Viber API or how something works check [Viber REST API](https://developers.viber.com/docs/api/rest-bot-api/)

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Nemanja Ivankovic](https://github.com/necko1996)
- [All Contributors](../../contributors)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

7

Last Release

2641d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23908c5ffeb3df9e1e79a06bcf9bfb179d0882a9cdc4b1ad3e5a07562807b833?d=identicon)[paragraf-lex](/maintainers/paragraf-lex)

---

Top Contributors

[![paragraf-lex](https://avatars.githubusercontent.com/u/46480920?v=4)](https://github.com/paragraf-lex "paragraf-lex (20 commits)")[![Necko1996](https://avatars.githubusercontent.com/u/13519620?v=4)](https://github.com/Necko1996 "Necko1996 (8 commits)")

---

Tags

botlaravellaravel-frameworkphpviberviber-botphplaravelbotviberparagraf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/paragraf-lex-viber-bot/health.svg)

```
[![Health](https://phpackages.com/badges/paragraf-lex-viber-bot/health.svg)](https://phpackages.com/packages/paragraf-lex-viber-bot)
```

###  Alternatives

[octw/aramex

A Library to integrate with Aramex APIs

2925.2k](/packages/octw-aramex)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
