From 620a9417a054ce77949112360858ab71c839f59d Mon Sep 17 00:00:00 2001 From: Christopher Hertel Date: Sun, 23 Oct 2022 13:38:58 +0200 Subject: [PATCH] add section for editing telegram messages --- notifier/chatters.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/notifier/chatters.rst b/notifier/chatters.rst index 972f89885fe..c8e5c103672 100644 --- a/notifier/chatters.rst +++ b/notifier/chatters.rst @@ -306,6 +306,32 @@ to add `message options`_:: $chatter->send($chatMessage); +Updating Telegram Messages +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When working with interactive callback buttons, you can use the +:class:`Symfony\\Component\\Notifier\\Bridge\\Telegram\\TelegramOptions` to reference +a previous message to edit:: + + use Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\Button\InlineKeyboardButton; + use Symfony\Component\Notifier\Bridge\Telegram\Reply\Markup\InlineKeyboardMarkup; + use Symfony\Component\Notifier\Bridge\Telegram\TelegramOptions; + use Symfony\Component\Notifier\Message\ChatMessage; + + $chatMessage = new ChatMessage('Are you really sure?'); + $telegramOptions = (new TelegramOptions()) + ->chatId($chatId) + ->edit($messageId) // extracted from callback payload or SentMessage + ->replyMarkup((new InlineKeyboardMarkup()) + ->inlineKeyboard([ + (new InlineKeyboardButton('Absolutely'))->callbackData('yes'), + ]) + ); + +.. versionadded:: 6.2 + + The ``TelegramOptions::edit()`` method was introduced in Symfony 6.2. + Adding text to a Microsoft Teams Message ---------------------------------------- pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy