fix(types): handle communicationDisabledUntil correctly (#1999)

* types(GuildMemberUpdate): fix invalid type for `communicationDisabledUntil`

* types(transformers): parse `communicationDisabledUntil`
This commit is contained in:
ITOH
2022-02-04 22:40:09 +01:00
parent f6e75fc328
commit 943e7af5ec
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -70,7 +70,9 @@ export function transformMessage(bot: Bot, payload: SnakeCasedPropertiesDeep<Mes
: undefined,
permissions: payload.interaction.member.permissions
? bot.transformers.snowflake(payload.interaction.member.permissions) : undefined,
communicationDisabledUntil: payload.interaction.member.communication_disabled_until,
communicationDisabledUntil: payload.interaction.member.communication_disabled_until
? Date.parse(payload.interaction.member.communication_disabled_until)
: undefined,
}
: undefined,
}
+1 -1
View File
@@ -23,5 +23,5 @@ export interface GuildMemberUpdate {
/** Whether the user has not yet passed the guild's Membership Screening requirements */
pending?: boolean;
/** 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?: number;
communicationDisabledUntil?: string;
}