adds cmake python requirements

This commit is contained in:
SuperNovaa41
2022-03-04 00:25:51 -05:00
parent bca3a3cb0a
commit 50a38183b6
15 changed files with 251 additions and 1152 deletions

BIN
src/.gbp.h.swp Normal file

Binary file not shown.

View File

@ -1,2 +1,18 @@
#include "gbp.h"
#include "gbp.cpp"
std::string printFullGBPList(bool update = false)
{
std::map<int, std::string> gbp;
if (update)
gbp = fetchAndReadGBP();
else
gbp = readGBPIntoList();
std::string msg;
int i = 1;
for (std::map<int, std::string>::iterator it = gbp.end(); it != gbp.begin(); it--) {
msg += "#[i] [it->second], GBP: [it->first]\n";
i++;
}
return msg;
}

View File

@ -1,5 +0,0 @@
#include <bits/stdc++.h>
void fetchLatestGBP();
std::map<int, std::string>readGBPIntoList();
std::map<int, std::string>fetchAndReadGBP();

View File

@ -7,7 +7,7 @@
#include <dpp/queues.h>
#include <dpp/nlohmann/json.hpp>
#include <string>
#include "gbp.h"
#include "commands.cpp"
using json = nlohmann::json;
@ -41,9 +41,16 @@ void onMessage(dpp::cluster &bot, dpp::message msg)
if (!hasCommand(msg))
return;
readGBPIntoList();
int argIdx = msg.content.find(" ");
std::string argument = msg.content.substr(argIdx, msg.content.length() - argIdx);
dpp::message toSend = dpp::message(msg.channel_id, argument);
std::string msgContent = "guh";
if (argument == "gbp")
msgContent = printFullGBPList();
dpp::message toSend = dpp::message(msg.channel_id, msgContent);
bot.message_create(toSend);
}