Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

markhenrick/mobilespoilers

Repository files navigation

Archived

This repo is now archived, and the public instance of the bot has been shut down (and associated database dropped). It needs some reworking to comply with the new changes to the Discord API and associated ToS, and I expected Discord will add native support for mobile spoilers soon anyway.

mobilespoilers

Java CI with Maven License: MIT

This bot is a temporary solution for a minor UI problem on Discord - there is no way to mark an image as a spoiler on mobile

This bot adds a !spoil command to do that

I've deliberately over-engineered this a bit to make it more fun. The main complication is that it persists who owns what spoilers, so the user can delete it later

It is currently very much a WIP

Invite

There is a public instance of this bot which can be invited with this link

docker-compose

Copy docker-compose.example.yml to docker-compose.yml and insert your settings, then run docker-compose up (use -d if you don't want to leave the terminal open)

Individual container

Pre-made image coming soon (tm)

The included Dockerfile is a multistage build + package job, so you can just run docker build -t mobilespoilers . without needing any dev tools installed. Spring supports reading properties from envvars, see docker-compose.example.yml for examples

Completely Manual Setup

  • I'm developing this on JDK 14 with preview features turned on, though at the moment only features up to JDK 11 have been used
  • You will need an empty PostgreSQL database
    • I would have used SQLite, but Spring-data doesn't support it at the moment
    • The user will need create table, insert, select, and delete privileges. It might be possible to seperate the first from the rest by using spring.flyway.user/password properties
    • Other databases will probably work as long as there is a JDBC driver on the classpath, Spring supports it, and it can execute the migrations (src/main/resources/db/migration)
  • Mandatory configuration can be found in application.example.yml. Edit and rename to application.yml in the directory of execution
  • Optional configuration can be found in src/main/resources/application.yml, or by reading MobileSpoilersConfig.java
  • A fat jar can be generated by ./mvnw package