From 31107a35971c4d19fe0cd53572be2bbe1ac6b61c Mon Sep 17 00:00:00 2001 From: wiki-Bird <41028518+wiki-Bird@users.noreply.github.com> Date: Wed, 3 Jul 2024 20:17:48 +1200 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20Added=20funnyfont=20upside=20dow?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/funnyfont.ts | 9 +- src/commands/textedit.ts | 205 -------------------------------------- 2 files changed, 7 insertions(+), 207 deletions(-) delete mode 100644 src/commands/textedit.ts diff --git a/src/commands/funnyfont.ts b/src/commands/funnyfont.ts index e6a6397..619ebf8 100644 --- a/src/commands/funnyfont.ts +++ b/src/commands/funnyfont.ts @@ -16,14 +16,15 @@ const funnyfont: Command = { .setRequired(false) .addChoices( { name: "cool edgy", value: "cooledgy" }, - { name: "cursive", value: "cursive" } + { name: "cursive", value: "cursive" }, + { name: "upside down", value: "upsidedown" } ) ) .setDescription('Makes text into a funny font'), execute: async function (interaction: CommandInteraction<'cached' | 'raw'>): Promise { const text = interaction.options.getString("text", true); - const font = interaction.options.getString("font", false) || "cooledgy"; + const font = interaction.options.getString("font", false) || "cursive"; let lowerCaseOut: Array; let upperCaseOut: Array; @@ -42,6 +43,10 @@ const funnyfont: Command = { lowerCaseOut = ['𝓪', '𝓫', '𝓬', '𝓭', '𝓮', '𝓯', '𝓰', '𝓱', '𝓲', '𝓳', '𝓴', '𝓵', '𝓶', '𝓷', '𝓸', '𝓹', '𝓺', '𝓻', '𝓼', '𝓽', '𝓾', '𝓿', '𝔀', '𝔁', '𝔂', '𝔃']; upperCaseOut = ['𝓐', '𝓑', '𝓒', '𝓓', '𝓔', '𝓕', '𝓖', '𝓗', '𝓘', '𝓙', '𝓚', '𝓛', '𝓜', '𝓝', '𝓞', '𝓟', '𝓠', '𝓡', '𝓢', '𝓣', '𝓤', '𝓥', '𝓦', '𝓧', '𝓨', '𝓩']; } + else if (font ==="upsidedown") { + lowerCaseOut = ["ɐ","q","ɔ","p","ǝ","ɟ","ƃ","ɥ","ᴉ","ɾ","ʞ","l","ɯ","u","o","d","b","ɹ","s","ʇ","n","ʌ","ʍ","x","ʎ","z"]; + upperCaseOut = ["∀","q","Ɔ","p","Ǝ","Ⅎ","פ","H","I","ſ","ʞ","˥","W","N","O","Ԁ","Q","ɹ","S","┴","∩","Λ","M","X","⅄","Z"]; + } else{ return; } diff --git a/src/commands/textedit.ts b/src/commands/textedit.ts deleted file mode 100644 index ad7b8e4..0000000 --- a/src/commands/textedit.ts +++ /dev/null @@ -1,205 +0,0 @@ - - -import { SlashCommandBuilder } from '@discordjs/builders'; -import Command from '../types/Command'; - -const textedit: Command = { - data: new SlashCommandBuilder() - .setName('textedit') - .addStringOption(option => - option.setName("action") - .setDescription("The action to do.") - .setRequired(true) - .addChoices( - { name: "uwu", value: "uwu" }, - { name: "zizek", value: "zizek" }, - { name: "maoist_standard_english", value: "maoist_standard_english" } - ) - ) - .addStringOption(option => - option.setName("text") - .setDescription("The text to do stuff with.") - .setRequired(false) - ) - .addStringOption(option => - option.setName("message") - .setDescription("The message to do stuff with (ID/LINK).") - .setRequired(false) - ) - .setDescription('Do fun stuff with text.'), - - execute: async function (interaction): Promise { - await interaction.deferReply(); - - const action = interaction.options.getString("action", true); - const text = interaction.options.getString("text", false); - const message = interaction.options.getString("message", false); - - let reply = ""; - - if (!interaction.guild) {return;} - - if (!text && !message) { - interaction.editReply({ content: "You must specify text or a message." }); - return; - } - else if (text && message) { - interaction.editReply({ content: "You can't specify both a text and a message." }); - return; - } - - if (action === "uwu") { - const uwu = text!.replace(/(?:r|l)/g, "w") - .replace(/(?:R|L)/g, "W") - .replace(/n([aeiou])/g, 'ny$1') - .replace(/N([aeiou])/g, 'Ny$1') - .replace(/N([AEIOU])/g, 'Ny$1') - .replace(/wh([aeiou])/g, 'wa$1') - .replace(/ove/g, "uv") - .replace(/!+/g, " " + "uwu"); - - reply = uwu; - } - else if (action === "zizek") { - const text2 = text!.replace(/s/g, "sh") - .replace(/d /g, "dj ") - .replace(/t/g, "d"); - - const words = text2!.split(" "); - const newWords = []; - let newWord = ""; - - for (let i = 0; i < words.length; i++) { - - if (i % 5 === 0 && i % 15 === 0) { - newWord += " *sniff* "; - } - else if (i % 2 === 0 && i % 8 === 0) { - newWord += words[i][0] + "-" + words[i]; - } - else if (i % 9 === 0 && i % 14 === 0) { - newWord += " *pauses* "; - } - newWord += words[i]; - newWords.push(newWord); - newWord = ""; - } - - // one in 18 chance to add "an- and one more thing", one in 20 chance to add ". pure ideology." to the end - const random = Math.floor(Math.random() * 18); - if (random === 0) { - newWords.push("an- and one more thing, i apologise, one more thing...."); - } - const random2 = Math.floor(Math.random() * 20); - if (random2 === 0) { - newWords.push(". pure ideology."); - } - - reply = newWords.join(" "); - } - else if (action === "maoist_standard_english") { - // Server not in list - ["521856622998323202", "1034219118276120586"] - if (interaction.guild.id !== "521856622998323202" && interaction.guild.id !== "1034219118276120586") { - interaction.editReply({ content: "This action is server restricted and cannot be used here, sorry." }); - return; - } - - const specificReplacements = { - 'american soldiers': 'Imperial storm troopers', - 'america': 'AmeriKKKa', - 'american': 'Burger', - 'auckland': 'AucKKKland', - 'australia': 'AuSStralia', - 'austria': 'AuSStria', - 'austerity': 'AuSSterity', - 'belarus': 'BelaruZ', - 'brazil': 'BraSSil', - 'canada': 'KKKanada', - 'cappuccino': 'KKKappuccino', - 'capitalism': 'KKKapitali$m', - 'christchurch': 'KKKristchurch', - 'class': 'KKKlaSS', - 'clinton': 'KKKlinton', - 'colonise': 'KKKoloni$e', - 'coloniser': 'KKKoloni$er', - 'community': 'KKKommunity', - 'consumer': 'KKKon$umer', - 'cracker': 'craKKKa', - 'cream': 'KKKream', - 'croatia': 'KKKroatia', - 'culture': 'KKKulture', - 'democrats': 'DemoKKKRats', - 'domination': 'McDomination', - 'economist': 'eKKKonomiSSt', - 'estonia': 'ESStonia', - 'france': 'FranSSe', - 'germany': 'DeutSSchland', - 'hillary': 'KKKillary', - 'historian': 'hiSStorian', - 'history': 'theirstory', - 'israel': 'the Zionist entity', - 'kansas': 'KKKanSSa$', - 'kraut': 'KKKraut', - 'patrick': 'PatricKKK', - 'police': 'pigs', - 'revenue': 'imperial super profits', - 'russia': 'RuZZia', - 'shortage': 'fuck the global south', - 'snowflake': 'snowflaKKKe', - 'south africa': 'South AfriKKKa', - 'south korea': 'South KKKorea', - 'spain': '$pain', - 'starvation': 'white death', - 'state': 'SState', - 'sweden': 'SSweden', - 'switzerland': 'SSwitzerland', - 'to their surprise': 'to their white surprise', - 'uk': 'the so-called United Kingdom', - 'united kingdom': 'the so-called United Kingdom', - 'united states': 'The United States of Lyncherdom', - 'united states of America': 'United $$nake$$ of AmeriKKKa', - 'usa': 'U$A', - 'us': 'U$', - 'us soldiers': 'mercenary techno-legion GI', - 'wellington': 'the so-called capital of New Zealand', - 'west': 'settler-colonialist', - 'western': 'imperialist', - 'white': 'Whitey', - 'chris luxon': 'so called honourable prime minister KKKris luxon' - }; - - - let result = text?.toLowerCase() ?? ""; - - // Apply specific replacements - for (const [key, value] of Object.entries(specificReplacements)) { - const regex = new RegExp(key, 'gi'); - result = result.replace(regex, value); - } - // General character replacements combined into a single replace() call - result = result.replace(/ck|kk|k|ss|s/gi, function(match) { - switch(match.toLowerCase()) { - case 'ck': - case 'kk': - return 'KKK'; - case 'k': - return 'KKK'; - case 'ss': - return 'SS'; - case 's': - return '$'; - default: - return match; // Just in case - } - }); - - reply = result; - } - - interaction.editReply({ content: reply }); - - } -} - -export default textedit; \ No newline at end of file