feat: Introduce GameConfig to centralize constants for leveling, economy, and inventory, adding new transfer and inventory limits.

This commit is contained in:
syntaxbullet
2025-12-13 12:20:30 +01:00
parent 8818d6bb15
commit 5f4efd372f
5 changed files with 68 additions and 29 deletions

View File

@@ -2,6 +2,7 @@ import { createCommand } from "@/lib/utils";
import { SlashCommandBuilder, EmbedBuilder } from "discord.js";
import { economyService } from "@/modules/economy/economy.service";
import { userService } from "@/modules/user/user.service";
import { GameConfig } from "@/config/game";
export const pay = createCommand({
data: new SlashCommandBuilder()
@@ -26,6 +27,11 @@ export const pay = createCommand({
const senderId = interaction.user.id;
const receiverId = targetUser.id;
if (amount < GameConfig.economy.transfers.minAmount) {
await interaction.editReply({ content: `❌ Amount must be at least ${GameConfig.economy.transfers.minAmount}.` });
return;
}
if (senderId === receiverId) {
await interaction.editReply({ content: "❌ You cannot pay yourself." });
return;