diff --git a/src/api/Commands/commandHelpers.ts b/src/api/Commands/commandHelpers.ts index dd1196f9f..2fd189032 100644 --- a/src/api/Commands/commandHelpers.ts +++ b/src/api/Commands/commandHelpers.ts @@ -17,14 +17,14 @@ */ import { mergeDefaults } from "@utils/misc"; -import { findByCodeLazy, findByPropsLazy } from "@webpack"; +import { findByPropsLazy } from "@webpack"; import { SnowflakeUtils } from "@webpack/common"; import { Message } from "discord-types/general"; import type { PartialDeep } from "type-fest"; import { Argument } from "./types"; -const createBotMessage = findByCodeLazy('username:"Clyde"'); +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 = createBotMessage({ channelId, content: "", embeds: [] }); + const botMessage = MessageCreator.createBotMessage({ channelId, content: "", embeds: [] }); MessageSender.receiveMessage(channelId, mergeDefaults(message, botMessage)); diff --git a/src/plugins/_api/commands.ts b/src/plugins/_api/commands.ts index b7d6ef9fe..3a7619365 100644 --- a/src/plugins/_api/commands.ts +++ b/src/plugins/_api/commands.ts @@ -44,8 +44,8 @@ export default definePlugin({ find: "Unexpected value for option", replacement: { // return [2, cmd.execute(args, ctx)] - match: /,(.{1,2})\.execute\((.{1,2}),(.{1,2})\)]/, - replace: (_, cmd, args, ctx) => `,Vencord.Api.Commands._handleCommand(${cmd}, ${args}, ${ctx})]` + match: /,(\i)\.execute\((\i),(\i)\)/, + replace: (_, cmd, args, ctx) => `,Vencord.Api.Commands._handleCommand(${cmd}, ${args}, ${ctx})` } }, // Show plugin name instead of "Built-In"