Rename channel.autoArchiveDuration to defaultAutoArchiveDuration (#3741)

This commit is contained in:
Fleny
2024-07-13 08:19:26 -05:00
committed by GitHub
parent 6cf16bdc6b
commit 727c7104ed
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -227,6 +227,7 @@ export interface Transformers {
memberCount: boolean
messageCount: boolean
archiveTimestamp: boolean
defaultAutoArchiveDuration: boolean
autoArchiveDuration: boolean
botIsMember: boolean
archived: boolean
@@ -847,6 +848,7 @@ export function createTransformers(options: Partial<Transformers>, opts?: Create
memberCount: opts?.defaultDesiredPropertiesValue ?? false,
messageCount: opts?.defaultDesiredPropertiesValue ?? false,
archiveTimestamp: opts?.defaultDesiredPropertiesValue ?? false,
defaultAutoArchiveDuration: opts?.defaultDesiredPropertiesValue ?? false,
autoArchiveDuration: opts?.defaultDesiredPropertiesValue ?? false,
botIsMember: opts?.defaultDesiredPropertiesValue ?? false,
archived: opts?.defaultDesiredPropertiesValue ?? false,
+3 -3
View File
@@ -93,8 +93,8 @@ export function transformChannel(bot: Bot, payload: { channel: DiscordChannel }
if (props.autoArchiveDuration && payload.channel.thread_metadata?.auto_archive_duration)
channel.internalThreadMetadata.autoArchiveDuration = payload.channel.thread_metadata.auto_archive_duration
}
if (props.autoArchiveDuration && payload.channel.default_auto_archive_duration)
channel.autoArchiveDuration = payload.channel.default_auto_archive_duration
if (props.defaultAutoArchiveDuration && payload.channel.default_auto_archive_duration)
channel.defaultAutoArchiveDuration = payload.channel.default_auto_archive_duration
if (props.permissions && payload.channel.permissions) channel.permissions = new Permissions(payload.channel.permissions)
if (props.flags) channel.flags = payload.channel.flags
if (props.permissionOverwrites && payload.channel.permission_overwrites)
@@ -187,7 +187,7 @@ export interface Channel extends BaseChannel {
/** Thread member object for the current user, if they have joined the thread, only included on certain API endpoints */
member?: DiscordThreadMember
/** Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 */
autoArchiveDuration?: number
defaultAutoArchiveDuration?: number
/** computed permissions for the invoking user in the channel, including overwrites, only included when part of the resolved data received on a slash command interaction. This does not include implicit permissions, which may need to be checked separately. */
permissions?: Permissions
/** The flags of the channel */