A simple Discord bot that generates random discount codes and percentages when prompted.
- Generates random 6-character discount codes (uppercase letters + digits)
- Creates random discount percentages between 20-30%
- Displays the discount information in an attractive embed format
- Responds to the
.discountcommand
- Python 3.8 or higher
- discord.py library
- A Discord bot token
- Clone this repository or download the bot files
- Install the required dependencies:
pip install discord.py - Create a
config.pyfile with your bot token:TOKEN = "your-bot-token-here"
- Invite your bot to your Discord server
- In any channel the bot has access to, type:
.discount - The bot will respond with a randomly generated discount code and percentage
The bot can be easily modified by editing the following values in the code:
- Change the command trigger by modifying
if message.content == '.discount' - Adjust discount percentage range in
random.randint(20, 30) - Modify the discount code length by changing
k=6in the code generation
discord_discount_bot/
├── bot.py # Main bot script
├── config.py # Configuration file (contains bot token)
├── README.md # This documentation
This project is open source and available under the MIT License.