Fix a user being able to make a trade with themself
All checks were successful
Test / build (push) Successful in 2m29s

This commit is contained in:
Ethan Lane 2024-06-02 16:05:05 +01:00
parent 837013835e
commit f12bb11ffb

View file

@ -36,6 +36,11 @@ export default class Trade extends Command {
AppLogger.LogSilly("Commands/Trade", `Parameters: user=${user.id}, give=${give.value}, receive=${receive.value}`);
if (interaction.user.id == user.id) {
await interaction.reply("You can not create a trade with yourself.");
return;
}
const giveItemEntity = await Inventory.FetchOneByCardNumberAndUserId(interaction.user.id, give.value!.toString());
const receiveItemEntity = await Inventory.FetchOneByCardNumberAndUserId(user.id, receive.value!.toString());