From 5154dabd17c44a1686aaa751c0c2ba61ae3b2413 Mon Sep 17 00:00:00 2001 From: llnulldisk <48621230+llnulldisk@users.noreply.github.com> Date: Sat, 20 Apr 2024 15:29:59 +0200 Subject: Update samples to API 7.0 --- samples/receive-file/src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'samples/receive-file') diff --git a/samples/receive-file/src/main.cpp b/samples/receive-file/src/main.cpp index 7a0e8ff..5972534 100644 --- a/samples/receive-file/src/main.cpp +++ b/samples/receive-file/src/main.cpp @@ -20,12 +20,13 @@ int main() { bot.getEvents().onAnyMessage([&bot](Message::Ptr message) { printf("User wrote %s\n", message->text.c_str()); - File::Ptr file = bot.getApi().getFile(message->document->fileId); - string fileContent = bot.getApi().downloadFile(file->filePath); - if (StringTools::startsWith(message->text, "/start")) { return; } + + File::Ptr file = bot.getApi().getFile(message->document->fileId); + string fileContent = bot.getApi().downloadFile(file->filePath); + bot.getApi().sendMessage(message->chat->id, "Your file content: " + fileContent); }); -- cgit v1.2.3