aa lot of shit
This commit is contained in:
parent
c1670b8abd
commit
6bde961dbe
4 changed files with 185 additions and 15 deletions
89
src/commands/uwuifier.ts
Normal file
89
src/commands/uwuifier.ts
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
import {
|
||||
ApplicationCommandType,
|
||||
ContextMenuCommandBuilder,
|
||||
ContextMenuCommandInteraction,
|
||||
InteractionContextType,
|
||||
Message,
|
||||
Snowflake,
|
||||
User
|
||||
} from "discord.js";
|
||||
import { ContextCommand } from "../command.ts";
|
||||
|
||||
export default class Uwuifier extends ContextCommand<Message> {
|
||||
targetType: ApplicationCommandType.Message = ApplicationCommandType.Message;
|
||||
contextDefinition: ContextMenuCommandBuilder =
|
||||
new ContextMenuCommandBuilder()
|
||||
.setName('uwuify')
|
||||
.setType(ApplicationCommandType.Message)
|
||||
async run(interaction: ContextMenuCommandInteraction, target: Message): Promise<void> {
|
||||
|
||||
const endings = [
|
||||
"rawr x3",
|
||||
"OwO",
|
||||
"UwU",
|
||||
"o.O",
|
||||
"-.-",
|
||||
">w<",
|
||||
"(⑅˘꒳˘)",
|
||||
"(ꈍᴗꈍ)",
|
||||
"(˘ω˘)",
|
||||
"(U ᵕ U❁)",
|
||||
"σωσ",
|
||||
"òωó",
|
||||
"(///ˬ///✿)",
|
||||
"(U ﹏ U)",
|
||||
"( ͡o ω ͡o )",
|
||||
"ʘwʘ",
|
||||
":3",
|
||||
":3",
|
||||
"XD",
|
||||
"nyaa~~",
|
||||
"mya",
|
||||
">_<",
|
||||
"😳",
|
||||
"🥺",
|
||||
"😳😳😳",
|
||||
"rawr",
|
||||
"^^",
|
||||
"^^;;",
|
||||
"(ˆ ﻌ ˆ)♡",
|
||||
"^•ﻌ•^",
|
||||
"/(^•ω•^)",
|
||||
"(✿oωo)"
|
||||
];
|
||||
|
||||
const replacements = [
|
||||
["small", "smol"],
|
||||
["cute", "kawaii~"],
|
||||
["fluff", "floof"],
|
||||
["love", "luv"],
|
||||
["stupid", "baka"],
|
||||
["what", "nani"],
|
||||
["meow", "nya~"],
|
||||
["hello", "hewwo"],
|
||||
];
|
||||
await interaction.deferReply();
|
||||
let message = target.content;
|
||||
function getRandomElement<T>(arr:T[]):T {
|
||||
const randomIndex = Math.floor(Math.random() * arr.length);
|
||||
return arr[randomIndex];
|
||||
}
|
||||
|
||||
|
||||
function uwuify(message: string): string {
|
||||
message = message.toLowerCase();
|
||||
for (const pair of replacements) {
|
||||
message = message.replaceAll(pair[0], pair[1]);
|
||||
}
|
||||
message = message
|
||||
.replaceAll(/([ \t\n])n/g, "$1ny")
|
||||
.replaceAll(/[lr]/g, "w")
|
||||
.replaceAll(/([ \t\n])([a-z])/g, (_, p1, p2) => Math.random() < .5 ? `${p1}${p2}-${p2}` : `${p1}${p2}`)
|
||||
.replaceAll(/([^.,!][.,!])([ \t\n])/g, (_, p1, p2) => `${p1} ${getRandomElement(endings)}${p2}`);
|
||||
return message;
|
||||
}
|
||||
|
||||
interaction.followUp(uwuify(message));
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue