Discord Golang bot is a simple Discord bot built using Golang, primarily for study purposes. The bot can respond to various commands and provide users with images of cats and birds.
- Respond to
ping
command. - Send a random cat image with the
meow
command. - Send a random bird image with the
birb
command. - Periodically update a voice channel's name with the current number of Guilty Gear STRIVE players.
To use this project, you need to follow these steps:
- Clone the repository:
git clone https://github.com/MiguelMachado-dev/disc-go-bot.git
- Change directory to the cloned repository:
cd disc-go-bot
- Install the dependencies:
go mod download
- Create a .env file in the root directory of the project and add your Discord bot token:
DISCORD_BOT_TOKEN=your_bot_token
- Build the application:
go build
- Run the application:
./disc-go-bot
Now, your bot should be running and connected to Discord. Invite the bot to your server and start using the commands.
You can change some settings like prefix on .env
file.
>ping
: The bot will respond with "Pong!">meow
: The bot will send a random cat image.>birb
: The bot will send a random bird image.
The bot will also automatically update the specified voice channel's name every few minutes (30 minutes as default) to display the current number of Guilty Gear players.
The project includes a Makefile to help you manage common tasks more easily. Here's a list of the available commands and a brief description of what they do:
APP_NAME
: The name of the application (default:disc-go-bot
).IMAGE_TAG
: The Docker image tag (default:latest
).DOCKERFILE_PATH
: The path to the Dockerfile (default:Dockerfile
).PORT
: The port on which the application will be exposed (default:8080
).
- The default target, runs the
build
target.
- Builds the application using the Go compiler.
- Builds the Docker image for the application using the specified Dockerfile.
- Runs the application in a Docker container, exposing the specified port. This target depends on the
docker-build
target.
- Stops and removes the running Docker container.
- Cleans up build artifacts by removing the generated executable.
- Executes the tests for the application using the Go test tool.
- Builds and runs the application locally.
To use the Makefile, simply run the desired target using the make
command followed by the target name:
make build
This project uses the following tools:
- Golang for backend development
- DiscordGo package that provides low level bindings to the Discord chat client API
- Colly Elegant Scraper and Crawler Framework for Golang
To contribute to this project, please follow these guidelines:
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them using Conventional Commits
- Push to the branch:
git push origin feature/your-feature-name
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE.md file for details.
This project was created by MiguelMachado-dev.