aboutsummaryrefslogtreecommitdiff
path: root/modules/reactions
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2023-04-06 21:43:29 -0400
committerCara Salter <cara@devcara.com>2023-04-06 21:43:29 -0400
commitacd1befde66db492149992199fadca92e55cc97b (patch)
tree16251d96cd8efd5323fa8f095bb29f110030f387 /modules/reactions
parent555810bedc0cf9d9d954f56b5a2c8c92522ad27f (diff)
download142bot-acd1befde66db492149992199fadca92e55cc97b.tar.gz
142bot-acd1befde66db492149992199fadca92e55cc97b.zip
sentry: Add sentry support
Change-Id: I3cff2a05c63e88abddc8eff6a3ee9a9f73a5172d
Diffstat (limited to 'modules/reactions')
-rw-r--r--modules/reactions/reactions.cpp5
1 files changed, 5 insertions, 0 deletions
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 <fmt/format.h>
+#include <sentry.h>
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<std::string> &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);