38 lines
1.3 KiB
C++
38 lines
1.3 KiB
C++
#pragma once
|
|
#include <string>
|
|
#include "Config.hpp"
|
|
#include "State.hpp"
|
|
#include "SniperEngine.hpp"
|
|
|
|
// This is the whole point of the C++ rewrite request: instead of a Flask web
|
|
// dashboard you had to open in a browser, the sniper is now controlled
|
|
// entirely from Discord with slash commands:
|
|
//
|
|
// /start start watching all configured links
|
|
// /stop stop watching
|
|
// /status running state + per-link stock + totals
|
|
// /links list configured links (with pause state)
|
|
// /addlink url [label] [min_price] [max_price] [keywords]
|
|
// /removelink url
|
|
// /pause url toggle pause for one link
|
|
// /scan url force an immediate one-off scan
|
|
// /interval seconds change the polling interval
|
|
// /history last 15 scan results
|
|
//
|
|
// Uses D++ (https://dpp.dev/) for the gateway connection + slash commands.
|
|
class DiscordBot {
|
|
public:
|
|
DiscordBot(AppConfig& config, SniperState& state, SniperEngine& engine, std::string config_path);
|
|
|
|
// Blocks forever running the gateway event loop.
|
|
void run();
|
|
|
|
private:
|
|
AppConfig& config_;
|
|
SniperState& state_;
|
|
SniperEngine& engine_;
|
|
std::string config_path_;
|
|
|
|
void persist();
|
|
};
|