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/spotify/spotify.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'modules/spotify/spotify.cpp') 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