Common header is made and costs are moved there
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "../../settings.hpp"
|
||||
#include "../CommandManagement.cpp"
|
||||
#include "../Common.hpp"
|
||||
#include "../Databases.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
@@ -1,12 +1,10 @@
|
||||
#include "../settings.hpp"
|
||||
#include "Common.hpp"
|
||||
#include <dpp/appcommand.h>
|
||||
#include <dpp/cluster.h>
|
||||
#include <dpp/dispatcher.h>
|
||||
#include <vector>
|
||||
|
||||
extern std::unordered_map<
|
||||
std::string,
|
||||
std::function<void(const dpp::slashcommand_t &event, dpp::cluster &bot)>>
|
||||
extern std::unordered_map<std::string, std::function<void(COMMAND_ARGS)>>
|
||||
Commands;
|
||||
|
||||
void deleteCommands(const dpp::ready_t &event, dpp::cluster &bot) {
|
||||
|
@@ -4,16 +4,14 @@
|
||||
#include "Commands/OtherCommands.cpp"
|
||||
|
||||
// Registry
|
||||
std::unordered_map<
|
||||
std::string,
|
||||
std::function<void(const dpp::slashcommand_t &event, dpp::cluster &bot)>>
|
||||
Commands{{COMMAND_PING, commandPing},
|
||||
{COMMAND_ABOUT, commandAbout},
|
||||
{COMMAND_BALANCE, commandBalance},
|
||||
{COMMAND_BALANCE_SHORT, commandBalance},
|
||||
{COMMAND_PAY, commandPay},
|
||||
{COMMAND_PRINT_MONEY, commandPrintMoney},
|
||||
{COMMAND_BURN_MONEY, commandBurnMoney},
|
||||
{COMMAND_MONEY_LEADERBOARD, commandMoneyLeaderboard},
|
||||
{COMMAND_GET_PFP, commandGetPFP},
|
||||
{COMMAND_GENERATE_REPORT, commandGenerateReport}};
|
||||
std::unordered_map<std::string, std::function<void(COMMAND_ARGS)>> Commands{
|
||||
{COMMAND_PING, commandPing},
|
||||
{COMMAND_ABOUT, commandAbout},
|
||||
{COMMAND_BALANCE, commandBalance},
|
||||
{COMMAND_BALANCE_SHORT, commandBalance},
|
||||
{COMMAND_PAY, commandPay},
|
||||
{COMMAND_PRINT_MONEY, commandPrintMoney},
|
||||
{COMMAND_BURN_MONEY, commandBurnMoney},
|
||||
{COMMAND_MONEY_LEADERBOARD, commandMoneyLeaderboard},
|
||||
{COMMAND_GET_PFP, commandGetPFP},
|
||||
{COMMAND_GENERATE_REPORT, commandGenerateReport}};
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include "../../settings.hpp"
|
||||
#include "../Common.hpp"
|
||||
|
||||
#include <dpp/dispatcher.h>
|
||||
#include <dpp/dpp.h>
|
||||
#include <dpp/guild.h>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
#include "../../settings.hpp" // This is where language is imported
|
||||
#include "../Base/SQL.hpp"
|
||||
#include "../Common.hpp"
|
||||
#include "TransactionMethods.hpp"
|
||||
|
||||
#include <dpp/appcommand.h>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#include "../../settings.hpp"
|
||||
#include "../Common.hpp"
|
||||
#include <dpp/dispatcher.h>
|
||||
#include <dpp/dpp.h>
|
||||
#include <dpp/guild.h>
|
||||
|
6
src/Common.hpp
Normal file
6
src/Common.hpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "../settings.hpp"
|
||||
|
||||
#define COMMAND_ARGS const dpp::slashcommand_t &event, dpp::cluster &bot
|
||||
|
||||
// Costs of commands
|
||||
#define COMMAND_GENERATE_REPORT_COST 2
|
@@ -1 +0,0 @@
|
||||
#define COMMAND_GENERATE_REPORT_COST 2
|
Reference in New Issue
Block a user