From 9d7999cefcc2a53a7e6692e27a5923d3da0dcbf8 Mon Sep 17 00:00:00 2001 From: TriForMine Date: Thu, 21 Oct 2021 22:19:54 +0200 Subject: [PATCH] Fix conflict --- src/bot.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/bot.ts b/src/bot.ts index a2643204b..398ec33c3 100644 --- a/src/bot.ts +++ b/src/bot.ts @@ -125,9 +125,11 @@ import { handleIntegrationCreate, handleIntegrationUpdate, handleIntegrationDelete, + handleGuildLoaded } from "./handlers/mod.ts"; +import { DiscordenoInteraction, transformInteraction } from "./transformers/interaction.ts"; +import { DiscordenoIntegration, transformIntegration } from "./transformers/integration.ts"; import {Emoji} from "./types/emojis/emoji.ts"; -import {handleGuildLoaded} from "./handlers/guilds/GUILD_LOADED_DD.ts"; export async function createBot(options: CreateBotOptions) { return { @@ -239,6 +241,10 @@ export function createEventHandlers(events: Partial): EventHandle channelCreate: events.channelCreate ?? ignore, debug: events.debug ?? ignore, dispatchRequirements: events.dispatchRequirements ?? ignore, + integrationCreate: events.integrationCreate ?? ignore, + integrationDelete: events.integrationDelete ?? ignore, + interactionCreate: events.interactionCreate ?? ignore, + channelCreate: events.channelCreate ?? ignore, voiceChannelLeave: events.voiceChannelLeave ?? ignore, channelDelete: events.channelDelete ?? ignore, channelPinsUpdate: events.channelPinsUpdate ?? ignore, @@ -485,6 +491,8 @@ export interface Transformers { message: typeof transformMessage; role: typeof transformRole; voiceState: typeof transformVoiceState; + interaction: typeof transformInteraction; + integration: typeof transformIntegration; } export function createTransformers(options: Partial) { @@ -497,6 +505,7 @@ export function createTransformers(options: Partial) { message: options.message || transformMessage, role: options.role || transformRole, voiceState: options.voiceState || transformVoiceState, + integration: options.integration || transformIntegration, }; } @@ -606,6 +615,10 @@ export interface GatewayManager { export interface EventHandlers { debug: (text: string) => unknown; + interactionCreate: (bot: Bot, interaction: DiscordenoInteraction) => any; + integrationCreate: (bot: Bot, integration: DiscordenoIntegration) => any; + integrationDelete: (bot: Bot, payload: { id: bigint; guildId: bigint; applicationId?: bigint }) => any; + integrationsUpdate: (bot: Bot, integration: DiscordenoIntegration) => any; channelCreate: (bot: Bot, channel: DiscordenoChannel) => any; dispatchRequirements: (bot: Bot, data: GatewayPayload, shardId: number) => any; voiceChannelLeave: (bot: Bot, voiceState: DiscordenoVoiceState, channel: DiscordenoChannel) => any; @@ -658,7 +671,6 @@ export interface EventHandlers { guildCreate: (bot: Bot, guild: DiscordenoGuild) => any; guildDelete: (bot: Bot, id: bigint, guild?: DiscordenoGuild) => any; guildUpdate: (bot: Bot, guild: DiscordenoGuild, cachedGuild?: DiscordenoGuild) => any; - integrationsUpdate: (bot: Bot, data: { guildId: bigint }) => any; raw: (bot: Bot, data: GatewayPayload, shardId: number) => any; }