mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 08:20:08 +00:00
* chore: setup "deno lint" * ci(lint): add --unstable flat to lint script * lint * lint * refactor: destructure assignment for Message#guildID * chore: remove TODO comment * refactor: remove redundant async * chore: switch to Deno stable vscode ext * chore: remove ignore comments * chore: remove ignore comments * chore: remove @ts-ignore comment * fixes * fixes * chore: remove deno-lint-ignore comment * chore: add index signature
28 lines
743 B
TypeScript
28 lines
743 B
TypeScript
import { eventHandlers } from "../../bot.ts";
|
|
import {
|
|
Application,
|
|
DiscordPayload,
|
|
InteractionCommandPayload,
|
|
} from "../../types/mod.ts";
|
|
import { structures } from "../structures/mod.ts";
|
|
|
|
export async function handleInternalInteractionCreate(data: DiscordPayload) {
|
|
if (data.t !== "INTERACTION_CREATE") return;
|
|
|
|
const payload = data.d as InteractionCommandPayload;
|
|
eventHandlers.interactionCreate?.(
|
|
{
|
|
...payload,
|
|
member: await structures.createMember(payload.member, payload.guild_id),
|
|
},
|
|
);
|
|
}
|
|
|
|
export function handleInternalApplicationCommandCreate(
|
|
data: DiscordPayload,
|
|
) {
|
|
if (data.t !== "APPLICATION_COMMAND_CREATE") return;
|
|
|
|
eventHandlers.applicationCommandCreate?.(data.d as Application);
|
|
}
|