mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 17:00:08 +00:00
feat(bot,types): Add name and size to FileComponent (#4224)
* feat(bot,types): Add name and size to FileComponent * fix ci * more fix ci --------- Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This commit is contained in:
@@ -317,6 +317,8 @@ export function createDesiredPropertiesObject<T extends RecursivePartial<Transfo
|
||||
file: defaultValue,
|
||||
media: defaultValue,
|
||||
accentColor: defaultValue,
|
||||
name: defaultValue,
|
||||
size: defaultValue,
|
||||
...desiredProperties.component,
|
||||
},
|
||||
forumTag: {
|
||||
|
||||
@@ -232,6 +232,8 @@ function transformFileComponent(bot: Bot, payload: DiscordFileComponent): Compon
|
||||
if (props.id && payload.id) file.id = payload.id
|
||||
if (props.file && payload.file) file.file = bot.transformers.unfurledMediaItem(bot, payload.file)
|
||||
if (props.spoiler && payload.spoiler) file.spoiler = payload.spoiler
|
||||
if (props.name && payload.name) file.name = payload.name
|
||||
if (props.size && payload.size) file.size = payload.size
|
||||
|
||||
return file
|
||||
}
|
||||
|
||||
@@ -171,6 +171,8 @@ function transformFileComponent(bot: Bot, payload: Component): DiscordFileCompon
|
||||
id: payload.id,
|
||||
file: bot.transformers.reverse.unfurledMediaItem(bot, payload.file!),
|
||||
spoiler: payload.spoiler,
|
||||
name: payload.name!,
|
||||
size: payload.size!,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -570,6 +570,10 @@ export interface Component {
|
||||
media?: UnfurledMediaItem
|
||||
/** Color for the accent on the container as RGB from 0x000000 to 0xFFFFFF */
|
||||
accentColor?: number
|
||||
/** The name of the file. This field is ignored and provided by the API as part of the response */
|
||||
name?: string
|
||||
/** The size of the file in bytes. This field is ignored and provided by the API as part of the response */
|
||||
size?: number
|
||||
}
|
||||
|
||||
export interface UnfurledMediaItem {
|
||||
|
||||
@@ -296,6 +296,10 @@ export interface DiscordFileComponent extends DiscordBaseComponent {
|
||||
file: DiscordUnfurledMediaItem
|
||||
/** Whether the media should be a spoiler (or blurred out). Defaults to `false` */
|
||||
spoiler?: boolean
|
||||
/** The name of the file. This field is ignored and provided by the API as part of the response */
|
||||
name: string
|
||||
/** The size of the file in bytes. This field is ignored and provided by the API as part of the response */
|
||||
size: number
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
||||
|
||||
@@ -383,6 +383,10 @@ export interface FileComponent extends BaseComponent {
|
||||
file: DiscordUnfurledMediaItem
|
||||
/** Whether the media should be a spoiler (or blurred out). Defaults to `false` */
|
||||
spoiler?: boolean
|
||||
/** The name of the file. This field is ignored and provided by the API as part of the response */
|
||||
name: string
|
||||
/** The size of the file in bytes. This field is ignored and provided by the API as part of the response */
|
||||
size: number
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/components/reference#separator */
|
||||
|
||||
Reference in New Issue
Block a user