Discord Bot for GNOME Nepal Discord Server.
- Node.js installed (v16.6.0 or later recommended).
- A Discord account with access to the Discord Developer Portal.
- Log in to the Discord Developer Portal.
- Click on New Application to create a new bot application.
- Copy the Client ID from the application settings.
- Navigate to the Bot section, click Add Bot, and copy the Token.
- Go to the OAuth2 section, select URL Generator, and enable the following scopes:
bot
applications.commands
- Under Bot Permissions, select the permissions your bot needs (for now
Send Messages
,Read Message History
, etc.). - Copy the generated URL and use it to invite the bot to your server.
- Clone or download this repository.
- Install dependencies:
npm install
- Create a
config.json
file in the project root and add the following keys:Replace{ "CLIENT_ID": "your-client-id", "TOKEN": "your-bot-token", "GUILD_ID": "your-guild-id", "MOD_ROLE_ID": "your-mod-role-id" }
your-client-id
,your-bot-token
,your-mod-role-id
andyour-guild-id
with the respective values from the Discord Developer Portal & Server.
Start the bot in development mode:
npm run dev
If successful, you will see the following logs:
Registering slash commands...
Slash commands registered successfully!
Logged in as <Your Bot's Username>
In your Discord server, type /help
to see the list of available slash commands.
Use $sudo help
to see the list of available prefix commands.
index.js
: Main script for the bot's functionality.config.json
: Configuration file for sensitive credentials.Src/General/userhelp.js
: Contains the prefix help command.Src/Slash-Commands/help.js
: Contains the slash help command.Src/Moderation/purge.js
: Contains the purge command.
Install dependencies using:
npm install discord.js
npm install discord.js @discordjs/builders
Contributions are welcome! Feel free to fork the project and submit a pull request. This update includes the latest commands and project structure.