Table of Contents
There are many great Discord bots out there, but I wanted to develop my own. I wanted the freedom of being able to easily add my own commands and tailor it to my own needs. After thinking a bit about which language to use, I decided on developing it in Go. I decided on Go after my newfound love for the programming language after the cloud technologies course I had during my bachelor in programming. Of course this Discord bot may not cover all of your own needs, but you're more than welcome to fork this repo and change it how you like.
This discord bot is built with:
To get a local copy up and running follow these simple example steps.
In order to run this project you will need the following:
- Go 1.21 installed
- Docker and Docker Compose v2 installed
- Discord account
- Google developer account
-
Go to the Discord developer portal
-
Create a new application
-
Add a bot user to the application
-
Get the token for the bot
-
Clone the repository
git clone https://github.com/Dahl99/discordbot.git
-
Install dependencies
go mod download all
-
Create the environment variables file
.env
from the.env.example
file in the root folder and add the following:APP_ENVIRONMENT=LOCAL or TEST or PRODUCTION BOT_PREFIX="Your prefix for bot commands" BOT_STATUS="Your bot status message" BOT_GUILD_JOIN_MESSAGE="Your bot guild join message" DISCORD_TOKEN=Your discord token YOUTUBE_API_KEY=Your youtube api key
To run the discord bot from root directory, execute the following command
go run cmd/discordbot/main.go
Or to start the docker containers using docker compose V2
docker compose up -d
Project Link: https://github.com/Dahl99/discordbot