-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Is your feature request related to a problem? Please describe.
We are currently using Airtable for unban requests. This has the following issues:
- We are dependent on Airtable and there is no notification we get in Discord when we get an unban request.
- People could theoretically send unban requests on behalf of someone else.
- It's hard to notify people when they are unbanned because often there's no mutual server between moderators and the banned user.
Describe the solution you'd like
When a user gets banned, their ban message would include a link button to some api.discordjug.net site (e.g. https://api.discordjug.net/guilds/{guildId}/unban. the host should be configurable).
When a user tries to access that page, they have to log in via Discord OAuth2 (scope identify should be sufficient as we only need the Discord ID).
After logging in, one of the following should happen (could be e.g. different HTML files in src/main/resources/static):
- If they are banned but recently submitted an unban request (e.g. within the last month, information about the submission time can be added to the
form_submissionstable), they should be see that they are currently banned but cannot submit an unban request cause they recently did so - If they are banned, they should be able see a form (configurable via Forms system #524 but displayed by the bot).
- If they are not banned, they should be informed that they aren't banned and that they can rejoin at https://join.discordjug.net/ (configurable URL).
Once the form is submitted (make sure to require a CSRF token or the verification that the Discord OAuth2 login worked as well as add the other necessary checks), the normal submission process for that form should be triggerd (information sent to channel) and the user should be told that their unban request is submitted and that they can view whether they are banned on the aforementioned page.
I suggest serving everything necessary via api.discordjug.net and use a normal HTML form for making the request (e.g. redirecting them back to the same page saying their form has been submitted). Alternatively, it would also be possible to add the frontend to https://github.com/Java-Discord/JavaDiscordWebsite/ but I think that would be unnecessary work.
This functionality should be done without the use of any Frontend libraries/framework (except maybe Bootstrap). While some effort should be made to make it look acceptable, it doesn't need to be a complex frontend.
Please don't force dark mode on people with that.
Describe alternatives you've considered
- Stay with Airtable. This would have the aforementioned issues.
- Create a Discord button and use in-app forms. Users don't seem to be able to use buttons of bots without mutual guilds (even if the message was sent with a mutual guild existing) so this wouldn't work.
- To get around that, it would be possible to make the bot a user-installable app and requiring users to install it to create an unban request. This seems unreasonable for writing unban requests.
Additional context
Depends on #524