diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/142bot/bot.hpp | 4 | ||||
-rw-r--r-- | include/142bot/modules.hpp | 6 |
2 files changed, 9 insertions, 1 deletions
diff --git a/include/142bot/bot.hpp b/include/142bot/bot.hpp index 98a7ed6..342f32e 100644 --- a/include/142bot/bot.hpp +++ b/include/142bot/bot.hpp @@ -2,6 +2,7 @@ #include <dpp/user.h> #include <dpp/dpp.h> #include <pqxx/pqxx> +#include <nlohmann/json.hpp> #ifndef BOT_HPP @@ -17,10 +18,11 @@ public: char prefix; pqxx::connection conn; class dpp::cluster * core; + json cfg; /* The bot's user from the ready event */ dpp::user user; - Bot(bool development, dpp::cluster* cluster, char prefix); + Bot(bool development, dpp::cluster* cluster, char prefix, json &cfg); //virtual ~Bot(); void set_owner_id(dpp::snowflake id); diff --git a/include/142bot/modules.hpp b/include/142bot/modules.hpp index c0aad32..0d48a56 100644 --- a/include/142bot/modules.hpp +++ b/include/142bot/modules.hpp @@ -54,6 +54,7 @@ enum Events I_OnVoiceStateUpdate, I_OnVoiceServerUpdate, I_OnWebhooksUpdate, + I_OnCommand, I_END }; @@ -72,13 +73,16 @@ enum Events } \ for (auto _i = list_to_call.begin(); _i != list_to_call.end(); ++_i) \ { \ + core->log(dpp::ll_debug, fmt::format("Attempting to call module")); \ try \ { \ if (!(*_i)->x) { \ list_to_call = loader->EventHandlers[y]; \ + core->log(dpp::ll_error, "Something happened!"); \ break; \ } \ sentry_remove_tag("module"); \ + core->log(dpp::ll_debug, "called module 1"); \ } \ catch (std::exception& modexcept) \ { \ @@ -89,6 +93,7 @@ enum Events sentry_event_add_exception(event, exc); \ sentry_capture_event(event); \ } \ + core->log(dpp::ll_debug, "Called module"); \ } \ }; @@ -196,6 +201,7 @@ public: virtual bool OnVoiceStateUpdate(const dpp::voice_state_update_t &obj); virtual bool OnVoiceServerUpdate(const dpp::voice_server_update_t &obj); virtual bool OnWebhooksUpdate(const dpp::webhooks_update_t &obj); + virtual bool OnCommand(const dpp::message_create_t &message, const std::string &command, const std::vector<std::string>& params); void EmbedSimple(const std::string &message, int64_t channelID); }; |