refactor: revert "feat: base plugin lib idea (#2308)" (#2336)

* Revert "feat: base plugin lib idea (#2308)"

This reverts commit ffe7cdbc6f.

* fmt
This commit is contained in:
ITOH
2022-07-02 14:24:43 +01:00
committed by GitHub
parent f57b2274e0
commit 03996c5f58
346 changed files with 786 additions and 856 deletions
@@ -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),
);
}
+3
View File
@@ -0,0 +1,3 @@
export * from "./INTEGRATION_CREATE.ts";
export * from "./INTEGRATION_DELETE.ts";
export * from "./INTEGRATION_UPDATE.ts";