diff options
author | Oleg Morozenkov <m@oleg.rocks> | 2024-06-11 00:42:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 00:42:07 +0300 |
commit | 986a7b5242182614c25404bfef75fb09a762a8c1 (patch) | |
tree | c18de405b668687683ce811fde777394821b6d06 /samples/receive-file/src/main.cpp | |
parent | 0910c166a920cdac931d40bcb63bfb28039005f1 (diff) | |
parent | 283cc4ba4670ed5546f007ec1a85b3fab40e6d6a (diff) |
Merge pull request #300 from llnulldisk/master
Update to Bot API 7.2
Diffstat (limited to 'samples/receive-file/src/main.cpp')
-rw-r--r-- | samples/receive-file/src/main.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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); }); |