Skip to content

Commit b59499e

Browse files
committed
feature #17514 [Notifier] Updated chatter documentation with Telegram::answerCallbackQuery (alexsoft)
This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [Notifier] Updated chatter documentation with `Telegram::answerCallbackQuery` Adding documentation for the new feature of Telegram notifier: answer callback query. Fixes #17501 Commits ------- c22c47b [Notifier] Updated chatter documentation with `Telegram::answerCallbackQuery`
2 parents 3786125 + c22c47b commit b59499e

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

notifier/chatters.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,28 @@ a previous message to edit::
332332
])
333333
);
334334

335+
Answering Callback Queries in Telegram
336+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
337+
338+
.. versionadded:: 6.3
339+
340+
The ``TelegramOptions::answerCallbackQuery()`` method was introduced in Symfony 6.3.
341+
342+
When sending message with inline keyboard buttons with callback data, you can use
343+
:class:`Symfony\\Component\\Notifier\\Bridge\\Telegram\\TelegramOptions` to `answer callback queries`_::
344+
345+
use Symfony\Component\Notifier\Bridge\Telegram\TelegramOptions;
346+
use Symfony\Component\Notifier\Message\ChatMessage;
347+
348+
$chatMessage = new ChatMessage('Thank you!');
349+
$telegramOptions = (new TelegramOptions())
350+
->chatId($chatId)
351+
->answerCallbackQuery(
352+
callbackQueryId: '12345', // extracted from callback
353+
showAlert: true,
354+
cacheTime: 1,
355+
);
356+
335357
Adding text to a Microsoft Teams Message
336358
----------------------------------------
337359

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

0 commit comments

Comments
 (0)