first commit
This commit is contained in:
commit
7349b743e3
21 files changed
+1527
No files matched your search
@@ -0,0 +1,37 @@
|
||||
#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();
|
||||
};
|
||||
Reference in new issue
Block a user