From 574a9bc58bb85c38ab5a5cacf3a93e4a679c12e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aura=20Rom=C3=A1n?= Date: Sun, 9 Apr 2023 14:13:37 +0200 Subject: [PATCH] refactor: remove catfact (#2447) --- src/commands/Animal/catfact.ts | 31 ------------------- src/commands/General/v7.ts | 1 + src/languages/en-US/commands/animal.json | 7 +---- .../1594757329224-V13_MigrateAnalytics.json | 7 ----- .../i18n/languageKeys/keys/commands/Animal.ts | 3 -- 5 files changed, 2 insertions(+), 47 deletions(-) delete mode 100644 src/commands/Animal/catfact.ts diff --git a/src/commands/Animal/catfact.ts b/src/commands/Animal/catfact.ts deleted file mode 100644 index 95a2af96c0d..00000000000 --- a/src/commands/Animal/catfact.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { LanguageKeys } from '#lib/i18n/languageKeys'; -import { SkyraCommand } from '#lib/structures'; -import { assetsFolder } from '#utils/constants'; -import { getColor } from '#utils/util'; -import { ApplyOptions } from '@sapphire/decorators'; -import { send } from '@sapphire/plugin-editable-commands'; -import { PermissionFlagsBits } from 'discord-api-types/v9'; -import { Message, MessageEmbed } from 'discord.js'; -import { readFile } from 'node:fs/promises'; -import { join } from 'node:path'; - -@ApplyOptions({ - aliases: ['kittenfact'], - description: LanguageKeys.Commands.Animal.CatfactDescription, - detailedDescription: LanguageKeys.Commands.Animal.CatfactExtended, - requiredClientPermissions: [PermissionFlagsBits.EmbedLinks] -}) -export class UserCommand extends SkyraCommand { - private facts: readonly string[] = []; - - public messageRun(message: Message, args: SkyraCommand.Args) { - const fact = this.facts[Math.floor(Math.random() * this.facts.length)]; - const embed = new MessageEmbed().setColor(getColor(message)).setTitle(args.t(LanguageKeys.Commands.Animal.CatfactTitle)).setDescription(fact); - return send(message, { embeds: [embed] }); - } - - public async onLoad() { - const text = await readFile(join(assetsFolder, 'data', 'catfacts.json'), 'utf-8'); - this.facts = JSON.parse(text); - } -} diff --git a/src/commands/General/v7.ts b/src/commands/General/v7.ts index 1e3181b9b0d..cd22586abb6 100644 --- a/src/commands/General/v7.ts +++ b/src/commands/General/v7.ts @@ -17,6 +17,7 @@ const row = makeRow(ButtonSkyraV7); 'bd', 'birthday', 'birthdays', + 'catfact', 'chucknorris', 'country', 'ctime', diff --git a/src/languages/en-US/commands/animal.json b/src/languages/en-US/commands/animal.json index b11a4a2f0f6..01a3688af94 100644 --- a/src/languages/en-US/commands/animal.json +++ b/src/languages/en-US/commands/animal.json @@ -7,11 +7,6 @@ "title": "Click here if the image fails to load", "source": "source" }, - "catfactDescription": "Let me tell you a mysterious cat fact.", - "catfactExtended": { - "extendedHelp": "You know cats are very curious, right? They certainly have a lot of fun and weird facts.\nWith this command you will get a random fact." - }, - "catfactTitle": "Cat Fact", "dogDescription": "Cute doggos! ❤", "dogExtended": { "extendedHelp": "Do **you** know how cute dogs are? They are so beautiful!\nThis command uses [dog.ceo](https://dog.ceo) to show pictures of the cuttest doggos!" @@ -28,4 +23,4 @@ "shibeExtended": { "extendedHelp": "Everyone loves shibas, I shall love them aswell! They're so adorable ❤" } -} \ No newline at end of file +} diff --git a/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.json b/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.json index 1fd63f26cae..3ec40180189 100644 --- a/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.json +++ b/src/lib/database/migrations/1594757329224-V13_MigrateAnalytics.json @@ -83,13 +83,6 @@ "subCategory": "General" } ], - [ - "catfact", - { - "category": "Animal", - "subCategory": "General" - } - ], [ "dog", { diff --git a/src/lib/i18n/languageKeys/keys/commands/Animal.ts b/src/lib/i18n/languageKeys/keys/commands/Animal.ts index 8bd4ce64812..9c2316df9a3 100644 --- a/src/lib/i18n/languageKeys/keys/commands/Animal.ts +++ b/src/lib/i18n/languageKeys/keys/commands/Animal.ts @@ -4,9 +4,6 @@ import { T } from '#lib/types'; export const BunnyDescription = T('commands/animal:bunnyDescription'); export const BunnyExtended = T('commands/animal:bunnyExtended'); export const BunnyEmbedData = T<{ title: string; source: string }>('commands/animal:bunnyEmbedData'); -export const CatfactDescription = T('commands/animal:catfactDescription'); -export const CatfactExtended = T('commands/animal:catfactExtended'); -export const CatfactTitle = T('commands/animal:catfactTitle'); export const DogDescription = T('commands/animal:dogDescription'); export const DogExtended = T('commands/animal:dogExtended'); export const FoxDescription = T('commands/animal:foxDescription');