Building Hashnode's Discord Bot - What, why and how?
2 min read
2 days ago I set out to create the first ever Discord bot for the Hashnode platform. Today marks the day of its first release.
In this article I will go over what it does/how it does it, why I made it, and how you can set it up on your own discord!
But before that, you can invite it to your own server here
The Hashnode Discord bot currently doesn't have many features but aims to do what I and others need for their own Discord. I am open to suggestions and pull requests on its GitHub repository
The bot's main feature is allowing you to subscribe a channel on your Discord server to a specific Hashnode blog. Whether it's your own or another person's, the bot does this.
It does this by keeping a cache of all posts it has encountered and requesting information from the Hashnode API every 30 seconds and then works out what to post and where to post it.
As I previously mentioned, the Hashnode Discord bot aims to give me and others a way to integrate their or other's Hashnode blogs with their Discord servers, easily, and reliably.
So far this has been achieved and I am hoping to add new features that will achieve this further.
To use this bot, you first must invite the bot using the link at the start of this article.
Then, go into any channel the bot has access to and run
?assign blogname #channel. If something goes wrong the bot will tell you. Within 15 seconds after doing this the bot will send 6 of your most recent blog posts (if you have that many, less if not)
Here is what my Discord looks like