DEV Community

Rudy Chung
Rudy Chung

Posted on • Updated on

My First Hacktoberfest PR

What I Worked On

It was a struggle finding a good issue to work on, but finally I finished my first Hacktoberfest PR on Golly Bot. This is a Discord bot that is written using Go. The issue was adding a feature to a Discord bot that sent a message every time a user leaves a channel. I had learned the syntax for Go very briefly through working on another repo that used Go, but I was not familiar with how to make a Discord bot.

The Learning Curve

I had no idea how Discord bots worked, so had to follow some instructions in order to get it set up. I had to access the Discord developer portal to set up the bot and obtain a few keys. Then I needed to create a Discord server to test the bot in. After that, the process of testing the bot was straightforward. The initial setup of the bot had somewhat of a learning curve, since I was not familiar with Discord bots. Then, since I was not very experienced in Go, reading the source code for the bot took a little more effort.

My Contribution

My PR was heavily built off the structure of an earlier PR which sent a welcome message when a user joined a channel. It heavily uses the discordgo module that was designed for creating Discord bots using Go. It sends a message that tags the leaving user as well as embeds a stock image to the message. Then it sends that message to the general chat if it is available, or any other channel if a general chat does not exist.

The bot in action

Top comments (0)