File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -306,6 +306,32 @@ to add `message options`_::
306306
307307 $chatter->send($chatMessage);
308308
309+ Updating Telegram Messages
310+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
311+
312+ When working with interactive callback buttons, you can use the
313+ :class: `Symfony\\ Component\\ Notifier\\ Bridge\\ Telegram\\ TelegramOptions ` to reference
314+ a previous message to edit::
315+
316+ use Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\Button\InlineKeyboardButton;
317+ use Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\InlineKeyboardMarkup;
318+ use Symfony\Component\Notifier\Bridge\Telegram\TelegramOptions;
319+ use Symfony\Component\Notifier\Message\ChatMessage;
320+
321+ $chatMessage = new ChatMessage('Are you really sure?');
322+ $telegramOptions = (new TelegramOptions())
323+ ->chatId($chatId)
324+ ->edit($messageId) // extracted from callback payload or SentMessage
325+ ->replyMarkup((new InlineKeyboardMarkup())
326+ ->inlineKeyboard([
327+ (new InlineKeyboardButton('Absolutely'))->callbackData('yes'),
328+ ])
329+ );
330+
331+ .. versionadded :: 6.2
332+
333+ The ``TelegramOptions::edit() `` method was introduced in Symfony 6.2.
334+
309335Adding text to a Microsoft Teams Message
310336----------------------------------------
311337
You can’t perform that action at this time.
0 commit comments