From a36e0915e55dfb866376e8818d9375363cebde97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Serna?= Date: Mon, 4 Jul 2022 21:11:16 -0300 Subject: [PATCH] Add integrationCreate action --- handlers/Actions.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/handlers/Actions.ts b/handlers/Actions.ts index e1dd524..575f312 100644 --- a/handlers/Actions.ts +++ b/handlers/Actions.ts @@ -25,7 +25,8 @@ import type { // DiscordThreadMemberUpdate, // DiscordThreadMembersUpdate, DiscordThreadListSync, - DiscordWebhookUpdate + DiscordWebhookUpdate, + DiscordIntegration } from "../vendor/external.ts"; import type { Snowflake } from "../util/Snowflake.ts"; import type { Session } from "../session/Session.ts"; @@ -39,6 +40,7 @@ import Message from "../structures/Message.ts"; import User from "../structures/User.ts"; import Guild from "../structures/guilds/Guild.ts"; import Interaction from "../structures/interactions/Interaction.ts"; +import { Integration } from "../structures/Integration.ts" export type RawHandler = (...args: [Session, number, T]) => void; export type Handler = (...args: T) => unknown; @@ -167,6 +169,10 @@ export const WEBHOOKS_UPDATE: RawHandler = (session, _shar session.emit("webhooksUpdate", { guildId: webhook.guild_id, channelId: webhook.channel_id }) }; +export const INTEGRATION_CREATE: RawHandler = (session, _shardId, payload) => { + session.emit("integrationCreate", new Integration(session, payload)); +}; + /* export const MESSAGE_REACTION_ADD: RawHandler = (session, _shardId, reaction) => { session.emit("messageReactionAdd", null); @@ -226,6 +232,7 @@ export interface Events { "threadDelete": Handler<[ThreadChannel]>; "threadListSync": Handler<[{ guildId: Snowflake, channelIds: Snowflake[], threads: ThreadChannel[], members: ThreadMember[] }]> "interactionCreate": Handler<[Interaction]>; + "integrationCreate": Handler<[DiscordIntegration]>; "raw": Handler<[unknown, number]>; "webhooksUpdate": Handler<[{ guildId: Snowflake, channelId: Snowflake }]>; }