https://github.com/pungrumpy/discord-bot-go
A secure, Dockerized Discord bot written in Go, featuring command handling, environment variable support, and a Go server for status monitoring and alerts.
https://github.com/pungrumpy/discord-bot-go
discord discord-bot discordgo golang
Last synced: 4 months ago
JSON representation
A secure, Dockerized Discord bot written in Go, featuring command handling, environment variable support, and a Go server for status monitoring and alerts.
- Host: GitHub
- URL: https://github.com/pungrumpy/discord-bot-go
- Owner: PunGrumpy
- License: mit
- Created: 2023-05-10T07:52:55.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-30T13:34:19.000Z (over 2 years ago)
- Last Synced: 2025-04-02T23:41:40.716Z (11 months ago)
- Topics: discord, discord-bot, discordgo, golang
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Discord Bot in Go
This project is a Discord bot written in Go. It uses the discordgo package and includes a variety of features, such as command handling, environment variable configuration, Docker deployment, and a server for status monitoring and alerts.
## Features
- Command handling: The bot is capable of handling various commands and responds accordingly.
- Environment variable configuration: Both `.env` file and system environment variables are supported for configuration.
- Docker deployment: The bot is containerized using Docker, which makes it easy to deploy anywhere.
- Server for status monitoring and alerts: A server written in Go monitors the status of the bot and sends alerts when the bot is down or encounters issues.
## Setup and Running
1. Clone this repository.
```bash
git clone https://github.com/PunGrumpy/discord-bot-go.git
cd discord-bot-go
```
2. Create a `.env` file in the root of the project and fill in your Discord bot token and guild id:
```bash
BOT_TOKEN=your_bot_token
```
3. Create a `server.crt` and `server.key` file in the root of the project for HTTPS support. You can use the following command to generate a self-signed certificate:
```bash
openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 -nodes # 1 year
```
3. Build the Docker image and start the services:
```bash
docker-compose up -d
# or
docker compose up -d
```
The bot should now be running in your Discord server, and the status monitoring server should be available at `http://localhost:8080`.
# License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.