Common header is made and costs are moved there

This commit is contained in:
2025-07-22 17:42:27 +03:00
parent 01c8e9d03b
commit 1450dd4621
8 changed files with 24 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
#include "../../settings.hpp"
#include "../CommandManagement.cpp"
#include "../Common.hpp"
#include "../Databases.hpp"
#include <cstdlib>

View File

@@ -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) {

View File

@@ -4,10 +4,8 @@
#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},
std::unordered_map<std::string, std::function<void(COMMAND_ARGS)>> Commands{
{COMMAND_PING, commandPing},
{COMMAND_ABOUT, commandAbout},
{COMMAND_BALANCE, commandBalance},
{COMMAND_BALANCE_SHORT, commandBalance},

View File

@@ -1,4 +1,5 @@
#include "../../settings.hpp"
#include "../Common.hpp"
#include <dpp/dispatcher.h>
#include <dpp/dpp.h>
#include <dpp/guild.h>

View File

@@ -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>

View File

@@ -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
View 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

View File

@@ -1 +0,0 @@
#define COMMAND_GENERATE_REPORT_COST 2