# Lottery

{% hint style="success" %}

### Use the /points-parlor-ui command to set up a ui for users to buy lottery tickets.

{% endhint %}

The Lottery system allows server administrators to create and manage lotteries where users can purchase tickets for a chance to win prizes. The system includes features for creating, editing, and managing lotteries with customizable parameters.

### Server Admin Commands

#### Create Lottery

```
/lottery create <lottery_name> <lottery_description> <ticket_price> <lottery_duration> <maximum_tickets_per_user> [total_winners] [lottery_image_url]
```

Parameters:

* `lottery_name`: Name of the lottery
* `lottery_description`: Description of the lottery
* `ticket_price`: Price per ticket
* `lottery_duration`: Duration in hours (0.01 to 1000 hours) \[Default: 24]
* `maximum_tickets_per_user`: Max tickets per user (1-999) \[Default: 1]
* `total_winners`: (Optional) Number of winners (1-15)
* `lottery_image_url`: (Optional) Custom image URL

#### Delete Lottery

```
/lottery delete <lottery_name>
```

Parameters:

* `lottery_name`: Name of the lottery to delete

#### View Lottery Info

```
/lottery info <lottery_name>
```

Parameters:

* `lottery_name`: Name of the lottery to view

#### Edit Lottery

```
/lottery edit <lottery_name> [lottery_description] [ticket_price] [lottery_duration] [total_winners] [maximum_tickets_per_user] [lottery_image_url]
```

Parameters:

* `lottery_name`: Name of the lottery to edit
* `lottery_description`: (Optional) New description
* `ticket_price`: (Optional) New ticket price
* `lottery_duration`: (Optional) New duration in hours
* `total_winners`: (Optional) New number of winners
* `maximum_tickets_per_user`: (Optional) New max tickets per user
* `lottery_image_url`: (Optional) New image URL

### Package Features

#### Free Package

* Maximum 1 lottery
* Default settings
* Basic functionality
* No customization

#### Pro Package

* Maximum 5 lotteries
* Custom settings
* All free features
* Basic customization

#### Enterprise Package

* Maximum 25 lotteries
* Full customization
* All pro features
* Advanced management

### Best Practices for Server Admins

#### 1. Lottery Creation

* Clear naming conventions
* Detailed descriptions
* Fair ticket prices
* Reasonable durations

#### 2. Prize Management

* Set appropriate winners
* Fair ticket limits
* Clear prize structure
* Regular monitoring

#### 3. User Experience

* Clear instructions
* Fair mechanics
* Regular updates
* Prompt management

### Important Notes

1. **Lottery Limits**
   * Free: 1 lottery
   * Pro: 5 lotteries
   * Enterprise: 25 lotteries
   * Case-sensitive names
2. **Ticket Settings**
   * Price must be positive
   * Duration in hours
   * Max tickets per user
   * Winner limits
3. **Image Requirements**
   * Must end with .png, .jpg, or .gif
   * Must be accessible
   * Should be appropriate size
   * Should match theme
4. **Management**
   * Regular monitoring
   * Fair administration
   * Clear communication
   * Prompt updates

### Troubleshooting

1. **Creation Issues**
   * Check name uniqueness
   * Verify parameters
   * Confirm limits
   * Check permissions
2. **Edit Problems**
   * Verify lottery exists
   * Check parameter validity
   * Confirm changes
   * Monitor updates
3. **Deletion**
   * Verify lottery name
   * Check case sensitivity
   * Confirm deletion
   * Monitor cleanup
