Download the PHP package 3neti/messaging-bot without Composer
On this page you can find all versions of the php package 3neti/messaging-bot. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 3neti/messaging-bot
More information about 3neti/messaging-bot
Files in 3neti/messaging-bot
Package messaging-bot
Short Description Multi-channel messaging bot for PayCode voucher operations (Telegram, WhatsApp, Viber)
License proprietary
Informations about the package messaging-bot
Messaging Bot Package
Multi-channel messaging bot for PayCode voucher operations. Currently supports Telegram, with WhatsApp and Viber planned for future phases.
Features
- Multi-step conversation flows - Stateful conversations for complex operations
- Platform-agnostic core - Normalized DTOs work across all messaging platforms
- Pluggable drivers - Easy to add new messaging platforms
- Admin authorization - Restrict commands to configured admin chat IDs
- Laravel Cache integration - Conversation state persists across messages
Installation
The package is included in the mono-repo. Add it to your host app's composer.json:
Then run:
Configuration
Publish the config file:
Environment Variables
Setting Up Telegram
1. Create a Bot
- Open Telegram and search for
@BotFather - Send
/newbotand follow the prompts - Copy the bot token to
TELEGRAM_BOT_TOKEN
2. Set Webhook
Set your webhook URL (replace with your domain):
Or use the driver directly:
3. Local Development
For local development, use the test command to simulate messages:
Alternatively, use long polling for real Telegram interaction:
Available Commands
Public Commands
| Command | Description |
|---|---|
/start |
Welcome message |
/help |
Show available commands |
/balance |
Check wallet balance (requires linked account) |
/redeem |
Start voucher redemption flow |
/cancel |
Cancel current operation |
Admin Commands
| Command | Description |
|---|---|
/generate |
Generate multiple vouchers |
/disburse |
Quick single-voucher creation |
Deep Links
Telegram deep links allow users to start redemption with a single click:
Format: start=action_param (underscore separator)
Examples:
When a user clicks a deep link:
- Telegram opens and starts the bot
- Bot automatically validates the voucher code
- User sees amount and is prompted to share phone (or confirm if returning user)
Redemption UX Flow
First-Time User (3 steps)
Returning User (2 steps)
Phone number is cached for 30 days after successful redemption:
Architecture
Adding a New Handler
Create a handler extending BaseMessagingHandler:
Register in config:
Adding a New Flow
Create a flow extending BaseFlow:
Webhook Endpoints
| Platform | Endpoint |
|---|---|
| Telegram | POST /messaging/telegram/webhook |
POST /messaging/whatsapp/webhook (planned) |
|
| Viber | POST /messaging/viber/webhook (planned) |
Testing
Unit Tests
Manual Testing
License
Proprietary - All rights reserved.
All versions of messaging-bot with dependencies
illuminate/support Version ^11.0|^12.0
illuminate/http Version ^11.0|^12.0
illuminate/cache Version ^11.0|^12.0
illuminate/routing Version ^11.0|^12.0
spatie/laravel-data Version ^4.0
guzzlehttp/guzzle Version ^7.0
3neti/voucher Version ^0.9