From 63096d807dfb28db73390b7aedb1ac7117e787f6 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Fri, 5 Feb 2021 22:29:00 +0200 Subject: [PATCH] chore: add missing audit log keys (#81) ref: https://github.com/discord/discord-api-docs/pull/2570 --- v8/payloads/auditLog.ts | 50 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/v8/payloads/auditLog.ts b/v8/payloads/auditLog.ts index 12cfdd3f..853b9d3d 100644 --- a/v8/payloads/auditLog.ts +++ b/v8/payloads/auditLog.ts @@ -233,12 +233,18 @@ export const enum AuditLogOptionsType { */ export type APIAuditLogChange = | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyDescription | APIAuditLogChangeKeyIconHash | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeyDiscoverySplashHash + | APIAuditLogChangeKeyBannerHash | APIAuditLogChangeKeyOwnerID | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeyPreferredLocale | APIAuditLogChangeKeyAFKChannelID | APIAuditLogChangeKeyAFKTimeout + | APIAuditLogChangeKeyRulesChannelID + | APIAuditLogChangeKeyPublicUpdatesChannelID | APIAuditLogChangeKeyMFALevel | APIAuditLogChangeKeyVerificationLevel | APIAuditLogChangeKeyExplicitContentFilter @@ -278,13 +284,19 @@ export type APIAuditLogChange = | APIAuditLogChangeKeyType | APIAuditLogChangeKeyEnableEmoticons | APIAuditLogChangeKeyExpireBehavior - | APIAuditLogChangeKeyExpireGracePeriod; + | APIAuditLogChangeKeyExpireGracePeriod + | APIAuditLogChangeKeyUserLimit; /** * Returned when a guild's name is changed */ export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>; +/** + * Returned when a guild's description is changed + */ +export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description', string>; + /** * Returned when a guild's icon is changed */ @@ -296,7 +308,17 @@ export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', strin export type APIAuditLogChangeKeySplashHash = AuditLogChangeData<'splash_hash', string>; /** - * Returned when a guild's owner ID is changed + * Returned when a guild's discovery splash is changed + */ +export type APIAuditLogChangeKeyDiscoverySplashHash = AuditLogChangeData<'discovery_splash_hash', string>; + +/** + * Returned when a guild's banner hash is changed + */ +export type APIAuditLogChangeKeyBannerHash = AuditLogChangeData<'banner_hash', string>; + +/** + * Returned when a guild's owner_id is changed */ export type APIAuditLogChangeKeyOwnerID = AuditLogChangeData<'owner_id', Snowflake>; @@ -305,6 +327,11 @@ export type APIAuditLogChangeKeyOwnerID = AuditLogChangeData<'owner_id', Snowfla */ export type APIAuditLogChangeKeyRegion = AuditLogChangeData<'region', string>; +/** + * Returned when a guild's preferred_locale is changed + */ +export type APIAuditLogChangeKeyPreferredLocale = AuditLogChangeData<'preferred_locale', string>; + /** * Returned when a guild's afk_channel_id is changed */ @@ -315,6 +342,16 @@ export type APIAuditLogChangeKeyAFKChannelID = AuditLogChangeData<'afk_channel_i */ export type APIAuditLogChangeKeyAFKTimeout = AuditLogChangeData<'afk_timeout', number>; +/** + * Returned when a guild's rules_channel_id is changed + */ +export type APIAuditLogChangeKeyRulesChannelID = AuditLogChangeData<'rules_channel_id', string>; + +/** + * Returned when a guild's public_updates_channel_id is changed + */ +export type APIAuditLogChangeKeyPublicUpdatesChannelID = AuditLogChangeData<'public_updates_channel_id', string>; + /** * Returned when a guild's mfa_level is changed */ @@ -523,10 +560,17 @@ export type APIAuditLogChangeKeyExpireBehavior = AuditLogChangeData<'expire_beha export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_grace_period', number>; /** - * @internal + * Returned when a voice channel's user_limit is changed */ +export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>; + interface AuditLogChangeData { key: K; + /** + * The new value + * + * If not present, it can mean the value the key denotes has been set to `null` + */ new_value?: D; old_value?: D; }