mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
Add integrationCreate action
This commit is contained in:
parent
cb20e1f04d
commit
a36e0915e5
@ -25,7 +25,8 @@ import type {
|
|||||||
// DiscordThreadMemberUpdate,
|
// DiscordThreadMemberUpdate,
|
||||||
// DiscordThreadMembersUpdate,
|
// DiscordThreadMembersUpdate,
|
||||||
DiscordThreadListSync,
|
DiscordThreadListSync,
|
||||||
DiscordWebhookUpdate
|
DiscordWebhookUpdate,
|
||||||
|
DiscordIntegration
|
||||||
} from "../vendor/external.ts";
|
} from "../vendor/external.ts";
|
||||||
import type { Snowflake } from "../util/Snowflake.ts";
|
import type { Snowflake } from "../util/Snowflake.ts";
|
||||||
import type { Session } from "../session/Session.ts";
|
import type { Session } from "../session/Session.ts";
|
||||||
@ -39,6 +40,7 @@ import Message from "../structures/Message.ts";
|
|||||||
import User from "../structures/User.ts";
|
import User from "../structures/User.ts";
|
||||||
import Guild from "../structures/guilds/Guild.ts";
|
import Guild from "../structures/guilds/Guild.ts";
|
||||||
import Interaction from "../structures/interactions/Interaction.ts";
|
import Interaction from "../structures/interactions/Interaction.ts";
|
||||||
|
import { Integration } from "../structures/Integration.ts"
|
||||||
|
|
||||||
export type RawHandler<T> = (...args: [Session, number, T]) => void;
|
export type RawHandler<T> = (...args: [Session, number, T]) => void;
|
||||||
export type Handler<T extends unknown[]> = (...args: T) => unknown;
|
export type Handler<T extends unknown[]> = (...args: T) => unknown;
|
||||||
@ -167,6 +169,10 @@ export const WEBHOOKS_UPDATE: RawHandler<DiscordWebhookUpdate> = (session, _shar
|
|||||||
session.emit("webhooksUpdate", { guildId: webhook.guild_id, channelId: webhook.channel_id })
|
session.emit("webhooksUpdate", { guildId: webhook.guild_id, channelId: webhook.channel_id })
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const INTEGRATION_CREATE: RawHandler<DiscordIntegration> = (session, _shardId, payload) => {
|
||||||
|
session.emit("integrationCreate", new Integration(session, payload));
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
export const MESSAGE_REACTION_ADD: RawHandler<DiscordMessageReactionAdd> = (session, _shardId, reaction) => {
|
export const MESSAGE_REACTION_ADD: RawHandler<DiscordMessageReactionAdd> = (session, _shardId, reaction) => {
|
||||||
session.emit("messageReactionAdd", null);
|
session.emit("messageReactionAdd", null);
|
||||||
@ -226,6 +232,7 @@ export interface Events {
|
|||||||
"threadDelete": Handler<[ThreadChannel]>;
|
"threadDelete": Handler<[ThreadChannel]>;
|
||||||
"threadListSync": Handler<[{ guildId: Snowflake, channelIds: Snowflake[], threads: ThreadChannel[], members: ThreadMember[] }]>
|
"threadListSync": Handler<[{ guildId: Snowflake, channelIds: Snowflake[], threads: ThreadChannel[], members: ThreadMember[] }]>
|
||||||
"interactionCreate": Handler<[Interaction]>;
|
"interactionCreate": Handler<[Interaction]>;
|
||||||
|
"integrationCreate": Handler<[DiscordIntegration]>;
|
||||||
"raw": Handler<[unknown, number]>;
|
"raw": Handler<[unknown, number]>;
|
||||||
"webhooksUpdate": Handler<[{ guildId: Snowflake, channelId: Snowflake }]>;
|
"webhooksUpdate": Handler<[{ guildId: Snowflake, channelId: Snowflake }]>;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user