How erfanvahabpour/bale-bot-sdk works
Bale Bot PHP SDK provides a typed PHP interface to the Bale Bot API. A bot application selects a configured bot, receives webhook or polling updates, turns them into typed update objects, and can dispatch commands or events before invoking API methods for messaging, chats, media, payments, stickers, and bot commands. Those methods use a shared request/HTTP layer and return typed results. Laravel adds container, facade, configuration, and webhook CLI integration. The graph reflects documented capabilities, but unsampled modules are connected only where the README or excerpts establish the relationship.
Main entry points: Api.php Bot API facade · BotsManager.php Multi-bot manager · BaleClient.php Bale HTTP client · CommandsHandler.php Command handling
Components 28
Bot access
- Multi-bot manager
src/BotsManager.php - Bot API facade
src/Api.php
Update handling
- Update intake
src/Methods/Update.php - Typed update
src/Objects/Update.php - Update events
src/Events - Command handling
src/Traits/CommandsHandler.php - Command bus
src/Commands/CommandBus.php - Command classes
src/Commands/Command.php - Answer helpers
src/Answers/Answerable.php
Bale API operations
- Messages and editing
src/Methods/Message.php - Chat operations
src/Methods/Chat.php - Media and files
src/FileUpload/InputFile.php - In-app payments
src/Methods/Payments.php - Stickers
src/Methods/Stickers.php - Bot command menus
src/Methods/Commands.php - Typed API objects
src/Objects/BaseObject.php
Request transport
- Request construction
src/BaleRequest.php - HTTP operations
src/Traits/Http.php - Bale HTTP client
src/BaleClient.php - HTTP client interface
src/HttpClients/HttpClientInterface.php - Guzzle adapter
src/HttpClients/GuzzleHttpClient.php - Response handling
src/BaleResponse.php
Laravel integration
- Laravel service provider
src/Laravel/BaleServiceProvider.php - Laravel facade
src/Laravel/Facades/Bale.php - Webhook CLI
src/Laravel/Artisan/WebhookCommand.php
Other components
- Bot developer
- Bale Bot API
- Laravel application
Connections 32
- Bot developer → Multi-bot manager: selects bot
README.md - Multi-bot manager → Bot API facade: creates bot
src/BotsManager.php - Bot developer → Bot API facade: calls methods
src/Api.php - Bot API facade → Command handling: uses handler
src/Api.php - Command handling → Update intake: handles updates
- Update intake → Typed update: parses updates
- Bot API facade → Update events: dispatches events
src/Api.php - Command handling → Command bus: dispatches commands
src/Traits/CommandsHandler.php - Command bus → Command classes: resolves commands
src/Commands/CommandBus.php - Command classes → Answer helpers: uses answers
src/Commands/Command.php - Bot API facade → Messages and editing: exposes methods
src/Api.php - Bot API facade → Chat operations: exposes methods
src/Api.php - Bot API facade → In-app payments: exposes methods
src/Api.php - Bot API facade → Stickers: exposes methods
src/Api.php - Bot API facade → Bot command menus: exposes methods
src/Api.php - Messages and editing → Media and files: accepts uploads
src/Methods/Message.php - Messages and editing → Typed API objects: returns objects
src/Methods/Message.php - In-app payments → Typed API objects: returns objects
- Bot API facade → HTTP operations: uses transport
src/Api.php - HTTP operations → Request construction: builds requests
src/Traits/Http.php - HTTP operations → Bale HTTP client: sends requests
src/Traits/Http.php - Bale HTTP client → HTTP client interface: implements
src/BaleClient.php - Bale HTTP client → Guzzle adapter: defaults to
src/BaleClient.php - Bale HTTP client → Response handling: wraps responses
src/BaleClient.php - Request construction → Bale Bot API: requests endpoints
README.md - Laravel application → Laravel service provider: registers package
README.md - Laravel service provider → Multi-bot manager: binds manager
src/Laravel/BaleServiceProvider.php - Laravel application → Laravel facade: calls facade
README.md - Laravel facade → Multi-bot manager: delegates access
src/Laravel/Facades/Bale.php - Laravel application → Webhook CLI: runs command
README.md - Webhook CLI → Multi-bot manager: resolves bot
src/Laravel/Artisan/WebhookCommand.php - Webhook CLI → Bot API facade: configures webhook
src/Laravel/Artisan/WebhookCommand.php