Skip to content

topi314/Reddit-Discord-Bot

Repository files navigation

Reddit-Discord-Bot

Simple webhook based bot delivering Reddit posts into your Discord Server

embed reddit post

text reddit post

The bot does not require any permissions and can't do anything in your Discord. With that it's safe to use!

Table of Contents

Public Bot

Invite the bot here

Usage

Add Subreddit

To add a new subreddit run

/reddit add <subreddit-name> (new/hot/top/rising) (embed/text)

and click the returned link

select the server & channel in the discord popup & hit okay that's all!

Update Subreddit

To update a subreddit run

/reddit update <subreddit-name> (new/hot/top/rising) (embed/text)

Remove Subreddit

To remove a subreddit subscriptions run

/reddit remove <subreddit-name>

and remove the bot under Server Settings > Integrations or just delete the webhook under Channel Settings > Integrations > Webhooks

List Subreddits

To list all subreddit subscriptions run

/reddit list (channel)

Self-hosted

Reddit-Discord-Bot is now super easy to self-host. You can either use the docker image or build a binary yourself.

Before you can run the bot you need to create a config file. You can find an example here

You also need a discord bot token, which you can get from here.

Lastly you need to create a reddit app which can be done here.

The bot requires a database, which can either be SQLite or PostgreSQL. Just select the one you want to use in the config file.

Binary

Prerequisites:

$ git clone git@github.com:topi314/Reddit-Discord-Bot.git
$ cd Reddit-Discord-Bot
$ go build -o reddit-discord-bot .

You can now run the bot with

$ ./reddit-discord-bot -config config.yml

Docker-Compose

Docker-Compose is the easiest way to run the bot and is also the way I recommend.

Prerequisites

Setup

Create a docker-compose.yml file and paste the following into it

version: "3.8"

services:
  reddit-bot:
    image: ghcr.io/topi314/reddit-discord-bot:v2
    container_name: reddit-bot
    restart: unless-stopped
    volumes:
      - ./config.yml:/var/lib/reddit-discord-bot/config.yml
      - ./database.db:/var/lib/reddit-discord-bot/database.db

Configuration

Create a config.yml file and paste this into it.

Fill in the required fields, and you are good to go!

Also create a database.db file if you want to use SQLite.

Running

You can now run the bot with

$ docker-compose up -d

Updating

To update the bot just run

$ docker-compose pull
$ docker-compose up -d

Stopping

To stop the bot run

$ docker-compose down

Help

If you encounter any problems feel free to open an issue or reach out to me(toπ#3141) via discord here

License

Reddit-Discord-Bot is licensed under the Apache License 2.0.

Contributing

Contributions are always welcome! Just open a pull request or discussion and I will take a look at it.

Contact