More precise ngift error messages.

This commit is contained in:
Sage Vaillancourt 2022-03-15 11:43:23 -04:00
parent e971f7e7c2
commit 8577f6f272
1 changed files with 5 additions and 2 deletions

View File

@ -729,9 +729,12 @@ command(
if (!targetId) {
return say(`Please specify a valid @ target!`)
}
const nft = nfts.find(nft => nft.name === words[2] && nft.owner === event.user)
const nft = nfts.find(nft => nft.name === words[2])
if (!nft) {
return say(`You don't own an nft with that name!`)
return say(`There is not NFT named "${words[2]}"!`)
}
if (nft.owner !== event.user) {
return say(`You do not own "${nft.name}"!`)
}
nft.owner = targetId
}, { hidden: true })