Replace whatever a user says with meowing
/*
* Vencord, a Discord client mod
* Copyright (c) 2025 Vendicated and contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { definePluginSettings } from "@api/Settings";
import definePlugin, { OptionType } from "@utils/types";
import { FluxDispatcher } from "@webpack/common";
export default definePlugin({
name: "MeowPerson",
description: "Turns others into cats",
authors: [],
dependencies: ["MessageEventsAPI"],
settings: definePluginSettings({
meowList: {
type: OptionType.STRING,
description:
"Space or comma separated list of users to apply this to",
default: "",
},
}),
flux: {
async MESSAGE_CREATE({ guildId, message }) {
function generateMeowing(len: number): string {
let x = "";
const meows = ["meow", "mrrp", "prr", "mreow", "nya", ":3"];
for (let i = 0; i < len; i++) {
x += meows[Math.floor(Math.random() * 6)] + " ";
}
return x;
}
const msg = message;
// @ts-ignore
if (
Vencord.Plugins.plugins.MeowPerson.settings?.store.meowList.includes(
message.author.username,
)
) {
msg.content =
generateMeowing(1 + msg.content.length / 4) + ":3";
FluxDispatcher.dispatch({
type: "MESSAGE_UPDATE",
message: msg,
guildId,
});
}
},
},
});