mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
types: add gateway types
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import {
|
||||
DiscordApplicationCommandCreateUpdateDelete,
|
||||
DiscordGatewayPayload,
|
||||
} from "../../types/gateway.ts";
|
||||
|
||||
export function handleApplicationCommandCreate(
|
||||
data: DiscordPayload,
|
||||
data: DiscordGatewayPayload,
|
||||
) {
|
||||
const {
|
||||
guild_id: guildId,
|
||||
application_id: applicationId,
|
||||
...rest
|
||||
} = data.d as ApplicationCommandEvent;
|
||||
} = data.d as DiscordApplicationCommandCreateUpdateDelete;
|
||||
|
||||
eventHandlers.applicationCommandCreate?.({
|
||||
...rest,
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import {
|
||||
DiscordApplicationCommandCreateUpdateDelete,
|
||||
DiscordGatewayPayload,
|
||||
} from "../../types/gateway.ts";
|
||||
|
||||
export function handleApplicationCommandDelete(data: DiscordPayload) {
|
||||
export function handleApplicationCommandDelete(data: DiscordGatewayPayload) {
|
||||
const {
|
||||
application_id: applicationId,
|
||||
guild_id: guildId,
|
||||
...rest
|
||||
} = data.d as ApplicationCommandEvent;
|
||||
} = data.d as DiscordApplicationCommandCreateUpdateDelete;
|
||||
|
||||
eventHandlers.applicationCommandDelete?.({
|
||||
...rest,
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import {
|
||||
DiscordApplicationCommandCreateUpdateDelete,
|
||||
DiscordGatewayPayload,
|
||||
} from "../../types/gateway.ts";
|
||||
|
||||
export function handleApplicationCommandUpdate(data: DiscordPayload) {
|
||||
export function handleApplicationCommandUpdate(data: DiscordGatewayPayload) {
|
||||
const {
|
||||
application_id: applicationId,
|
||||
guild_id: guildId,
|
||||
...rest
|
||||
} = data.d as ApplicationCommandEvent;
|
||||
} = data.d as DiscordApplicationCommandCreateUpdateDelete;
|
||||
|
||||
eventHandlers.applicationCommandUpdate?.({
|
||||
...rest,
|
||||
|
||||
Reference in New Issue
Block a user