Fix a user being able to make a trade with themself
All checks were successful
Test / build (push) Successful in 2m29s
All checks were successful
Test / build (push) Successful in 2m29s
This commit is contained in:
parent
837013835e
commit
f12bb11ffb
1 changed files with 5 additions and 0 deletions
|
@ -36,6 +36,11 @@ export default class Trade extends Command {
|
||||||
|
|
||||||
AppLogger.LogSilly("Commands/Trade", `Parameters: user=${user.id}, give=${give.value}, receive=${receive.value}`);
|
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 giveItemEntity = await Inventory.FetchOneByCardNumberAndUserId(interaction.user.id, give.value!.toString());
|
||||||
const receiveItemEntity = await Inventory.FetchOneByCardNumberAndUserId(user.id, receive.value!.toString());
|
const receiveItemEntity = await Inventory.FetchOneByCardNumberAndUserId(user.id, receive.value!.toString());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue