Files
TgBot/bot.h
2024-02-24 22:48:35 +03:00

25 lines
553 B
C++

#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;
};