Download the PHP package paragraf-lex/viber-bot without Composer

On this page you can find all versions of the php package paragraf-lex/viber-bot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package viber-bot

Viber Bot

Latest Version StyleCI

Installation

This package can be installed through Composer.

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

Changelog

Please see CHANGELOG for more information what has changed recently.

Configuration

You need to set in .env and setup webhook.

Env

You can find Viber token on Viber Partners after creating bot on Info tab.

WebHook

You must run artisan command for webhoook with url parameter

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

Config file

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

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

Usage

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

Bot class

With bot class you naivgate your ViberBot how to work.

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

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

API Accept Description
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 Messages:

Client class

Client class, provide to you extra utility.

API Description
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 WebHook

Note: $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

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits


All versions of viber-bot with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
ext-json Version *
php-curl-class/php-curl-class Version ^8.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package paragraf-lex/viber-bot contains the following files

Loading the files please wait ....