DEV Community

Artem Tanyhin
Artem Tanyhin

Posted on

1

Discord bots are cool!

Hey there!

This post is a follow-up to my previous one, where I discussed my plans for making a bigger contribution than I have ever before.

If you remember, I was talking about adding a feature to a Discord bot called wego-overseer. I have made some progress, so let me tell you how it went.

Project set-up

In regards to installation, there was little to no issues. It is written in TypeScript, and uses yarn as the package manager.

I have never worked with yarn, and downloaded a wrong experimental version by accident... but regardless, everything code-related was set up, but the bot wouldn't just work like that. First, I needed to set up my Discord account and bot.

Adding an application and a bot to my account

Discord has a very thorough beginner's guide, which I used as a reference.

First, I created an application for this bot and any potential future ones I might develop. I made sure to capture the Application ID, and went ahead to creating the bot.

Under Bot section, I created a new one and took a note of the token for the project to be able to run. Then, I went to OAuth settings, checked needed permissions and retrieved a bot-invite URL, where I invited the bot to my test server.

All I needed to do from this point on was to run the code, and the bot finally came to life!

Coding progress so far

I began from creating a simple command like Hello World. Thank you to the project team for the great guide on their README on how to do it!

After I created and tested the new command, I started adding more relatable logic, which included a lot of documentation-searching and researching, since I have never worked with anything like that before.

In the end, I ended up with a simple poll logic of "yes", "no", and "unsure".

Finishing up (until next addition)

After I have completed a simple implementation of the feature, I opened a draft pull request, and asked the maintainers for some feedback on the work and on my ideas.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay