summaryrefslogtreecommitdiff
path: root/samples/receive-file
diff options
context:
space:
mode:
authorllnulldisk <48621230+llnulldisk@users.noreply.github.com>2024-04-20 15:29:59 +0200
committerllnulldisk <48621230+llnulldisk@users.noreply.github.com>2024-04-20 15:29:59 +0200
commit5154dabd17c44a1686aaa751c0c2ba61ae3b2413 (patch)
tree9275227ee8791ce3d0b3539dcad7294aeca4cac0 /samples/receive-file
parent261f27b534aecbe23e635dcff42ec34406a73759 (diff)
Update samples to API 7.0
Diffstat (limited to 'samples/receive-file')
-rw-r--r--samples/receive-file/src/main.cpp7
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);
});