Skip to main content

/add-item — Add Product (Admin)

Type: Admin slash command → Modal
Scope: Admin role only

Description

Opens a Discord modal that collects the minimum information needed to create a draft product. The product is created in isActive=false, isPublished=false state. The admin then uploads an image and publishes via AdminJS.

Usage

/add-item

A 5-field modal appears:

FieldDescription
Product NameRequired, max 100 chars
DescriptionOptional, max 500 chars, multiline
Price (cents)Required, e.g. 999 = $9.99
Cost (cents, internal)Required, e.g. 500
Initial Qty + VisibilitySpace-separated, e.g. 10 inherit or 0 public. Visibility: inherit, public, private

Behavior

  • Admin-only.
  • Creates a Product document with:
    • isActive = false, isPublished = false (draft state)
    • sku auto-generated as DRAFT-<id>
    • Currency defaults to USD
  • If initial qty > 0, creates an InventoryTransaction of type ADJUSTMENT.
  • Responds ephemerally with the AdminJS deep-link to upload an image and publish:
    Draft product <name> created. Upload image & publish it in AdminJS:
    https://<base>/admin/resources/Product/records/<id>/show
  • Also DMs the admin if a bot token is available.

Publishing a draft

  1. Click the AdminJS link in the confirmation message.
  2. Upload a product image via the image field.
  3. Set isActive = true and isPublished = true, then Save.

Permissions

Requires admin role (botConfig.adminRoleIds).