Skip to content

igorsilva3/bot-whatsapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bot logo

igorsilva3/bot-whatsapp

Status License


🤖 Ele envia mensagens de texto e arquivos para um contato no seu whatsapp.

📝 Table of Contents

🎈 Usage

To use the bot, use the classes:

BotMessageText and BotMessageFile64.

Examples

use Bots\BotMessageText;
use Bots\BotMessageFile64;
use Bots\FileMimeTypes;

// Instance of BotMessageText
$botMessageText = new BotMessageText('YOUR_SESSION_NAME', 'PHONE_NUMBER');

$botMessageText->send(['message' => 'YOUR_MESSAGE']);

// Instance of BotMessageFile64
$botMessageFile64 = new BotMessageFile64('YOUR_SESSION_NAME', 'PHONE_NUMBER', FileMimeTypes::PDF);

$botMessageFile64->send([
  'fileName' => 'YOUR_FILE_NAME',
  'caption' => 'YOUR_CAPTION',
  'path' => 'YOUR_FILE_PATH',
]);

🏁 Getting Started

Clone this repository:

git clone https://github.com/igorsilva3/bot-whatsapp

Prerequisites

For execute the project, you need to have installed in your machine:

  • PHP 8
  • Composer

And you need to get your api token in: Documentation

Edit your configurations in the file config/config.php:

define('API_KEY', 'YOUR_API_KEY');
define('SESSION_KEY', 'YOUR_API_KEY');
define('SESSION_NAME', 'YOUR_SESSION_NAME');
define('PHONE_NUMBER', 'YOUR_CONTACT_TO_MESSAGE');

Observation: API_KEY and SESSION_KEY are equals.

Start a session in: Start session

Installing

cd bot-whatsapp/

Installing dependencies of the project:

composer install

Running tests

To run the tests, type:

composer pest

For more informations about the tests, acess: Pest

⛏️ Built Using

✍️ Authors

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages