Download the PHP package balfour/whatsapp-client without Composer

On this page you can find all versions of the php package balfour/whatsapp-client. 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 whatsapp-client

whatsapp-client

A library for handling WhatsApp communication via the unofficial chat-api.com WhatsApp API.

This library is in early release and is pending unit tests.

Legal Notice

This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by WhatsApp or any of its affiliates or subsidiaries. This is an independent and unofficial API written for educational purposes only and should be used at your own risk.

Table of Contents

Installation

Usage

For further documentation on chat-api, please see https://chat-api.com/en/swagger.html

Creating a Client

Sending a Message

Sending a File

Retrieving Messages

Rebooting the VM

Building a Bot

A full usage example connecting triggers, actions & middleware is available below.

Actions

An action is a response which is executed when a trigger or menu option is matched.

The packages comes bundled with the following actions:

SendMessageAction

This action responds with a message.

SendFileAction

This action responds with a file (or image) attached.

SendMenuAction

see menus

EscapeMenuAction

see menus

SendAndActivateMenuAction

see menus

Custom

You can build your own actions by creatin a custom class which implements the ActionInterface.

Here is an example action which repeats the inbound message.

Triggers

A trigger is an inbound keyword or phrase which executes an action.

The following triggers are supported:

StringTrigger

The inbound message must be an exact match.

StartsWithTrigger

The inbound message must start with the specified string.

RegexTrigger

The inbound message must match the given regex pattern.

Menus

Single Menu

This is an example of a single menu.

The menu must be activated using a trigger. (see full example at end)

Nested Menus

This is a more complicated example with multiple nested menus.

In order to keep state of which menu the user is currently in, we must use an implemntation of a MenuStateStoreInterface. For testing purposes, this package comes bundled with a InMemoryMenuStateStore; however in the real world, you'll likely want to use a store which persists across multiple php processes, such as a redis cache.

Middleware

The bot uses middleware to match the inbound message to a trigger or a menu option. These are called ProcessTrigger and ProcessMenuOption respectively.

You can also write your own middleware by creating a class which implements the MiddlewareInterface.

Full Example

This example is copied from the emulate.php script and can be run locally using php emulate.php.

Emulator

The package includes an emulator script which allows you to test your menu options and triggers without sending real world messages.

You can run the emulator using php emulate.php


All versions of whatsapp-client with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3.0
guzzlehttp/guzzle Version ^6.3
nesbot/carbon Version ^2.0
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 balfour/whatsapp-client contains the following files

Loading the files please wait ....