feat: Introduce GameConfig to centralize constants for leveling, economy, and inventory, adding new transfer and inventory limits.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user