mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47:22 +00:00
fix: get rid of type errors for now (#2113)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { Guild } from "../../transformers/guild.ts";
|
||||
import { DiscordGatewayPayload, DiscordGuild } from "../../types/discord.ts";
|
||||
|
||||
export function handleGuildCreate(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
const payload = data.d as DiscordGuild;
|
||||
bot.events.guildCreate(bot, bot.transformers.guild(bot, { guild: payload, shardId }));
|
||||
bot.events.guildCreate(bot, bot.transformers.guild(bot, { guild: payload, shardId }) as Guild);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { Guild } from "../../transformers/guild.ts";
|
||||
import { DiscordGatewayPayload, DiscordGuild } from "../../types/discord.ts";
|
||||
|
||||
export function handleGuildLoaded(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
const payload = data.d as DiscordGuild;
|
||||
|
||||
const guild = bot.transformers.guild(bot, { guild: payload, shardId });
|
||||
bot.events.guildLoaded(bot, guild);
|
||||
bot.events.guildLoaded(bot, guild as Guild);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { Bot } from "../../bot.ts";
|
||||
import type { Guild } from "../../transformers/guild.ts";
|
||||
import { DiscordGatewayPayload, DiscordGuild } from "../../types/discord.ts";
|
||||
|
||||
export async function handleGuildUpdate(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
export function handleGuildUpdate(bot: Bot, data: DiscordGatewayPayload, shardId: number) {
|
||||
const payload = data.d as DiscordGuild;
|
||||
|
||||
bot.events.guildUpdate(bot, bot.transformers.guild(bot, { guild: payload, shardId }));
|
||||
bot.events.guildUpdate(bot, bot.transformers.guild(bot, { guild: payload, shardId }) as Guild);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user