aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2023-04-03 13:45:25 -0400
committerCara Salter <cara@devcara.com>2023-04-03 13:45:25 -0400
commitbaffbbc96f5f55b55977ad3a7606216c852ee595 (patch)
tree566dcac1ac2a281282efd62327face676a116a6e
parent27e58363dde28f4667761970fc7068be8fe047ac (diff)
download142bot-baffbbc96f5f55b55977ad3a7606216c852ee595.tar.gz
142bot-baffbbc96f5f55b55977ad3a7606216c852ee595.zip
Init spotify module
Change-Id: I01535de80c6426f1f724ffad87a628b8a9a1b55d
-rw-r--r--modules/spotify/spotify.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/spotify/spotify.cpp b/modules/spotify/spotify.cpp
new file mode 100644
index 0000000..2a25944
--- /dev/null
+++ b/modules/spotify/spotify.cpp
@@ -0,0 +1,49 @@
+/*
+ * =====================================================================================
+ *
+ * Filename: spotify.cpp
+ *
+ * Description: Implementation of the spotify API
+ *
+ * Version: 1.0
+ * Created: 04/01/2023 09:55:09 PM
+ * Revision: none
+ * Compiler: gcc
+ *
+ * Author: Cara Salter (muirrum), cara@devcara.com
+ * Organization: Worcester Polytechnic Institute
+ *
+ * =====================================================================================
+ */
+#include <stdlib.h>
+#include "cpr/cpr.h"
+#include <142bot/modules.hpp>
+
+
+class SpotifyModule: public Module {
+ std::string spotifyRegex;
+public:
+ SpotifyModule(Bot* creator, ModuleLoader* ml) : Module(creator, ml) {
+ ml->attach({I_OnMessage}, this);
+
+ this->spotifyRegex = "^https:\/\/open.spotify.com\/track\/([a-zA-Z0-9]+)(.*)$";
+ }
+
+ virtual std::string version() {
+ return "0.1.0";
+ }
+
+ virtual std::string description() {
+ return "Manage spotify queues for 142";
+ }
+
+ virtual bool OnMessage(const dpp::message_create_t &message, const std::string& clean_message, bool mentioned, const std::vector<std::string> & mentions) {
+
+
+ return true;
+ }
+};
+
+
+
+ENTRYPOINT(SpotifyModule)