Skip to content

Commit

Permalink
feat(GatewayDispatchEvents): add GuildAuditLogEntryCreate (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Jan 23, 2023
1 parent e902671 commit 31ca234
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 4 deletions.
26 changes: 25 additions & 1 deletion deno/gateway/v10.ts
Expand Up @@ -32,6 +32,7 @@ import type {
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
} from '../payloads/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';

Expand Down Expand Up @@ -179,7 +180,11 @@ export enum GatewayCloseCodes {
export enum GatewayIntentBits {
Guilds = 1 << 0,
GuildMembers = 1 << 1,
GuildBans = 1 << 2,
GuildModeration = 1 << 2,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
Expand Down Expand Up @@ -262,6 +267,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
}

export type GatewaySendPayload =
Expand Down Expand Up @@ -1691,6 +1697,24 @@ export interface GatewayWebhooksUpdateDispatchData {
channel_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export type GatewayGuildAuditLogEntryCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildAuditLogEntryCreate,
GatewayGuildAuditLogEntryCreateDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLogEntry {
/**
* ID of the guild
*/
guild_id: Snowflake;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down
26 changes: 25 additions & 1 deletion deno/gateway/v9.ts
Expand Up @@ -32,6 +32,7 @@ import type {
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
} from '../payloads/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';

Expand Down Expand Up @@ -179,7 +180,11 @@ export enum GatewayCloseCodes {
export enum GatewayIntentBits {
Guilds = 1 << 0,
GuildMembers = 1 << 1,
GuildBans = 1 << 2,
GuildModeration = 1 << 2,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
Expand Down Expand Up @@ -261,6 +266,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
}

export type GatewaySendPayload =
Expand Down Expand Up @@ -1690,6 +1696,24 @@ export interface GatewayWebhooksUpdateDispatchData {
channel_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export type GatewayGuildAuditLogEntryCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildAuditLogEntryCreate,
GatewayGuildAuditLogEntryCreateDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLogEntry {
/**
* ID of the guild
*/
guild_id: Snowflake;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down
26 changes: 25 additions & 1 deletion gateway/v10.ts
Expand Up @@ -32,6 +32,7 @@ import type {
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
} from '../payloads/v10/index';
import type { Nullable } from '../utils/internals';

Expand Down Expand Up @@ -179,7 +180,11 @@ export enum GatewayCloseCodes {
export enum GatewayIntentBits {
Guilds = 1 << 0,
GuildMembers = 1 << 1,
GuildBans = 1 << 2,
GuildModeration = 1 << 2,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
Expand Down Expand Up @@ -262,6 +267,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
}

export type GatewaySendPayload =
Expand Down Expand Up @@ -1691,6 +1697,24 @@ export interface GatewayWebhooksUpdateDispatchData {
channel_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export type GatewayGuildAuditLogEntryCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildAuditLogEntryCreate,
GatewayGuildAuditLogEntryCreateDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLogEntry {
/**
* ID of the guild
*/
guild_id: Snowflake;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down
26 changes: 25 additions & 1 deletion gateway/v9.ts
Expand Up @@ -32,6 +32,7 @@ import type {
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
} from '../payloads/v9/index';
import type { Nullable } from '../utils/internals';

Expand Down Expand Up @@ -179,7 +180,11 @@ export enum GatewayCloseCodes {
export enum GatewayIntentBits {
Guilds = 1 << 0,
GuildMembers = 1 << 1,
GuildBans = 1 << 2,
GuildModeration = 1 << 2,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
Expand Down Expand Up @@ -261,6 +266,7 @@ export enum GatewayDispatchEvents {
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
}

export type GatewaySendPayload =
Expand Down Expand Up @@ -1690,6 +1696,24 @@ export interface GatewayWebhooksUpdateDispatchData {
channel_id: Snowflake;
}

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export type GatewayGuildAuditLogEntryCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildAuditLogEntryCreate,
GatewayGuildAuditLogEntryCreateDispatchData
>;

/**
* https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create
*/
export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLogEntry {
/**
* ID of the guild
*/
guild_id: Snowflake;
}

// #endregion Dispatch Payloads

// #region Sendable Payloads
Expand Down

1 comment on commit 31ca234

@vercel
Copy link

@vercel vercel bot commented on 31ca234 Jan 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.