-
Notifications
You must be signed in to change notification settings - Fork 675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to get messages that is not command #45
Comments
You mean to say, You want to handle normal messages that don't start with a slash? Like a simple text message You can normally do that and don't need to create a command class. |
@irazasyed I have a route like this:
Now I want to get user feedback directly, I don't want to add another route and... Is it possible? |
Yes, That's possible! The command handler function returns update object, So if it's not a command and simply a message. It'll return the update object which you can then use it and process accordingly. Example: Route::post('/<token>/webhook', function () {
$update = Telegram::commandsHandler(true);
$message = $update->getMessage();
$chatId = $message->getChat()->getId();
Telegram::sendMessage($chatId, 'Hello World');
return 'ok';
}); |
Good. |
How to get messages that is not command in command mode?!
@irazasyed
The text was updated successfully, but these errors were encountered: