aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2023-04-07 10:19:10 -0400
committerCara Salter <cara@devcara.com>2023-04-07 10:19:10 -0400
commitc08cc6cbc9b041cacc78483df5f3062019471934 (patch)
tree13bd920d469e862fd8d217415efb043fe4a27cce
parent2440f9b9f8aa93398e57e392506dc1c68ab8eed9 (diff)
download142bot-c08cc6cbc9b041cacc78483df5f3062019471934.tar.gz
142bot-c08cc6cbc9b041cacc78483df5f3062019471934.zip
meta: Add sentry support
Change-Id: Icda968ab189d601c5e390dfee094ae4419cce9e6
-rw-r--r--include/142bot/bot.hpp3
-rw-r--r--modules/spotify/spotify.cpp4
-rw-r--r--src/bot.cpp2
-rw-r--r--src/main.cpp4
4 files changed, 9 insertions, 4 deletions
diff --git a/include/142bot/bot.hpp b/include/142bot/bot.hpp
index 165515f..98a7ed6 100644
--- a/include/142bot/bot.hpp
+++ b/include/142bot/bot.hpp
@@ -14,12 +14,13 @@ class Bot {
private:
bool run_database_migrations();
public:
+ char prefix;
pqxx::connection conn;
class dpp::cluster * core;
/* The bot's user from the ready event */
dpp::user user;
- Bot(bool development, dpp::cluster* cluster);
+ Bot(bool development, dpp::cluster* cluster, char prefix);
//virtual ~Bot();
void set_owner_id(dpp::snowflake id);
diff --git a/modules/spotify/spotify.cpp b/modules/spotify/spotify.cpp
index aca0f85..89c7b88 100644
--- a/modules/spotify/spotify.cpp
+++ b/modules/spotify/spotify.cpp
@@ -56,6 +56,10 @@ public:
if (matchcount > 0) {
// We found a spotify URL!
EmbedSimple("Found a spotify URL", message.msg.channel_id);
+ } else {
+ if (clean_message.starts_with(bot->prefix)) {
+
+ }
}
return true;
diff --git a/src/bot.cpp b/src/bot.cpp
index d0f6377..ed1531d 100644
--- a/src/bot.cpp
+++ b/src/bot.cpp
@@ -15,7 +15,7 @@
namespace fs = std::filesystem;
-Bot::Bot(bool devel, dpp::cluster* cluster) {
+Bot::Bot(bool devel, dpp::cluster* cluster, char prefix) {
dev = devel;
this->core = cluster;
diff --git a/src/main.cpp b/src/main.cpp
index db79289..08574d1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -25,7 +25,7 @@ int main(int argc, char const *argv[]) {
json cfg = json::parse(f);
string token = cfg.value("token", "bad-token");
sentry_options_t *options = sentry_options_new();
- sentry_options_set_dsn(options, "https://26f71a6064ee478c8d944b976b89eb3c@o4504969688317952.ingest.sentry.io/4504969689563136");
+ sentry_options_set_dsn(options, cfg.value("sentry_dsn", "").c_str());
// This is also the default-path. For further information and recommendations:
// https://docs.sentry.io/platforms/native/configuration/options/#database-path
sentry_options_set_database_path(options, ".sentry-native");
@@ -74,7 +74,7 @@ int main(int argc, char const *argv[]) {
});
/* code */
- Bot client(0, &bot);
+ Bot client(0, &bot, cfg.value("prefix", ".").at(0));
client.set_owner_id(dpp::snowflake(cfg.value("owner", "00000000000")));