mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
refactor!: move dirs outside of src/ (#2032)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import { ScheduledEvent } from "../../../types/guilds/scheduledEvents.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../../types/util.ts";
|
||||
|
||||
export function handleGuildScheduledEventCreate(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
const payload = data.d as SnakeCasedPropertiesDeep<ScheduledEvent>;
|
||||
bot.events.scheduledEventCreate(bot, bot.transformers.scheduledEvent(bot, payload));
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { ScheduledEvent } from "../../../types/guilds/scheduledEvents.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../../types/util.ts";
|
||||
|
||||
export function handleGuildScheduledEventDelete(bot: Bot, data: DiscordGatewayPayload) {
|
||||
const payload = data.d as SnakeCasedPropertiesDeep<ScheduledEvent>;
|
||||
bot.events.scheduledEventDelete(bot, bot.transformers.scheduledEvent(bot, payload));
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { ScheduledEvent } from "../../../types/guilds/scheduledEvents.ts";
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../../types/gateway/gatewayPayload.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../../types/util.ts";
|
||||
|
||||
export function handleGuildScheduledEventUpdate(bot: Bot, data: DiscordGatewayPayload) {
|
||||
const payload = data.d as SnakeCasedPropertiesDeep<ScheduledEvent>;
|
||||
bot.events.scheduledEventUpdate(bot, bot.transformers.scheduledEvent(bot, payload));
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../../types/gateway/gatewayPayload.ts";
|
||||
import { ScheduledEventUserAdd } from "../../../types/guilds/scheduledEvents.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../../types/util.ts";
|
||||
|
||||
export function handleGuildScheduledEventUserAdd(bot: Bot, data: DiscordGatewayPayload) {
|
||||
const payload = data.d as SnakeCasedPropertiesDeep<ScheduledEventUserAdd>;
|
||||
|
||||
return bot.events.scheduledEventUserAdd(bot, {
|
||||
guildScheduledEventId: bot.transformers.snowflake(payload.guild_scheduled_event_id),
|
||||
userId: bot.transformers.snowflake(payload.user_id),
|
||||
guildId: bot.transformers.snowflake(payload.guild_id),
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { Bot } from "../../../bot.ts";
|
||||
import type { DiscordGatewayPayload } from "../../../types/gateway/gatewayPayload.ts";
|
||||
import { ScheduledEventUserRemove } from "../../../types/guilds/scheduledEvents.ts";
|
||||
import { SnakeCasedPropertiesDeep } from "../../../types/util.ts";
|
||||
|
||||
export function handleGuildScheduledEventUserRemove(bot: Bot, data: DiscordGatewayPayload) {
|
||||
const payload = data.d as SnakeCasedPropertiesDeep<ScheduledEventUserRemove>;
|
||||
|
||||
return bot.events.scheduledEventUserRemove(bot, {
|
||||
guildScheduledEventId: bot.transformers.snowflake(payload.guild_scheduled_event_id),
|
||||
userId: bot.transformers.snowflake(payload.user_id),
|
||||
guildId: bot.transformers.snowflake(payload.guild_id),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user