mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 11:28:15 +00:00
autoconvert handler messages
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import { eventHandlers } from "../../bot.ts";
|
||||
import { cacheHandlers } from "../../cache.ts";
|
||||
import { DiscordChannel } from "../../types/channels/channel.ts";
|
||||
import { Channel } from "../../types/channels/channel.ts";
|
||||
import { DiscordChannelTypes } from "../../types/channels/channel_types.ts";
|
||||
import { DiscordGatewayPayload } from "../../types/gateway/gateway_payload.ts";
|
||||
|
||||
export async function handleChannelDelete(data: DiscordGatewayPayload) {
|
||||
const payload = data.d as DiscordChannel;
|
||||
const payload = data.d as Channel;
|
||||
|
||||
const cachedChannel = await cacheHandlers.get("channels", payload.id);
|
||||
if (!cachedChannel) return;
|
||||
|
||||
if (
|
||||
cachedChannel.type === DiscordChannelTypes.GUILD_VOICE && payload.guild_id
|
||||
cachedChannel.type === DiscordChannelTypes.GUILD_VOICE && payload.guildId
|
||||
) {
|
||||
const guild = await cacheHandlers.get("guilds", payload.guild_id);
|
||||
const guild = await cacheHandlers.get("guilds", payload.guildId);
|
||||
|
||||
if (guild) {
|
||||
return Promise.all(guild.voiceStates.map(async (vs, key) => {
|
||||
|
||||
Reference in New Issue
Block a user