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 "../CommandManagement.cpp"
|
||||||
|
#include "../Common.hpp"
|
||||||
#include "../Databases.hpp"
|
#include "../Databases.hpp"
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
@@ -1,12 +1,10 @@
|
|||||||
#include "../settings.hpp"
|
#include "Common.hpp"
|
||||||
#include <dpp/appcommand.h>
|
#include <dpp/appcommand.h>
|
||||||
#include <dpp/cluster.h>
|
#include <dpp/cluster.h>
|
||||||
#include <dpp/dispatcher.h>
|
#include <dpp/dispatcher.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
extern std::unordered_map<
|
extern std::unordered_map<std::string, std::function<void(COMMAND_ARGS)>>
|
||||||
std::string,
|
|
||||||
std::function<void(const dpp::slashcommand_t &event, dpp::cluster &bot)>>
|
|
||||||
Commands;
|
Commands;
|
||||||
|
|
||||||
void deleteCommands(const dpp::ready_t &event, dpp::cluster &bot) {
|
void deleteCommands(const dpp::ready_t &event, dpp::cluster &bot) {
|
||||||
|
@@ -4,16 +4,14 @@
|
|||||||
#include "Commands/OtherCommands.cpp"
|
#include "Commands/OtherCommands.cpp"
|
||||||
|
|
||||||
// Registry
|
// Registry
|
||||||
std::unordered_map<
|
std::unordered_map<std::string, std::function<void(COMMAND_ARGS)>> Commands{
|
||||||
std::string,
|
{COMMAND_PING, commandPing},
|
||||||
std::function<void(const dpp::slashcommand_t &event, dpp::cluster &bot)>>
|
{COMMAND_ABOUT, commandAbout},
|
||||||
Commands{{COMMAND_PING, commandPing},
|
{COMMAND_BALANCE, commandBalance},
|
||||||
{COMMAND_ABOUT, commandAbout},
|
{COMMAND_BALANCE_SHORT, commandBalance},
|
||||||
{COMMAND_BALANCE, commandBalance},
|
{COMMAND_PAY, commandPay},
|
||||||
{COMMAND_BALANCE_SHORT, commandBalance},
|
{COMMAND_PRINT_MONEY, commandPrintMoney},
|
||||||
{COMMAND_PAY, commandPay},
|
{COMMAND_BURN_MONEY, commandBurnMoney},
|
||||||
{COMMAND_PRINT_MONEY, commandPrintMoney},
|
{COMMAND_MONEY_LEADERBOARD, commandMoneyLeaderboard},
|
||||||
{COMMAND_BURN_MONEY, commandBurnMoney},
|
{COMMAND_GET_PFP, commandGetPFP},
|
||||||
{COMMAND_MONEY_LEADERBOARD, commandMoneyLeaderboard},
|
{COMMAND_GENERATE_REPORT, commandGenerateReport}};
|
||||||
{COMMAND_GET_PFP, commandGetPFP},
|
|
||||||
{COMMAND_GENERATE_REPORT, commandGenerateReport}};
|
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
#include "../../settings.hpp"
|
#include "../Common.hpp"
|
||||||
|
|
||||||
#include <dpp/dispatcher.h>
|
#include <dpp/dispatcher.h>
|
||||||
#include <dpp/dpp.h>
|
#include <dpp/dpp.h>
|
||||||
#include <dpp/guild.h>
|
#include <dpp/guild.h>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#include "../../settings.hpp" // This is where language is imported
|
|
||||||
#include "../Base/SQL.hpp"
|
#include "../Base/SQL.hpp"
|
||||||
|
#include "../Common.hpp"
|
||||||
#include "TransactionMethods.hpp"
|
#include "TransactionMethods.hpp"
|
||||||
|
|
||||||
#include <dpp/appcommand.h>
|
#include <dpp/appcommand.h>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#include "../../settings.hpp"
|
#include "../Common.hpp"
|
||||||
#include <dpp/dispatcher.h>
|
#include <dpp/dispatcher.h>
|
||||||
#include <dpp/dpp.h>
|
#include <dpp/dpp.h>
|
||||||
#include <dpp/guild.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