mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-10-26 09:55:14 +00:00
중간저장(다시 큐 방식으로 돌아가되, 실시간 스트리밍 방식으로 비동기 처리를 구현할 것임)
This commit is contained in:
36
src/BumbleBee.cpp
Normal file
36
src/BumbleBee.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <BumbleBee.hpp>
|
||||
|
||||
namespace bumbleBee{
|
||||
BumbleBee::BumbleBee(nlohmann::json settings) {
|
||||
this->cluster = std::make_unique<dpp::cluster>(settings["token"]);
|
||||
dbDriver = sql::mariadb::get_driver_instance();
|
||||
this->dbURL = std::make_shared<sql::SQLString>(settings["dbURL"]);
|
||||
sql::Properties pro({
|
||||
{"user", std::string(settings["user"])},
|
||||
{"password", std::string(settings["password"])}
|
||||
});
|
||||
this->dbProperties = std::make_shared<sql::Properties>(pro);
|
||||
|
||||
cluster->on_log(dpp::utility::cout_logger());
|
||||
cluster->on_slashcommand([this](const dpp::slashcommand_t& event){on_slashcommand(event);});
|
||||
cluster->on_ready([this](const dpp::ready_t &event){on_ready(event);});
|
||||
}
|
||||
|
||||
BumbleBee::~BumbleBee() {
|
||||
}
|
||||
|
||||
void BumbleBee::start() { this->cluster->start(dpp::st_wait); }
|
||||
|
||||
bool BumbleBee::addCommand(commands::ICommand cmd) {
|
||||
commands.push_back(cmd);
|
||||
return false;
|
||||
}
|
||||
|
||||
void BumbleBee::on_slashcommand(const dpp::slashcommand_t &event) {
|
||||
|
||||
}
|
||||
void BumbleBee::on_ready(const dpp::ready_t &event) {
|
||||
cluster->log(dpp::loglevel::ll_info, "Bot ready.");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user