TelegramBots / Telegram.Bot

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

Disable InlineQueryResult caching in Should_Delete_Message_From_InlineQuery #669

Closed karb0f0s closed 6 years ago

karb0f0s commented 6 years ago

https://github.com/TelegramBots/Telegram.Bot/blob/16facadc1c27eaf23ffe8edcdb80382ea037648e/test/Telegram.Bot.Tests.Integ/Update%20Messages/DeleteMessageTests.cs#L52-L61 Add cacheTime: 0 to AnswerInlineQueryAsync call to avoid result caching

await BotClient.AnswerInlineQueryAsync(
    inlineQueryId: queryUpdate.InlineQuery.Id,
    cacheTime: 0,  // <==
    results: new[]
    {
        new InlineQueryResultArticle(
            id: "article-to-delete",
            title: "Telegram Bot API",
            inputMessageContent: new InputTextMessageContent("https://www.telegram.org/")
        )
    }
);
poulad commented 6 years ago

@karb0f0s Yes. It's better to have it even though that isn't an issue now. Feel free to make a PR.

karb0f0s commented 6 years ago

done https://github.com/TelegramBots/Telegram.Bot/commit/4f88277c4c8f1bff04bfd3fdebd6f3e87e46ce99