communicationDisabledUntil: discord return string, discordeno return number

This commit is contained in:
lts20050703
2022-01-28 07:55:03 +07:00
parent 6957d2ea5b
commit 5cccd603d0
2 changed files with 7 additions and 5 deletions

View File

@@ -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;
}

View File

@@ -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