firstAttemt

This commit is contained in:
2024-02-24 22:48:35 +03:00
commit f78a4dcf7b
4 changed files with 117 additions and 0 deletions

25
bot.h Normal file
View File

@@ -0,0 +1,25 @@
#pragma once
#include <TgBot/TgBot.h>
#include <filesystem>
#include <vector>
#include <mutex>
#include <future>
class Bot {
public:
Bot(const std::string& token);
void run();
private:
void handleCommand(const TgBot::Message::Ptr& message);
void sendFileList(const TgBot::Message::Ptr& message);
void sendFile(const TgBot::Message::Ptr& message, const std::string& fileName);
void updateCacheAsync();
private:
std::string botToken;
TgBot::Bot bot;
std::vector<std::string> fileCache;
std::mutex cacheMutex;
};