feat: Prevent inventory, profile, balance, and pay commands from targeting bot users.

This commit is contained in:
syntaxbullet
2025-12-15 22:21:29 +01:00
parent 7e986fae5a
commit 9333d6ac6c
4 changed files with 26 additions and 0 deletions

View File

@@ -23,6 +23,13 @@ export const pay = createCommand({
),
execute: async (interaction) => {
const targetUser = await userService.getOrCreateUser(interaction.options.getUser("user", true).id, interaction.options.getUser("user", true).username);
const discordUser = interaction.options.getUser("user", true);
if (discordUser.bot) {
await interaction.reply({ embeds: [createWarningEmbed("You cannot send money to bots.")], flags: MessageFlags.Ephemeral });
return;
}
const amount = BigInt(interaction.options.getInteger("amount", true));
const senderId = interaction.user.id;
const receiverId = targetUser.id;