From 5cccd603d090d83fbc2d13567166824b2c3b6b41 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Fri, 28 Jan 2022 07:55:03 +0700 Subject: [PATCH] communicationDisabledUntil: discord return string, discordeno return number --- src/transformers/member.ts | 8 +++++--- src/types/members/guildMember.ts | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/transformers/member.ts b/src/transformers/member.ts index b2a2ebcf9..0fa6e9a06 100644 --- a/src/transformers/member.ts +++ b/src/transformers/member.ts @@ -58,7 +58,9 @@ export function transformMember( cachedAt: Date.now(), avatar: payload.avatar ? bot.utils.iconHashToBigInt(payload.avatar) : undefined, permissions: payload.permissions ? bot.transformers.snowflake(payload.permissions) : undefined, - communicationDisabledUntil: payload.communication_disabled_until, + communicationDisabledUntil: payload.communication_disabled_until + ? Date.parse(payload.communication_disabled_until) + : null, }; } @@ -87,6 +89,6 @@ export interface DiscordenoMember { avatar?: bigint; /** The permissions this member has in the guild. Only present on interaction events. */ permissions?: bigint; - /** when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future), set to null to remove timeout. Requires the `MODERATE_MEMBERS` permission */ - communicationDisabledUntil?: number; + /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */ + communicationDisabledUntil?: number | null; } diff --git a/src/types/members/guildMember.ts b/src/types/members/guildMember.ts index d22a20f2c..1cfa81a68 100644 --- a/src/types/members/guildMember.ts +++ b/src/types/members/guildMember.ts @@ -22,8 +22,8 @@ export interface GuildMember { pending?: boolean; /** The permissions this member has in the guild. Only present on interaction events. */ permissions?: string; - /** when the user's [timeout](https://support.discord.com/hc/en-us/articles/4413305239191-Time-Out-FAQ) will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */ - communicationDisabledUntil?: string; + /** when the user's timeout will expire and the user will be able to communicate in the guild again, null or a time in the past if the user is not timed out */ + communicationDisabledUntil?: string | null; } // We use these types much since user always exists unless its a `CREATE_MESSAGE` or `MESSAGE_UPDATE` event