mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
* Revert "feat: base plugin lib idea (#2308)"
This reverts commit ffe7cdbc6f.
* fmt
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { DiscordGatewayPayload, DiscordIntegrationCreateUpdate } from "../../types/discord.ts";
|
||||
|
||||
export function handleIntegrationCreate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
bot.events.integrationCreate(
|
||||
bot,
|
||||
bot.transformers.integration(bot, data.d as DiscordIntegrationCreateUpdate),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { DiscordGatewayPayload, DiscordIntegrationDelete } from "../../types/discord.ts";
|
||||
|
||||
export function handleIntegrationDelete(bot: Bot, data: DiscordGatewayPayload) {
|
||||
const payload = data.d as DiscordIntegrationDelete;
|
||||
|
||||
bot.events.integrationDelete(bot, {
|
||||
id: bot.transformers.snowflake(payload.id),
|
||||
guildId: bot.transformers.snowflake(payload.guild_id),
|
||||
applicationId: payload.application_id ? bot.transformers.snowflake(payload.application_id) : undefined,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Bot } from "../../bot.ts";
|
||||
import { DiscordGatewayPayload, DiscordIntegrationCreateUpdate } from "../../types/discord.ts";
|
||||
|
||||
export function handleIntegrationUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
bot.events.integrationUpdate(
|
||||
bot,
|
||||
bot.transformers.integration(bot, data.d as DiscordIntegrationCreateUpdate),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export * from "./INTEGRATION_CREATE.ts";
|
||||
export * from "./INTEGRATION_DELETE.ts";
|
||||
export * from "./INTEGRATION_UPDATE.ts";
|
||||
Reference in New Issue
Block a user