Implement Discord appeal functionality, including database schema, API endpoints, front-end form, and Discord message handling.

This commit is contained in:
2025-11-22 22:26:40 +01:00
parent 20ec3648c4
commit 7d59885395
30 changed files with 1143 additions and 38 deletions
+2
View File
@@ -59,6 +59,8 @@ paths:
$ref: './schemas/bans/bans.yml#/removePunishment'
/api/appeal/update-mail:
$ref: './schemas/forms/appeal/appeal.yml#/UpdateMail'
/api/appeal/discord/getBannedUser:
$ref: './schemas/forms/appeal/discordAppeal.yml#/getBannedUser'
/api/appeal/minecraft-appeal:
$ref: './schemas/forms/appeal/appeal.yml#/MinecraftAppeal'
/api/appeal/discord-appeal:
@@ -119,23 +119,20 @@ components:
type: object
description: Schema for Discord ban/punishment appeals
required:
- email
- punishmentId
- discordId
- appeal
- email
properties:
userId:
discordId:
type: integer
format: int64
description: Discord user ID of the appealing user
email:
type: string
description: Contact email address of the appealing user
punishmentId:
type: integer
description: Unique identifier of the punishment being appealed
description: Discord user's unique identifier'
appeal:
type: string
description: Appeal text explaining why the punishment should be reconsidered
email:
type: string
description: Contact email address of the appealing user
UpdateMail:
type: object
required:
@@ -0,0 +1,57 @@
getBannedUser:
post:
tags:
- appeals
summary: get banned user
description: Get a banned user by their discord id
operationId: getBannedUser
parameters:
- name: discordId
in: query
required: true
description: The discord id of the user
schema:
type: integer
format: int64
responses:
'200':
description: Banned user
content:
application/json:
schema:
$ref: '#/components/schemas/BannedUserResponse'
default:
description: Unexpected error
content:
application/json:
schema:
$ref: '../../generic/errors.yml#/components/schemas/ApiError'
components:
schemas:
BannedUserResponse:
type: object
required:
- isBanned
properties:
isBanned:
type: boolean
description: Whether the user is banned
bannedUser:
$ref: '#/components/schemas/BannedUser'
BannedUser:
type: object
required:
- userId
- reason
- name
- avatarUrl
properties:
userId:
type: integer
format: int64
reason:
type: string
name:
type: string
avatarUrl:
type: string