diff options
author | echo <infidelLOLer@gmail.com> | 2023-07-14 02:38:27 +0330 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-14 01:08:27 +0200 |
commit | 971700178337091a019ee9d9ac747f8ff915d1b8 (patch) | |
tree | 5a8ab2d4ad1318062b6f05c495489d0be605b561 /src | |
parent | 065ab756274e41467f57cfe5260832dc0a89919f (diff) | |
download | Vencord-971700178337091a019ee9d9ac747f8ff915d1b8.tar.gz Vencord-971700178337091a019ee9d9ac747f8ff915d1b8.tar.bz2 Vencord-971700178337091a019ee9d9ac747f8ff915d1b8.zip |
delete uwuifier plugin (#1414)
Co-authored-by: exhq <exhq@exhq.dev>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/uwuify.ts | 143 |
1 files changed, 0 insertions, 143 deletions
diff --git a/src/plugins/uwuify.ts b/src/plugins/uwuify.ts deleted file mode 100644 index f75dd10..0000000 --- a/src/plugins/uwuify.ts +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Vencord, a modification for Discord's desktop app - * Copyright (c) 2022 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <https://www.gnu.org/licenses/>. -*/ - -import { findOption, RequiredMessageOption } from "@api/Commands"; -import { addPreEditListener, addPreSendListener, MessageObject, removePreEditListener, removePreSendListener } from "@api/MessageEvents"; -import { definePluginSettings } from "@api/Settings"; -import { Devs } from "@utils/constants"; -import definePlugin, { OptionType } from "@utils/types"; - -const endings = [ - "rawr x3", - "OwO", - "UwU", - "o.O", - "-.-", - ">w<", - "(⑅˘꒳˘)", - "(ꈍᴗꈍ)", - "(˘ω˘)", - "(U ᵕ U❁)", - "σωσ", - "òωó", - "(///ˬ///✿)", - "(U ﹏ U)", - "( ͡o ω ͡o )", - "ʘwʘ", - ":3", - ":3", // important enough to have twice - "XD", - "nyaa~~", - "mya", - ">_<", - "😳", - "🥺", - "😳😳😳", - "rawr", - "^^", - "^^;;", - "(ˆ ﻌ ˆ)♡", - "^•ﻌ•^", - "/(^•ω•^)", - "(✿oωo)" -]; - -const replacements = [ - ["small", "smol"], - ["cute", "kawaii~"], - ["fluff", "floof"], - ["love", "luv"], - ["stupid", "baka"], - ["what", "nani"], - ["meow", "nya~"], - ["hello", "hewwo"], -]; - -const settings = definePluginSettings({ - uwuEveryMessage: { - description: "Make every single message uwuified", - type: OptionType.BOOLEAN, - default: false, - restartNeeded: false - } -}); - -function selectRandomElement(arr) { - // generate a random index based on the length of the array - const randomIndex = Math.floor(Math.random() * arr.length); - - // return the element at the randomly generated index - return arr[randomIndex]; -} - - -function uwuify(message: string): string { - message = message.toLowerCase(); - // words - for (const pair of replacements) { - message = message.replaceAll(pair[0], pair[1]); - } - message = message - .replaceAll(/([ \t\n])n/g, "$1ny") // nyaify - .replaceAll(/[lr]/g, "w") // [lr] > w - .replaceAll(/([ \t\n])([a-z])/g, (_, p1, p2) => Math.random() < .5 ? `${p1}${p2}-${p2}` : `${p1}${p2}`) // stutter - .replaceAll(/([^.,!][.,!])([ \t\n])/g, (_, p1, p2) => `${p1} ${selectRandomElement(endings)}${p2}`); // endings - return message; -} - - - -// actual command declaration -export default definePlugin({ - name: "UwUifier", - description: "Simply uwuify commands", - authors: [Devs.echo, Devs.skyevg, Devs.PandaNinjas], - dependencies: ["CommandsAPI", "MessageEventsAPI"], - settings, - - commands: [ - { - name: "uwuify", - description: "uwuifies your messages", - options: [RequiredMessageOption], - - execute: opts => ({ - content: uwuify(findOption(opts, "message", "")), - }), - }, - ], - - onSend(msg: MessageObject) { - // Only run when it's enabled - if (settings.store.uwuEveryMessage) { - msg.content = uwuify(msg.content); - } - }, - - start() { - this.preSend = addPreSendListener((_, msg) => this.onSend(msg)); - this.preEdit = addPreEditListener((_cid, _mid, msg) => - this.onSend(msg) - ); - }, - - stop() { - removePreSendListener(this.preSend); - removePreEditListener(this.preEdit); - }, -}); |