Setting up Red Discord Bot

The Catalyst

If you didn't know, Discord is a platform for text and voice chatting. Sometimes people like to queue up things to listen to while in voice calls, but Discord does not facilitate this behavior. So, you have to use third party bots to get the content you want. Unfortunately, youtube has shut down many of these bots due to terms of service violations. Additionally, I was using the SocialFeeds bot to try post RSS feeds (learn about the meme feed here). However, it was completely non-functional.

The Investigation

For these reasons I decided to self-host my own bot. I could try to create my own discord bot, but that is a lot of work, so I did research on what options were available. I ultimately settled on Red Discord Bot, because it is open source, regularly maintained, extensible and had my two main requirements for RSS feed posting and youtube audio streaming.

The Installation

One of the things Red requires is a database for storage. I already have a postgres instance running in docker, so I created the database. One thing that was not mentioned in the documentation that I had to do was grant necessary permissions.

add user red-discordbot grant all on schema public to "red-discordbot" grant all privileges on database "Red-DiscordBot" to "red-discordbot"

Dockerize It

I wanted a container for the bot, because I don't like running almost anything directly on my machine. After some digging, I chose stelfux's Dockerfile. Unfortunately, I could not get the automatic update functionality to work. I think it has something to do with file permissions, but don't have enough of a reason to spend time getting that to work when I can just docker exec the command to update red every once in a while.

Pasted image 20211031201651.png

The red-discordbot container running on the image built from stelfux's Dockerfile

Discord Configuration

The final step was to configure the bot on Discord's end. The important thing for me here was the name and picture.

Pasted image 20211031194508.png

The bot name and appearance

Make sure you load the audio module to get the music streaming working. The RSS functionality is in a third party plugin from aikaterna. Read the documentation for instructions on how to install third party "cogs".

Really the only thing I need is a twitter feed reader plugin for this bot, because SocialFeeds has become pretty unreliable. I might have to make my own because there's still no option that I can find at least.