From 8edf3bf0ca81b942a165cde3bdea11ca755da955 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Mon, 10 Apr 2023 11:15:35 -0400 Subject: modldr: Support modules in a different path from exe Change-Id: If56998535b8067b29ea34c760ac2da4339174983 --- modules/mmanager/mmanager.cpp | 1 + modules/spotify/spotify.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'modules') 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 #include "cpr/cpr.h" #include <142bot/modules.hpp> +#include 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,10 +59,18 @@ 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& 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; } }; -- cgit v1.2.3