This is a versatile Discord bot primarily designed for Reddit, capable of fetching posts from Reddit and posting them in Discord channels.
Firebase Storage allows direct embedding of Reddit videos in Discord. Alternatively, any video hosting site can be used.
Discord API - JDA Wrapper
Create reddit personal use script here to obtain client_id
and client_secret
.
Obtain a Reddit refresh token following these instructions.
After getting reddit environments edit the application.yaml.
Obtain the Firebase Storage ADMIN SDK KEY from here
From the Firebase console (your project > settings > users and permissions > service accounts), generate a private key and download it then add it to the project root.
Also from (settings > general) note your Project ID
and append .appspot.com
to end of it, it should be something like this.
your-project-id.appspot.com
Edit bucket name and file name in application.yaml.
Example yaml:
firebase:
storage:
bucket:
name: your-project-id.appspot.com
adminsdk:
file:
name: your-admin-sdk.json
Obtain the Discord API bot token from here.
Find the ID of your main/admin server (only admin commands can be used in this server).
Find the ID of your Discord user (this determines who the bot admin is).
First you need to turn on developer mode in the discord app.
User settings > under app settings > advanced > turn on developer mode.
Now by right clicking any server or user you can get id of them.
After obtaining all necessary environment details, edit application.yaml.
Simply use the Docker Compose:
docker compose up
If you don't want to use docker then you should create a database called reddit_bot
manually.
Thanks to Spring Boot JPA it will auto generate tables when the bot first run.