From acd1befde66db492149992199fadca92e55cc97b Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Thu, 6 Apr 2023 21:43:29 -0400 Subject: sentry: Add sentry support Change-Id: I3cff2a05c63e88abddc8eff6a3ee9a9f73a5172d --- modules/reactions/reactions.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/reactions') diff --git a/modules/reactions/reactions.cpp b/modules/reactions/reactions.cpp index 6455840..3f698b0 100644 --- a/modules/reactions/reactions.cpp +++ b/modules/reactions/reactions.cpp @@ -4,6 +4,7 @@ #include <142bot/modules.hpp> #include <142bot/util.hpp> #include +#include using std::to_string; class ReactionsModule : public Module { @@ -12,6 +13,9 @@ public: ReactionsModule(Bot* creator, ModuleLoader* ml): Module(creator, ml) { ml->attach({I_OnMessage}, this); + sentry_value_t crumb = sentry_value_new_breadcrumb("default", "Loaded module reactions"); + sentry_add_breadcrumb(crumb); + std::ifstream f("resources/reactions.json"); json reactions = json::parse(f); @@ -28,6 +32,7 @@ public: return "Auto-reactions based on keyword"; } virtual bool OnMessage(const dpp::message_create_t &message, const std::string& clean_message, bool mentioned, const std::vector &stringmentions) { + sentry_set_tag("module", "reactions"); for (auto i = reactionMap.begin(); i != reactionMap.end(); i++) { if (lowercase(clean_message).find(i->first) != std::string::npos) { bot->core->message_add_reaction(message.msg, i->second); -- cgit v1.2.3