Skip to content

[Notifier] Updated chatter documentation with Telegram::answerCallbackQuery #17514

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions notifier/chatters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,28 @@ a previous message to edit::
])
);

Answering Callback Queries in Telegram
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 6.3

The ``TelegramOptions::answerCallbackQuery()`` method was introduced in Symfony 6.3.

When sending message with inline keyboard buttons with callback data, you can use
:class:`Symfony\\Component\\Notifier\\Bridge\\Telegram\\TelegramOptions` to `answer callback queries`_::

use Symfony\Component\Notifier\Bridge\Telegram\TelegramOptions;
use Symfony\Component\Notifier\Message\ChatMessage;

$chatMessage = new ChatMessage('Thank you!');
$telegramOptions = (new TelegramOptions())
->chatId($chatId)
->answerCallbackQuery(
callbackQueryId: '12345', // extracted from callback
showAlert: true,
cacheTime: 1,
);

Adding text to a Microsoft Teams Message
----------------------------------------

Expand Down Expand Up @@ -424,3 +446,4 @@ The result will be something like:
.. _`Embed elements`: https://discord.com/developers/docs/resources/webhook
.. _`message options`: https://core.telegram.org/bots/api
.. _`MessageCard options`: https://docs.microsoft.com/en-us/outlook/actionable-messages/message-card-reference
.. _`answer callback queries`: https://core.telegram.org/bots/api#answercallbackquery