TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.22k stars 690 forks source link

Inline_message_id null #1037

Closed mircofx closed 2 years ago

mircofx commented 2 years ago

I create a inline buttons with:

InlineKeyboardMarkup inlineKeyboard = new(
                    new[]
                    {
                        new []
                        {
                            InlineKeyboardButton.WithCallbackData( "ℹ️Information", "information" ),
                            InlineKeyboardButton.WithCallbackData( "🆘Assistance", "assistance" ),
                        },
                    });
return await botClient.SendTextMessageAsync(chatId: message.Chat.Id,
                                                            text: "Select an option",
                                                            replyMarkup: inlineKeyboard);

Once I select one option the UpdateType.CallbackQuery => BotOnCallbackQueryReceived(botClient, update.CallbackQuery!) will get Inline_message_id always null. Why?

NuGet version 17.0 .NET Core 6.0 VS2022 WinForms.

karb0f0s commented 2 years ago

@mircofx inline queries are not related to inline keyboards. for example, @gif bot does inline requests. For Inline keyboard you only can access CallbackQuery properties. take a look at this example

mircofx commented 2 years ago

For example this bot "@music" from the Telegram website. https://core.telegram.org/bots/2-0-intro#updating-messages

Once selected the track it shows 5 Callback buttons that changes when you press them as well as the text above. How can we have the id of the callbackbutton pressed and edit the buttons on the action?

karb0f0s commented 2 years ago

Please follow issue template If you want to chat, feel free to join our group.