adds cmake python requirements
This commit is contained in:
BIN
src/.gbp.h.swp
Normal file
BIN
src/.gbp.h.swp
Normal file
Binary file not shown.
@ -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;
|
||||
}
|
||||
|
@ -1,5 +0,0 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
void fetchLatestGBP();
|
||||
std::map<int, std::string>readGBPIntoList();
|
||||
std::map<int, std::string>fetchAndReadGBP();
|
11
src/main.cpp
11
src/main.cpp
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user