Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Driver Twitter

Driver Twitter Laravel Package

botman/driver-twitter

BotMan driver for Twitter that connects PHP chatbots to Twitter Direct Messages. It lets BotMan receive incoming DMs and send replies through the Twitter API, making it easy to add Twitter messaging to an existing BotMan bot using familiar conversation handlers.

Deep Wiki
Context7

BotMan Twitter Driver

Frequently asked questions about Driver Twitter
How do I install the BotMan Twitter driver with Composer?
Install the package with Composer using composer require botman/driver-twitter in your Laravel or PHP project. In Laravel, register the BotMan Twitter service provider if your version does not support package auto-discovery. Then add your Twitter API credentials to the BotMan configuration before handling incoming direct messages.
How do I configure Twitter API credentials for the BotMan Twitter driver?
Create a Twitter developer app with direct message read and write permissions, then copy its consumer key, consumer secret, access token, and access token secret. Store these values in your environment file or BotMan configuration array rather than hard-coding them. The driver uses these credentials to receive incoming DMs and send replies through the Twitter API.
Can I receive and reply to Twitter Direct Messages with BotMan in Laravel?
Yes, the driver bridges Twitter Direct Messages with BotMan's conversation system, so incoming DMs are passed to your registered conversation handlers. Your bot can then reply through the Twitter API using the same BotMan reply methods you use for other channels. This makes it suitable for automated customer support and direct message responses.
Which Laravel versions are supported by botman/driver-twitter?
Support depends on the BotMan core version required by this driver, so check the package's composer.json constraints before installing. It generally fits Laravel applications that already run a compatible BotMan 2.x installation, including versions with package auto-discovery. For older Laravel releases, confirm compatibility and register the service provider manually if needed.
Do I need a Twitter developer account and elevated access to use this driver?
Yes, you need a Twitter developer account and an app configured for direct message access before the driver can receive or send DMs. Depending on your app and use case, you may also need elevated access or specific API permissions. Review Twitter's current developer access rules because requirements change over time.
How can I test BotMan Twitter replies without calling the real Twitter API?
Unit test your conversation classes and message handlers separately from the live Twitter API by mocking the HTTP client or using BotMan's testing helpers. Keep API credentials out of test environments and use fake incoming message payloads to verify your bot's replies. This lets you validate conversation logic without sending real direct messages.
Why is my BotMan Twitter driver not receiving direct messages?
Check that your Twitter app has direct message permissions and that the access tokens belong to the correct account. Confirm that incoming message delivery, such as webhook or polling setup, is configured and that your bot is actually listening for the Twitter driver. Invalid or expired credentials and missing account activity subscriptions are common causes of silent failures.
How is the Twitter driver different from BotMan's Facebook or Telegram drivers?
The Twitter driver follows the same BotMan driver interface but maps messages to Twitter Direct Message payloads and API limits. Twitter DMs are more text-focused than some other channels, so features like rich buttons or carousels may not be available in the same way. Your conversation handlers can stay largely the same while channel-specific formatting is handled by the driver.
Is botman/driver-twitter still maintained, and what alternatives exist?
Maintenance activity should be checked on Packagist and the repository before committing to it, since BotMan drivers and Twitter API policies evolve separately. Alternatives include building a custom BotMan driver for the current Twitter API or using a dedicated Twitter API client alongside your own messaging layer. For multi-channel bots, keep channel-specific integrations isolated so they can be swapped later.
Can I build automated customer support flows in Twitter DMs using BotMan conversations?
Yes, you can use BotMan's hears patterns, conversations, and reply methods to build automated support flows over Twitter Direct Messages. Keep replies helpful and avoid spammy behavior, and respect Twitter's automation rules and rate limits. For production use, log conversations and handle API errors gracefully so failed DMs do not break your support workflow.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource