diff options
author | Cara Salter <cara@devcara.com> | 2023-03-30 15:09:52 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2023-03-30 15:09:52 -0400 |
commit | 8233fc4bcffc82907e82b31072cb8129aa200ae5 (patch) | |
tree | bb9551e287fb632cbb3dfb070ffa228351ed4129 /src/main.cpp | |
parent | 527b7ab2df126bb2f480999049ed05b057a6ef83 (diff) | |
download | 142bot-8233fc4bcffc82907e82b31072cb8129aa200ae5.tar.gz 142bot-8233fc4bcffc82907e82b31072cb8129aa200ae5.zip |
reactions module
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index d58f474..8f3ad9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6,6 +6,7 @@ #include <spdlog/async.h> #include <spdlog/sinks/stdout_color_sinks.h> #include <spdlog/sinks/rotating_file_sink.h> +#include <string> using namespace std; @@ -29,7 +30,7 @@ int main(int argc, char const *argv[]) { log = std::make_shared<spdlog::async_logger>("logs", sinks.begin(), sinks.end(), spdlog::thread_pool(), spdlog::async_overflow_policy::block); spdlog::register_logger(log); log->set_pattern("%^%Y-%m-%d %H:%M:%S.%e [%L] [th#%t]%$ : %v"); - log->set_level(spdlog::level::level_enum::debug); + log->set_level(spdlog::level::level_enum::trace); /* Integrate spdlog logger to D++ log events */ bot.on_log([&bot, &log](const dpp::log_t & event) { @@ -59,9 +60,12 @@ int main(int argc, char const *argv[]) { Bot client(0, &bot); + client.set_owner_id(dpp::snowflake(cfg.value("owner", "00000000000"))); + /* Attach events to the Bot class methods */ bot.on_message_create(std::bind(&Bot::onMessage, &client, std::placeholders::_1)); bot.on_ready(std::bind(&Bot::onReady, &client, std::placeholders::_1)); + bot.on_message_reaction_add(std::bind(&Bot::onMessageReactionAdd, &client, std::placeholders::_1)); bot.start(dpp::st_wait); return 0; |