diff options
author | Cara Salter <cara@devcara.com> | 2023-04-10 11:15:35 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2023-04-10 11:15:35 -0400 |
commit | 8edf3bf0ca81b942a165cde3bdea11ca755da955 (patch) | |
tree | d644a49a7f5784426b07960b9e4a8a31804eb50a /modules | |
parent | acc7f305eedbfc6e05000c6bc72cd35bd1443452 (diff) | |
download | 142bot-8edf3bf0ca81b942a165cde3bdea11ca755da955.tar.gz 142bot-8edf3bf0ca81b942a165cde3bdea11ca755da955.zip |
modldr: Support modules in a different path from exe
Change-Id: If56998535b8067b29ea34c760ac2da4339174983
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mmanager/mmanager.cpp | 1 | ||||
-rw-r--r-- | modules/spotify/spotify.cpp | 13 |
2 files changed, 12 insertions, 2 deletions
diff --git a/modules/mmanager/mmanager.cpp b/modules/mmanager/mmanager.cpp index f9ca704..2ff4636 100644 --- a/modules/mmanager/mmanager.cpp +++ b/modules/mmanager/mmanager.cpp @@ -64,6 +64,7 @@ public: { bot->core->log(dpp::ll_error, pcre_error); } + bot->core->log(dpp::ll_debug, "Test"); int matcharr[90]; int matchcount = pcre_exec(comp, NULL, clean_message.c_str(), clean_message.length(), 0, 0, matcharr, 90); diff --git a/modules/spotify/spotify.cpp b/modules/spotify/spotify.cpp index 89c7b88..93b66ac 100644 --- a/modules/spotify/spotify.cpp +++ b/modules/spotify/spotify.cpp @@ -19,13 +19,14 @@ #include <stdlib.h> #include "cpr/cpr.h" #include <142bot/modules.hpp> +#include <fmt/format.h> class SpotifyModule: public Module { std::string spotifyRegex; public: SpotifyModule(Bot* creator, ModuleLoader* ml) : Module(creator, ml) { - ml->attach({I_OnMessage}, this); + ml->attach({I_OnMessage, I_OnCommand}, this); this->spotifyRegex = "^https:\/\/open.spotify.com\/track\/([a-zA-Z0-9]+)(.*)$"; } @@ -58,12 +59,20 @@ public: EmbedSimple("Found a spotify URL", message.msg.channel_id); } else { if (clean_message.starts_with(bot->prefix)) { - + } } return true; } + virtual bool OnCommand(const dpp::message_create_t &message, const std::string &command, std::vector<std::string>& params) { + bot->core->log(dpp::ll_debug, fmt::format("spotify Got command: {}", command)); + printf("Am i getting called?????\n"); + + EmbedSimple("Got your command!", message.msg.channel_id); + + return true; + } }; |