diff options
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); }); |