GamblingBOT is a Discord bot that adds an engaging and interactive gambling and leveling system to your server. Users can gamble coins, invest in a dynamic cryptocurrency (FrostyCoin), answer gaming trivia questions, and level up to gain roles that represent their achievements.
!gamble [amount]
: 50/50 chance to double or lose the specified amount.!jp [amount] [multiplier]
: Set your own odds and multiplier for a jackpot win.
- Real-time updates to FrostyCoin price.
!buy [amount]
: Buy FrostyCoin at the current price.!sell [amount]
: Sell your FrostyCoin and gain profits (or losses).!fc
: Displays a graphical representation of FrostyCoin’s recent price history and user’s holdings.
!levelup [amount]
: Spend coins to level up. Levels scale exponentially in cost.- Automatically assigns roles based on levels:
- Bronze: Levels 0-100
- Silver: Levels 101-500
- Gold: Levels 501-1000
- Emerald: Levels 1000+
- Displays level and a role-based emoji in the user's nickname.
!earn
: Answer gaming-related trivia questions to earn coins.- Uses OpenAI to generate and evaluate questions and answers.
!leaderboard
: Displays the top 5 players based on coin balance and levels.
- Node.js installed on your system.
- A Discord bot token. Follow this guide.
- An OpenAI API key. Get it here.
-
Clone the repository:
git clone <repository-url> cd GamblingBot
-
Install dependencies:
npm install
-
Create a
.env
file:BOT_TOKEN=your-discord-bot-token OPENAI_API_KEY=your-openai-api-key
-
Run the bot:
node .
balances.json
: Stores user balances.levels.json
: Stores user levels.investments.json
: Tracks FrostyCoin investments.stockPrice.json
: Stores the current FrostyCoin price.priceHistory.json
: Tracks historical FrostyCoin prices.
- The bot announces significant FrostyCoin price changes (e.g., reaching 10 or exceeding 300) in a specific channel. Update the channel ID in
coinPrice.js
.
Feel free to submit issues or pull requests to improve GamblingBOT. Contributions are always welcome!
This project is licensed under the MIT License. See the LICENSE file for details.
- Discord.js for the Discord API wrapper.
- OpenAI for the trivia generation and evaluation.
- Inspiration from various Discord bots and gambling systems.