Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
- Loading branch information
1 parent
60c38fd
commit 7d873f7
Showing
7 changed files
with
104 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Types extracted from https://discord.com/developers/docs/resources/template | ||
*/ | ||
|
||
import type { APIUser } from './user'; | ||
import type { RESTPostAPIGuildsJSONBody } from '../rest'; | ||
|
||
/** | ||
* https://discord.com/developers/docs/resources/template#template-object | ||
*/ | ||
export interface APITemplate { | ||
code: string; | ||
name: string; | ||
description: string | null; | ||
usage_count: number; | ||
creator_id: string; | ||
creator: APIUser; | ||
created_at: string; | ||
updated_at: string; | ||
source_guild_id: string; | ||
serialized_source_guild: APITemplateSerializedSourceGuild; | ||
is_dirty: boolean | null; | ||
} | ||
|
||
export interface APITemplateSerializedSourceGuild extends Omit<RESTPostAPIGuildsJSONBody, 'icon'> { | ||
description: string | null; | ||
preferred_locale: string; | ||
icon_hash: string | null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import type { APIGuild, APITemplate } from '../payloads'; | ||
|
||
/** | ||
* https://discord.com/developers/docs/resources/template#get-template | ||
*/ | ||
export type RESTGetAPITemplateResult = APITemplate; | ||
|
||
/** | ||
* https://discord.com/developers/docs/resources/template#create-guild-from-template | ||
*/ | ||
export interface RESTPostAPITemplateCreateGuildJSONBody { | ||
name: string; | ||
icon?: string; | ||
} | ||
/** | ||
* https://discord.com/developers/docs/resources/template#create-guild-from-template | ||
*/ | ||
export type RESTPostAPITemplateCreateGuildResult = APIGuild; | ||
|
||
export type RESTGetAPIGuildTemplatesResult = APITemplate[]; | ||
|
||
export interface RESTPostAPIGuildTemplatesJSONBody { | ||
name: string; | ||
description?: string | null; | ||
} | ||
export type RESTPostAPIGuildTemplatesResult = APITemplate; | ||
|
||
export type RESTPutAPIGuildTemplateSyncResult = APITemplate; | ||
|
||
export type RESTPatchAPIGuildTemplateJSONBody = Partial<RESTPostAPIGuildTemplatesJSONBody>; | ||
export type RESTPatchAPIGuildTemplateResult = APITemplate; | ||
|
||
export type RESTDeleteAPIGuildTemplateResult = APITemplate; |