firstAttemt
This commit is contained in:
25
bot.h
Normal file
25
bot.h
Normal 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;
|
||||
};
|
||||
Reference in New Issue
Block a user