all repos — stealth-developers @ d50a9160254db7ccf1b406556ecb9eb21de84383

src/interactions/commands/meow.ts (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
import { text } from "@/utils/discord/components";
import {
	type ChatInputCommandInteraction,
	type Client,
	SlashCommandBuilder,
} from "discord.js";
import Uwuifier from "uwuifier";

const commandData = new SlashCommandBuilder()
	.setName("meow")
	.setDescription("mrrp~");

const meowVariants = [
	"meow",
	"mew",
	"mrrow",
	"mrow",
	"mrrp",
	"miau",
	"miu",
	"nya",
	"mya",
	"mraow",
	"meowdy",
	"mrrr",
	"prrt",
	"prrp",
	"mreow",
	"mweow",
	"mwow",
	"mrrah",
	"mrawr",
	"myaa",
	"mrao",
	"chirp",
	"chirrup",
	"trill",
	"brr",
	"brrp",
	"ekekek",
	"mrrrow",
	"rawr",
	"rowl",
	"yowl",
	"caterwaul",
	"purr",
	"purrr",
	"prrrr",
	"rrrr",
	"mew mew",
	"squeek",
	"squeak",
	"mrrp mrrp",
	"brrrt",
	"prrow",
	"meep",
	"mrrph",
	"blepp",
	"raow",
	"reow",
	"mrrup",
	"mrraah",
	"mowww",
	"mao",
];

const suffixes = ["~", "!!", "!?", "?!", "...", "!11", "", "✧"];
const prefixes = ["m-", "", "", ""];
const emoticons = [
	">w<",
	"^w^",
	"=^w^=",
	"ฅ^•ﻌ•^ฅ",
	"(=^・ェ・^=)",
	"(=^‥^=)",
	"ฅ(•ㅅ•❀)ฅ",
	"₍˄·͈༝·͈˄₎",
	"(ΦωΦ)",
	"(=①ω①=)",
	"~(=^‥^)ノ",
	"",
];

function generateMeow(): string {
	const wordCount = Math.floor(Math.random() * 15) + 3; // 3-8 meows
	const words: string[] = [];

	for (let i = 0; i < wordCount; i++) {
		const prefix = prefixes[Math.floor(Math.random() * prefixes.length)];
		const meow = meowVariants[Math.floor(Math.random() * meowVariants.length)];
		const suffix = suffixes[Math.floor(Math.random() * suffixes.length)];

		// sometimes extend the meow with repeated letters
		const extendedMeow =
			Math.random() > 0.5
				? meow.replace(/[aeiourw]/g, (m) =>
						m.repeat(Math.floor(Math.random() * 4) + 1),
					)
				: meow;

		words.push(`${prefix}${extendedMeow}${suffix}`);
	}

	return (
		words.join(" ") +
		(Math.random() > 0.4
			? ` ${emoticons[Math.floor(Math.random() * emoticons.length)]}`
			: "")
	);
}

async function execute(
	_client: Client,
	interaction: ChatInputCommandInteraction,
) {
	const uwuifier = new Uwuifier();

	const meowText = generateMeow();
	const uwuifiedMeowText = uwuifier.uwuifySentence(meowText);

	const blacklistedWords = [
		"twerks",
		"sees bulge",
		"notices buldge",
		"starts twerking",
	];

	const finalText = blacklistedWords.reduce((acc, word) => {
		return acc.replace(new RegExp(word, "gi"), "----");
	}, uwuifiedMeowText);

	await interaction.reply({
		content: finalText,
		allowedMentions: { users: [interaction.user.id] },
	});
}

export default {
	data: commandData,
	execute,
};