Consider giving this a ⭐ to show your support! <3
Welcome to the Open-Source Discord Go Bot Template! This project is built using Go and comes with everything you need to get started on building your own Go powered discord bot. For a more detailed breakdown look at our Documentation.
- 🔒 Secure Configurations – Environment-based
.envfile setup - 📦 Modular Design – Easily extend and customize features
-
Clone the Repository:
gh https://github.com/ResyncedDesign/DiscordGoBot.git <folder-name> cd <folder-name>
-
Install Dependencies:
Run one of the following commands to install all required packages:
go mod tidy
-
Set Up Environment Variables:
Create a
.envfile in the root directory with the following structure:TOKEN=your_discord_bot_token CLIENTID=your_discord_application_client_id GUILDID=your_discord_guild_id -
Build and Start the Bot:
Compile the bot and start it using:
go build -o bot main.go ./bot
To invite the bot to your Discord server, follow these steps:
Note
Ensure you select all the intents for the bot to work.
-
Go to your Discord application's OAuth2 section in the Discord Developer Portal.
-
Generate an invite link using the bot's Client ID with the required scopes and permissions. Example link:
https://discord.com/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=8&integration_type=0&scope=applications.commands+bot -
Replace
YOUR_CLIENT_IDwith theCLIENT_IDfrom your.envfile. -
Open the link in a browser and add the bot to your desired server.
To start customizing, edit the files in the src directory. Key files include:
main.go– Main entry point for the bot.src/commands/categories– Directory containing bot commands (add new commands here).src/events/categories– Directory containing bot events (add new events here).src/types– Directory containing custom types and interfaces.src/config– Directory containing configuration files and environment variables.
Changes will take effect after rebuilding the project using:
go build -o bot main.go
./botOR you can use the following command to run the bot:
go run main.goContributions are welcome! Feel free to fork the repository and submit pull requests for improvements or new features.
If you have ideas for improving this bot or encounter any issues, feel free to open an issue or reach out. Happy coding! 🎉