diff --git a/backend/src/plugins/InternalPoster/functions/sendMessage.ts b/backend/src/plugins/InternalPoster/functions/sendMessage.ts index 3afa9614..b577db52 100644 --- a/backend/src/plugins/InternalPoster/functions/sendMessage.ts +++ b/backend/src/plugins/InternalPoster/functions/sendMessage.ts @@ -1,4 +1,4 @@ -import { GuildTextBasedChannel, MessageOptions, WebhookClient } from "discord.js"; +import { GuildTextBasedChannel, MessageCreateOptions, WebhookClient } from "discord.js"; import { GuildPluginData } from "knub"; import { InternalPosterPluginType } from "../types"; import { channelIsWebhookable } from "./getOrCreateWebhookForChannel"; @@ -12,7 +12,7 @@ export type InternalPosterMessageResult = { async function sendDirectly( channel: GuildTextBasedChannel, - content: MessageOptions, + content: MessageCreateOptions, ): Promise { return channel.send(content).then((message) => ({ id: message.id, @@ -26,7 +26,7 @@ async function sendDirectly( export async function sendMessage( pluginData: GuildPluginData, channel: GuildTextBasedChannel, - content: MessageOptions, + content: MessageCreateOptions, ): Promise { return pluginData.state.queue.add(async () => { let webhookClient: WebhookClient | null = null; diff --git a/backend/src/plugins/Logs/util/onMessageUpdate.ts b/backend/src/plugins/Logs/util/onMessageUpdate.ts index 72c2faca..2b291569 100644 --- a/backend/src/plugins/Logs/util/onMessageUpdate.ts +++ b/backend/src/plugins/Logs/util/onMessageUpdate.ts @@ -1,4 +1,4 @@ -import { GuildTextBasedChannel, MessageEmbed, Snowflake } from "discord.js"; +import { EmbedData, GuildTextBasedChannel, Snowflake } from "discord.js"; import { GuildPluginData } from "knub"; import cloneDeep from "lodash.clonedeep"; import { SavedMessage } from "../../../data/entities/SavedMessage"; @@ -14,13 +14,13 @@ export async function onMessageUpdate( // To log a message update, either the message content or a rich embed has to change let logUpdate = false; - const oldEmbedsToCompare = ((oldSavedMessage.data.embeds || []) as MessageEmbed[]) + const oldEmbedsToCompare = ((oldSavedMessage.data.embeds || []) as EmbedData[]) .map((e) => cloneDeep(e)) - .filter((e) => (e as MessageEmbed).type === "rich"); + .filter((e) => (e as EmbedData).type === "rich"); - const newEmbedsToCompare = ((savedMessage.data.embeds || []) as MessageEmbed[]) + const newEmbedsToCompare = ((savedMessage.data.embeds || []) as EmbedData[]) .map((e) => cloneDeep(e)) - .filter((e) => (e as MessageEmbed).type === "rich"); + .filter((e) => (e as EmbedData).type === "rich"); for (const embed of [...oldEmbedsToCompare, ...newEmbedsToCompare]) { if (embed.thumbnail) {