From 534ca1e28d702141b6c1bf480e655a44299456a9 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 7 Dec 2023 08:44:14 +0700 Subject: [PATCH] fix: createBotMessage (#2033) --- src/api/Commands/commandHelpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/Commands/commandHelpers.ts b/src/api/Commands/commandHelpers.ts index ebcc4e2f..2fd18903 100644 --- a/src/api/Commands/commandHelpers.ts +++ b/src/api/Commands/commandHelpers.ts @@ -16,7 +16,6 @@ * along with this program. If not, see . */ -import { MessageActions } from "@utils/discord"; import { mergeDefaults } from "@utils/misc"; import { findByPropsLazy } from "@webpack"; import { SnowflakeUtils } from "@webpack/common"; @@ -25,6 +24,7 @@ import type { PartialDeep } from "type-fest"; import { Argument } from "./types"; +const MessageCreator = findByPropsLazy("createBotMessage"); const MessageSender = findByPropsLazy("receiveMessage"); export function generateId() { @@ -38,7 +38,7 @@ export function generateId() { * @returns {Message} */ export function sendBotMessage(channelId: string, message: PartialDeep): Message { - const botMessage = MessageActions.createBotMessage({ channelId, content: "", embeds: [] }); + const botMessage = MessageCreator.createBotMessage({ channelId, content: "", embeds: [] }); MessageSender.receiveMessage(channelId, mergeDefaults(message, botMessage));