Skip to content

Commit

Permalink
commandHelpers: use MessageActions import
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuckyz committed Dec 9, 2023
1 parent 799e6e7 commit 539e538
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/Commands/commandHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

import { MessageActions } from "@utils/discord";
import { mergeDefaults } from "@utils/misc";
import { findByPropsLazy } from "@webpack";
import { SnowflakeUtils } from "@webpack/common";
Expand All @@ -25,7 +26,6 @@ import type { PartialDeep } from "type-fest";
import { Argument } from "./types";

const MessageCreator = findByPropsLazy("createBotMessage");
const MessageSender = findByPropsLazy("receiveMessage");

export function generateId() {
return `-${SnowflakeUtils.fromTimestamp(Date.now())}`;
Expand All @@ -40,7 +40,7 @@ export function generateId() {
export function sendBotMessage(channelId: string, message: PartialDeep<Message>): Message {
const botMessage = MessageCreator.createBotMessage({ channelId, content: "", embeds: [] });

MessageSender.receiveMessage(channelId, mergeDefaults(message, botMessage));
MessageActions.receiveMessage(channelId, mergeDefaults(message, botMessage));

return message as Message;
}
Expand Down

0 comments on commit 539e538

Please sign in to comment.