aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/mmanager/mmanager.cpp1
-rw-r--r--modules/spotify/spotify.cpp13
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;
+ }
};