> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Draw Lots Minigame

> Learn how to configure the Draw Lots fortune stick minigame in ChatbotX: customize the bamboo cylinder, set prize odds, reward viral referrals, and automate flows.

**Draw Lots** is an interactive, mobile-optimized fortune stick minigame delivered via Webview. Contacts tap the start button to shake a traditional bamboo lot cylinder, causing an auspicious lot stick to emerge with fortune messages, blessing quotes, or valuable prizes.

Inspired by traditional temple fortune casting, Draw Lots is exceptionally effective for New Year campaigns, festive celebrations, and seasonal promotional events, significantly boosting conversation open rates and attracting new contacts.

<CardGroup cols={2}>
  <Card title="Authentic Fortune Casting" icon="scroll">
    Realistic cylinder shaking animations and authentic wooden rattle sound effects evoke the charm of traditional fortune-telling.
  </Card>

  <Card title="Organic Viral Sharing" icon="share-nodes">
    Automatically award extra spins when contacts invite friends and trigger custom welcome steps for referred users.
  </Card>

  <Card title="Automated Tagging & Attributes" icon="bolt">
    Automatically tag openers, active players, and referred friends, while storing winning prize names into Custom Fields.
  </Card>

  <Card title="Probability & Budget Control" icon="sliders">
    Maintain a balanced 100% total probability, limit prize inventory, and schedule daily spin resets.
  </Card>
</CardGroup>

## Accessing Gamification

To get started, navigate to **Tools** from the left sidebar of ChatbotX and click the **Gamification** card:

<Frame>
  <img src="https://mintcdn.com/chatbotx/HE2gRYNerwCg9mjS/images/gamification_tools_entry.png?fit=max&auto=format&n=HE2gRYNerwCg9mjS&q=85&s=cbf4f8fa9c9778bf6b7202236f1e1ea5" alt="Gamification Tools Entry" width="3020" height="1810" data-path="images/gamification_tools_entry.png" />
</Frame>

## Minigame Dashboard (Game List)

The Gamification overview dashboard displays all created minigames alongside real-time campaign performance metrics:

<Frame>
  <img src="https://mintcdn.com/chatbotx/HE2gRYNerwCg9mjS/images/gamification_dashboard_list.png?fit=max&auto=format&n=HE2gRYNerwCg9mjS&q=85&s=b6f81de8808f31d7f72f14e2ce6ce01f" alt="Gamification Dashboard List" width="2421" height="989" data-path="images/gamification_dashboard_list.png" />
</Frame>

### Understanding Dashboard Metrics

| Metric           | Description                                                                                |
| ---------------- | ------------------------------------------------------------------------------------------ |
| **Name**         | The title of the minigame displayed internally and at the top of the mobile Webview.       |
| **Games played** | Total number of spins completed. For example, if 1 contact plays 3 times, it counts as 3.  |
| **Participants** | Total unique contacts who joined. For example, if 1 contact plays 3 times, it counts as 1. |
| **Winners**      | Total number of winning draw outcomes recorded across the campaign.                        |
| **Referrals**    | Total number of new friends who joined through player referral links.                      |
| **Status**       | A toggle switch to quickly enable or disable the minigame URL.                             |
| **Created At**   | Date and time the minigame was created.                                                    |

### Actions Menu

Click the three dots (`⋮`) in the Actions column of any minigame to:

* **Edit:** Open the configuration editor.
* **History:** View the participant log and gameplay history.
* **Delete:** Remove the minigame from the system.

## Creating a Draw Lots Minigame

On the Gamification page, click **+ Create Minigame** in the top-right corner to open the minigame type selection modal:

<Frame>
  <img src="https://mintcdn.com/chatbotx/HE2gRYNerwCg9mjS/images/gamification_choose_minigame_type_modal.png?fit=max&auto=format&n=HE2gRYNerwCg9mjS&q=85&s=da301dd33c4efe94f087507d198df11a" alt="Choose a Minigame Type Modal" width="3178" height="1663" data-path="images/gamification_choose_minigame_type_modal.png" />
</Frame>

Click **Draw Lots** to initialize a new game. The configuration interface opens with two primary tabs in the top navigation bar: **Edit** (Minigame settings and design) and **History** (Participant tracking and draw logs):

<Frame>
  <img src="https://mintcdn.com/chatbotx/QbROR03RsIvwoJhm/images/draw_lots_edit_minigame_overview.png?fit=max&auto=format&n=QbROR03RsIvwoJhm&q=85&s=df1f39de5a79439d9a7fd9a578743319" alt="Draw Lots Edit Minigame Overview" width="1738" height="1820" data-path="images/draw_lots_edit_minigame_overview.png" />
</Frame>

## General Setting

Located in the left column, **General Setting** manages basic display options and automated tagging:

* **Name:** Internal and customer-facing title of the game. The adjacent **Visible** toggle enables or hides the title banner at the top of the mobile Webview.
* **Played At:** Active campaign period (start and end date/time). Outside this window, contacts opening the link cannot draw lots.
* **Rules Description (optional):** Gameplay instructions (e.g., *Shake the bamboo cylinder to draw your lucky fortune stick! Free daily draw for every player.*). This text appears in the footer area of the mobile Webview.
* **Tag contacts who open the game link (optional):** Assign tags to contacts who open the game link, even if they leave without drawing. Useful for follow-up reminders.
* **Tag players (optional):** Assign tags to contacts who click the start button and draw a stick.
* **Tag new friends (optional):** Assign tags to newly referred contacts who joined through a friend's share link.

## Appearance

The **Appearance** section allows you to customize the color scheme and upload branded bamboo cylinder graphics:

### Color Palette

* **Background Color:** The background color surrounding the mobile Webview (Hex code).
* **Chou qian color:** Primary color of the bamboo lot cylinder.
* **Rule Text Color:** Text color of the rules description displayed at the bottom.

### Recommended Asset Dimensions

* **Background Image:** Main backdrop graphic. Recommended width is **1024px**. Height scales automatically.
* **Prize Description Image (Optional):** Header promotional banner. Recommended width is **750px**. You can **Upload File** or **Insert Link**.
* **Start Button Image:** Button graphic used to shake and draw lots (replaces the default button). Recommended dimensions are **340 x 340px**.

<Note>
  As you adjust colors or upload graphics, the **Live Mobile Preview** on the right updates in real time. A 60px bottom margin is automatically reserved under the rules text to ensure optimal display on mobile screens with navigation bars.
</Note>

## Player Settings

Located in the middle column, **Player Settings** defines spin allowances, referral rewards, and reset schedules:

### Initial Draws

* **Number of lucky draw chances per person:** Base number of draws granted to each contact (default is 1).

### Referral & Viral Sharing

* **Max bonus draws from referrals (optional):** Maximum extra draws a player can earn by sharing with friends.
  * Each friend who clicks the invite link and messages your bot grants the original player 1 bonus draw, up to this limit.
  * Set to **0** to disable referral bonus draws.
* **Sharing node (optional):** Select the specific Flow step (**Node**) that executes when a referred friend opens the link. If left empty, the **Share button** is hidden from the game screen.

When a player runs out of default spins, the Webview automatically displays the notice *You are out of draws for this minigame* along with a **Share with friends** button:

<Frame>
  <img src="https://mintcdn.com/chatbotx/QbROR03RsIvwoJhm/images/draw_lots_share_with_friends_button.png?fit=max&auto=format&n=QbROR03RsIvwoJhm&q=85&s=d69f7f94045ce5de4f91b6323038ebf9" alt="Draw Lots Share With Friends Button" width="1017" height="1289" data-path="images/draw_lots_share_with_friends_button.png" />
</Frame>

Clicking **Share with friends** opens the native mobile share sheet with a personalized invite link. When a friend taps the link and messages the bot, the designated **Sharing node** runs, and the inviter receives an extra draw.

### Reset Draws

* **Do not reset the number of draws:** Contacts can only play their initial allowance plus any earned referral bonuses.
* **Reset the number of draws every:** Restores the default draw count periodically (e.g., reset every 1 day at 00:00).

<Note>
  **Important reset policy:** When a scheduled reset occurs (e.g., daily at 00:00), **all unused bonus draws earned from referrals are also reset**. Clarify this policy in your rules description to encourage same-day participation.
</Note>

## Prize Settings

The **Prize Settings** section controls rewards, odds calculations, and winner tracking:

### Probability Indicators

The system calculates total odds at the top of the section:

* **Sum of all probabilities:** Total combined probability across all items (must equal exactly **100%**).
* **Win probability:** Aggregate probability of all winning prizes.
* **Lose probability:** Probability of hitting the **Non-winning** outcome.

### Storing Winning Results

* **Save prize name to Custom Field (optional):** Select a text Custom Field (e.g., *Prize Name*). When a contact draws a winning stick, its name is automatically saved to their profile for downstream messaging or segmentation.

### Adding and Editing Prizes (Edit Prize)

Adjust probability percentages directly in the list, click the trash icon to delete, or click the pencil icon to open the **Edit Prize** modal:

<Frame>
  <img src="https://mintcdn.com/chatbotx/QbROR03RsIvwoJhm/images/draw_lots_edit_prize_modal.png?fit=max&auto=format&n=QbROR03RsIvwoJhm&q=85&s=de22f60a22230d854f8c97286bbb9842" alt="Draw Lots Edit Prize Modal" width="2394" height="1812" data-path="images/draw_lots_edit_prize_modal.png" />
</Frame>

Inside **Edit Prize**, configure:

* **Prize Name:** Title of the fortune stick or prize (e.g., *Great Fortune - 50% Off Voucher*, *Good Luck - Souvenir Gift*, *Blessing Cash 50K*).
* **Image:** Upload or paste an image URL representing the drawn fortune stick.
* **Prize Quantity (optional):** Inventory limit. Each win decreases this counter by 1. When it reaches 0, the prize can no longer be won. Leave empty for unlimited winners.

Click **+ New Prize** to add more fortune tiers, or edit the **Non-winning** row to adjust loss messaging and odds (peace and safe fortune).

<Warning>
  **Out-of-Stock Fallback Rule:** When a limited-quantity prize runs out (quantity reaches 0), any subsequent spins that land on this prize are **automatically converted into Non-winning outcomes**. This safeguards your prize budget while preserving a valid 100% probability structure.
</Warning>

## Winning & Non-winning Message Settings

After the stick emerges, the Webview displays a result screen. Click the pencil icon next to **Winning Message Settings** or **Non-winning Message Settings** to configure these states:

### Winning Message Settings

<Frame>
  <img src="https://mintcdn.com/chatbotx/QbROR03RsIvwoJhm/images/draw_lots_winning_message_settings_modal.png?fit=max&auto=format&n=QbROR03RsIvwoJhm&q=85&s=7e3bdb93babcb8dd1e7a7b7a94944d75" alt="Draw Lots Winning Message Settings Modal" width="2395" height="1815" data-path="images/draw_lots_winning_message_settings_modal.png" />
</Frame>

* **Title (optional):** Congratulations headline (e.g., *Congratulations on your Great Fortune!*).
* **Description (optional):** Blessing message and prize details. Insert the `{{prize_name}}` variable to dynamically display the prize won.
* **Accept Button Text (optional):** CTA button text shown on the Webview (e.g., *Redeem Blessing*).
* **Send message to winner who received the prize (optional):** Enable to trigger an automated bot message immediately upon winning.
  * **Message type:** Select from 3 delivery methods:
    * **Text:** Sends a plain text confirmation.
    * **Flow:** Triggers a complete automated sequence (select via **Flow ID**) to issue coupon codes or collect recipient details.
    * **Node:** Navigates directly to a specific block within an existing flow.

### Non-winning Message Settings

<Frame>
  <img src="https://mintcdn.com/chatbotx/QbROR03RsIvwoJhm/images/draw_lots_non_winning_message_settings_modal.png?fit=max&auto=format&n=QbROR03RsIvwoJhm&q=85&s=0e78d9694c551e9431282cb2a7c1be2e" alt="Draw Lots Non Winning Message Settings Modal" width="2395" height="1810" data-path="images/draw_lots_non_winning_message_settings_modal.png" />
</Frame>

* **Title (optional):** Headline for non-winning draws (e.g., *Peace & Good Health*).
* **Description (optional):** Warm wishes and encouragement to invite friends for another fortune draw.
* **Send a message when the player doesn't win (optional):** Enable to deliver a blessing message or a participation discount code via the bot.

## Tracking Gameplay History (History)

Switch to the **History** tab in the top navigation bar to inspect detailed engagement logs:

<Frame>
  <img src="https://mintcdn.com/chatbotx/pGLxM_CEVOtWs-rs/images/gamification_history_tracking_table.png?fit=max&auto=format&n=pGLxM_CEVOtWs-rs&q=85&s=4e44bfb718baf778a0e84e0e465fab99" alt="Gamification History Tracking Table" width="2420" height="1061" data-path="images/gamification_history_tracking_table.png" />
</Frame>

The table displays key tracking columns:

* **Name:** Contact avatar and profile name.
* **Plays:** Total lot draws executed by this contact.
* **Remaining draws:** Remaining unused draw balance.
* **Referrals:** Count of new friends who joined via this contact's share link.
* **First opened:** Date and time the contact first loaded the minigame.
* **Last played:** Date and time of their most recent draw.
* **Actions (⋮):** Quick management actions for individual players.

Use the **Search name...** field to find specific participants or adjust **Rows per page** pagination.

## Integrating Draw Lots into Chatbot Flows

At the bottom of the editor, copy your unique **Public URL**:

```text theme={null}
https://app.chatconnectx.com/minigames?minigameId=XXXXXX
```

Paste this URL into **Open Website** buttons across Flows, Broadcasts, or Sequences. Here are 3 common implementation strategies:

### Strategy 1: Click-to-Message Ad Acquisition

Build a Flow triggered when contacts message your Facebook or Instagram ad. Attach an **Open Website** button linking to the Draw Lots minigame to offer an instant welcome fortune draw, doubling initial conversation engagement rates.

### Strategy 2: Automated Coupon Delivery

Under **Winning Message Settings**, select **Flow** as the message type. Connect a flow containing the **Set up Coupon** action from [Coupons](/docs/tools/coupons). When a contact wins, the bot automatically sends a unique coupon code with an expiration date directly into the chat.

### Strategy 3: Daily Re-engagement Campaigns

Set **Reset draws** to recurring daily resets (**Reset every 1 day**). Use [Omnichannel Broadcasts](/docs/remarketing/omnichannel-broadcasts) to notify past contacts of fresh daily fortune draws, driving steady repeat traffic back to your channels.
