This commit is contained in:
stjet
2024-09-13 22:20:04 +00:00
parent c2d1cd2af1
commit 1704c10dfc
4 changed files with 4 additions and 4 deletions

View File

@@ -15,7 +15,7 @@ async function run(interaction: ChatInputCommandInteraction, user: User) {
if (quantity <= 0) throw new BotError("Can't buy 0 or less of an item. Nice try");
const item = await get_item(name);
if (!item) throw new BotError("Item does not exist");
if (!item.price) throw new BotError("Item is not buyable");
if (item.price === null) throw new BotError("Item is not buyable");
if (item.roles_required.length > 0) {
for (const role_id of item.roles_required) {
if (!has_role(interaction, role_id)) throw new BotError("Missing one of the required roles to buy this item");