This is a Discord bot that integrates with LeetCode to provide daily challenges, random problems, user information, and more. It uses discord.js
for interacting with the Discord API and leetcode-query
for fetching data from LeetCode.
✨ Features
- Daily LeetCode Challenge notification
- Deliver random LeetCode problem
- Fetches user contest information
- User-friendly command list
📒 Commands
-
;potd
- Shows the LeetCode Daily Challenge -
;random
- Shows a random LeetCode problem -
;user <username>
- Shows user Info -
;streak <username>
- Shows user Streak Info -
;help
- Shows help message
⚙️ Installation
-
📂 Clone the repository:
git clone https://github.com/your-github-username/leetcode-discord-bot.git
-
📂 Navigate to the project directory:
cd DDoL
-
🛠 Install the dependencies:
npm install
-
🔐 Create a
.env
file in the root directory and add your Discord bot token and channel ID:TOKEN=your-discord-bot-token CHANNEL_ID=your-channel-id
Usage
🛠️ How to Set Up a Bot on Discord
-
Create a new application Go to the Discord Developer Portal and create a new application.
-
Configure
OAuth2
🔑 -
In your app's settings, navigate to OAuth2.
- Open the OAuth2 URL Generator and select the bot option.
- Under Bot Permissions, select Administrator.
- Set up the bot
-
Go to the
Bot
section and enable the following gateway intents:Server Members Intent
Message Content Intent
- Get your bot's
TOKEN
🔐 and Create a Discord server
-
Create a new server in Discord and retrieve the
Channel ID
where your bot will operate.
🚀 Usage
-
Start the
botbot 🤖:npm run start
-
Invite the bot to your Discord server using the OAuth2 URL generated from the Discord Developer Portal.
-
Use the commands in any channel the bot has access to.
✨ Contributing
Contributions are welcome! Please raise an issue with your changes.
License
🤝 How to Contribute
We appreciate your contributions! To get involved, follow these simple steps:
-
Fork the repository 🍴
Make a personal copy of the repository. -
Create a new branch 🌿
Start working on your changes in a separate branch for better tracking. -
Make your changes 🛠️
Update the code, fix bugs, or add new features! -
Commit and push your changes 💻
Make sure to include a clear commit message explaining what you’ve done. -
Submit a Pull Request (PR) 🪄
Once you're ready, open a PR for review.
Done! ✅ That's it—thanks for contributing! We’ll review your PR as soon as possible.
❤️ Our Valuable Contributors
🪄 License
This project is licensed under the MIT License. See the LICENSE file for details.