Skip to content

Commit

Permalink
๐Ÿ“ Added funnyfonts
Browse files Browse the repository at this point in the history
  • Loading branch information
wiki-Bird committed Jun 22, 2024
1 parent 7d43844 commit d49204b
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions src/commands/funnyfont.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import Command from '../types/Command';
import { CommandInteraction } from 'discord.js';
import { SlashCommandBuilder } from '@discordjs/builders';

const funnyfont: Command = {
data: new SlashCommandBuilder()
.setName('funnyfont')
.addStringOption(option =>
option.setName("text")
.setDescription("The text to make into funny font")
.setRequired(true)
)
.addStringOption(option =>
option.setName("font")
.setDescription("The font to choose")
.setRequired(false)
.addChoices(
{ name: "cool edgy", value: "cooledgy" },
{ name: "cursive", value: "cursive" }
)
)
.setDescription('Makes text into a funny font'),

execute: async function (interaction: CommandInteraction<'cached' | 'raw'>): Promise<void> {
const text = interaction.options.getString("text", true);
const font = interaction.options.getString("font", false) || "cooledgy";

let lowerCaseOut: Array<string>;
let upperCaseOut: Array<string>;

// abcdefghijklmnopqrstuvwxyz
// ABCDEFGHIJKLMNOPQRSTUVWXYZ
// 0123456789

let outputText = "";

if (font === "cooledgy") {
lowerCaseOut = ['๐–†', '๐–‡', '๐–ˆ', '๐–‰', '๐–Š', '๐–‹', '๐–Œ', '๐–', '๐–Ž', '๐–', '๐–', '๐–‘', '๐–’', '๐–“', '๐–”', '๐–•', '๐––', '๐–—', '๐–˜', '๐–™', '๐–š', '๐–›', '๐–œ', '๐–', '๐–ž', '๐–Ÿ'];
upperCaseOut = ['๐•ฌ', '๐•ญ', '๐•ฎ', '๐•ฏ', '๐•ฐ', '๐•ฑ', '๐•ฒ', '๐•ณ', '๐•ด', '๐•ต', '๐•ถ', '๐•ท', '๐•ธ', '๐•น', '๐•บ', '๐•ป', '๐•ผ', '๐•ฝ', '๐•พ', '๐•ฟ', '๐–€', '๐–', '๐–‚', '๐–ƒ', '๐–„', '๐–…'];
}
else if (font === "cursive") {
lowerCaseOut = ['๐“ช', '๐“ซ', '๐“ฌ', '๐“ญ', '๐“ฎ', '๐“ฏ', '๐“ฐ', '๐“ฑ', '๐“ฒ', '๐“ณ', '๐“ด', '๐“ต', '๐“ถ', '๐“ท', '๐“ธ', '๐“น', '๐“บ', '๐“ป', '๐“ผ', '๐“ฝ', '๐“พ', '๐“ฟ', '๐”€', '๐”', '๐”‚', '๐”ƒ'];
upperCaseOut = ['๐“', '๐“‘', '๐“’', '๐““', '๐“”', '๐“•', '๐“–', '๐“—', '๐“˜', '๐“™', '๐“š', '๐“›', '๐“œ', '๐“', '๐“ž', '๐“Ÿ', '๐“ ', '๐“ก', '๐“ข', '๐“ฃ', '๐“ค', '๐“ฅ', '๐“ฆ', '๐“ง', '๐“จ', '๐“ฉ'];
}
else{
return;
}

for(let i=0; i<text.length; i++){
if (!/[a-zA-Z]/.test(text[i])){
outputText += text[i];
continue;
}

const position = text[i].toUpperCase().charCodeAt(0) - 'A'.charCodeAt(0);
const isUpper = text[i] === text[i].toUpperCase();
if (isUpper){
outputText += upperCaseOut[position];
}
else{
outputText += lowerCaseOut[position];
}
}

interaction.reply({ content: outputText });
}
}

export default funnyfont;

0 comments on commit d49204b

Please sign in to comment.