summary refs log tree commit diff
path: root/src/schemas/api/developers/Application.ts
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-10-15 10:07:33 +0200
committerRory& <root@rory.gay>2025-10-15 10:07:33 +0200
commit1632642b0d1df2590eced3069d1b0f2b4df5210c (patch)
tree982e2a20d44bbeacacc9a55358c17f95d7dcbf5d /src/schemas/api/developers/Application.ts
parentReorganise schemas a little bit (diff)
downloadserver-ts-1632642b0d1df2590eced3069d1b0f2b4df5210c.tar.xz
More schema work, moved most stuff from entities to schemas, though messy
Diffstat (limited to 'src/schemas/api/developers/Application.ts')
-rw-r--r--src/schemas/api/developers/Application.ts62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/schemas/api/developers/Application.ts b/src/schemas/api/developers/Application.ts
new file mode 100644

index 00000000..8ef679e2 --- /dev/null +++ b/src/schemas/api/developers/Application.ts
@@ -0,0 +1,62 @@ +/* + Spacebar: A FOSS re-implementation and extension of the Discord.com backend. + Copyright (C) 2023 Spacebar and Spacebar Contributors + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. +*/ + +export interface ApplicationCommand { + id: string; + application_id: string; + name: string; + description: string; + options?: ApplicationCommandOption[]; +} + +export interface ApplicationCommandOption { + type: ApplicationCommandOptionType; + name: string; + description: string; + required?: boolean; + choices?: ApplicationCommandOptionChoice[]; + options?: ApplicationCommandOption[]; +} + +export interface ApplicationCommandOptionChoice { + name: string; + value: string | number; +} + +export enum ApplicationCommandOptionType { + SUB_COMMAND = 1, + SUB_COMMAND_GROUP = 2, + STRING = 3, + INTEGER = 4, + BOOLEAN = 5, + USER = 6, + CHANNEL = 7, + ROLE = 8, +} + +export interface ApplicationCommandInteractionData { + id: string; + name: string; + options?: ApplicationCommandInteractionDataOption[]; +} + +export interface ApplicationCommandInteractionDataOption { + name: string; + value?: unknown; + options?: ApplicationCommandInteractionDataOption[]; +}