Introduction
This is a Discord bot that integrates with LeetCode to provide daily challenges, random problems, user information, and more. It uses discord.js
for interactingto interact with the Discord API and leetcode-query
for fetchingto fetch data from LeetCode.
📒 Commands
The bot does not use the traditional message command approach; instead, it uses a slash commandscommand approach. This means that when you type /
, you will see a list of available commands in the guild. The commands provided by this bot are:
-
/potd
- Shows the LeetCode Daily Challenge -
/random <easy/medium/hard>
- Shows a random LeetCode problem -
/user <username>
- ShowsuUser Info -
/streak <username>
- Shows user Streak Info -
/help
- Shows help message -
/topic
- Shows a list of LeetCode topics to choose from
🚀 Usage
-
Start the bot 🤖:
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.
-
Register slash commands in your guild using
;register guild <your server ID>
.Do notPlease don't provide the server ID if you want to register commands in your current guild. -
If you want to register slash commands in all guilds, ignore the 4th step and run
;register global