diff --git a/build/CMakeFiles/gbp-bot.dir/CXX.includecache b/build/CMakeFiles/gbp-bot.dir/CXX.includecache index 057be0a..ec7bdb6 100644 --- a/build/CMakeFiles/gbp-bot.dir/CXX.includecache +++ b/build/CMakeFiles/gbp-bot.dir/CXX.includecache @@ -1121,8 +1121,6 @@ gbp.cpp /home/seth/documents/programming/discord-bots/gbp/src/gbp.cpp string - -unordered_map -- vector - algorithm @@ -1149,6 +1147,8 @@ dpp/dispatcher.h - dpp/dpp.h - +dpp/guild.h +- dpp/intents.h - dpp/message.h diff --git a/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o b/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o index c1940c4..e745674 100644 Binary files a/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o and b/build/CMakeFiles/gbp-bot.dir/src/main.cpp.o differ diff --git a/src/commands.cpp b/src/commands.cpp index 18ea89f..f73784d 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -22,10 +22,12 @@ std::mapvecArgs; */ std::string commandParse(std::vector args) { - auto i1 = noArgs.find(args[0]); + std::string cmd = args[0]; + args.erase(args.begin()); + auto i1 = noArgs.find(cmd); if (i1 != noArgs.end()) return (*i1->second)(); - auto i2 = vecArgs.find(args[0]); + auto i2 = vecArgs.find(cmd); if (i2 != vecArgs.end()) return (*i2->second)(args); return "Invalid command!"; @@ -135,6 +137,24 @@ std::string findNum(std::vector args) return out; } + +/* +std::string notify(std::vector args) +{ + if (args.size() < 3) + return "Invalid command!"; + + // !gbp notify SuperNovaa41 + // will be the users in put + // we need to append + // !gbp notify SuperNovaa41 message_sender_id + + // notify [github name] + // notify stop -> this will search for all notifys with that discord name +} +*/ + + /** * ##findName * diff --git a/src/main.cpp b/src/main.cpp index 7b16b19..d037d5f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -70,19 +71,24 @@ void onMessage(dpp::cluster &bot, dpp::message msg) /* Parse the command */ std::vector args = separateArgs(argument); + + + args.insert(++args.begin(), std::to_string(msg.author.id)); std::string msgContent = commandParse(args); /* Here we check if we should embed a file, or just send a message */ std::vector messageArgs = separateArgs(msgContent); - dpp::message toSend; if (messageArgs[0] == std::string(FILE_WARNING)) { - toSend = dpp::message(msg.channel_id, ""); - toSend.add_file(messageArgs[2], dpp::utility::read_file(messageArgs[1])); - } else - toSend = dpp::message(msg.channel_id, msgContent); - - /* Send the message */ - bot.message_create(toSend); + std::cout << "test2"; + bot.message_create(dpp::message(msg.channel_id, "") + .add_file(messageArgs[2], dpp::utility::read_file(messageArgs[1])) + ); + } else { + std::cout << "test"; + bot.message_create(dpp::message(msg.channel_id, msgContent) + .set_allowed_mentions(true, false, false, false, { }, { }) + ); + } } int main()