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

@@ -2,6 +2,7 @@ import { createCommand } from "@/lib/utils";
import { SlashCommandBuilder, AttachmentBuilder } from "discord.js";
import { userService } from "@/modules/user/user.service";
import { generateStudentIdCard } from "@/graphics/studentID";
import { createWarningEmbed } from "@/lib/embeds";
export const profile = createCommand({
data: new SlashCommandBuilder()
@@ -16,6 +17,12 @@ export const profile = createCommand({
await interaction.deferReply();
const targetUser = interaction.options.getUser("user") || interaction.user;
if (targetUser.bot) {
await interaction.editReply({ embeds: [createWarningEmbed("Bots do not have profiles.", "Profile Check")] });
return;
}
const user = await userService.getOrCreateUser(targetUser.id, targetUser.username);
const cardBuffer = await generateStudentIdCard({