Added bot parameter to all methods and get_pfp

This commit is contained in:
2025-07-22 04:41:45 +03:00
parent 836d257a17
commit 18573286bc
6 changed files with 40 additions and 14 deletions

View File

@@ -13,7 +13,7 @@
#include <variant>
// Actual commands
void commandBalance(const dpp::slashcommand_t &event) {
void commandBalance(const dpp::slashcommand_t &event, dpp::cluster &bot) {
std::string person, balance;
dpp::command_value id = event.get_parameter("user");
@@ -29,7 +29,7 @@ void commandBalance(const dpp::slashcommand_t &event) {
event.reply(COMMAND_BALANCE_SOMEONE_ELSE_RESPONSE(person, balance));
}
void commandPay(const dpp::slashcommand_t &event) {
void commandPay(const dpp::slashcommand_t &event, dpp::cluster &bot) {
std::string recipient =
std::get<dpp::snowflake>(event.get_parameter("recipient")).str();
std::uint64_t amount = std::get<std::int64_t>(event.get_parameter("amount"));
@@ -46,7 +46,7 @@ void commandPay(const dpp::slashcommand_t &event) {
event.reply(COMMAND_PAY_SUCCESS(recipient, std::to_string(amount)));
}
void commandPrintMoney(const dpp::slashcommand_t &event) {
void commandPrintMoney(const dpp::slashcommand_t &event, dpp::cluster &bot) {
std::int64_t userid = event.command.get_issuing_user().id;
if (ADMIN_ID != userid) {
@@ -59,7 +59,7 @@ void commandPrintMoney(const dpp::slashcommand_t &event) {
COMMAND_PRINT_SUCCESS(std::to_string(ADMIN_ID), std::to_string(amount)));
}
void commandBurnMoney(const dpp::slashcommand_t &event) {
void commandBurnMoney(const dpp::slashcommand_t &event, dpp::cluster &bot) {
std::int64_t userid = event.command.get_issuing_user().id;
if (ADMIN_ID != userid) {
@@ -78,7 +78,8 @@ void commandBurnMoney(const dpp::slashcommand_t &event) {
COMMAND_BURN_SUCCESS(std::to_string(ADMIN_ID), std::to_string(amount)));
}
void commandMoneyLeaderboard(const dpp::slashcommand_t &event) {
void commandMoneyLeaderboard(const dpp::slashcommand_t &event,
dpp::cluster &bot) {
std::string result;
std::stringstream replyStream;
execSQL("SELECT * FROM MONEY ORDER BY CASH DESC LIMIT 15;", &result);

View File

@@ -1,7 +1,15 @@
#include "../../settings.hpp"
#include <dpp/dispatcher.h>
#include <dpp/guild.h>
#include <dpp/snowflake.h>
void commandPing(const dpp::slashcommand_t &event) { event.reply("Pong"); }
void commandAbout(const dpp::slashcommand_t &event) {
void commandPing(const dpp::slashcommand_t &event, dpp::cluster &bot) {
event.reply("Pong");
}
void commandAbout(const dpp::slashcommand_t &event, dpp::cluster &bot) {
event.reply(COMMAND_ABOUT_RESPONSE);
}
void commandGetPFP(const dpp::slashcommand_t &event, dpp::cluster &bot) {
dpp::snowflake user = std::get<dpp::snowflake>(event.get_parameter("user"));
}