From 974985586d133fe0a99ef7e6c8f3d9f327ec0573 Mon Sep 17 00:00:00 2001 From: WatDuhHekBro <44940783+WatDuhHekBro@users.noreply.github.com> Date: Tue, 30 Mar 2021 22:22:25 -0500 Subject: [PATCH] Rearranged command categories --- src/commands/fun/eco.ts | 8 ++++---- .../fun/{subcommands => modules}/eco-core.ts | 0 .../fun/{subcommands => modules}/eco-extras.ts | 0 .../fun/{subcommands => modules}/eco-shop-items.ts | 0 .../fun/{subcommands => modules}/eco-shop.ts | 0 .../fun/{subcommands => modules}/eco-utils.ts | 0 src/commands/fun/owoify.ts | 6 +++--- src/commands/{ => system}/admin.ts | 12 ++++++------ src/commands/{ => system}/help.ts | 8 ++++---- src/commands/{utilities => utility}/desc.ts | 0 src/commands/{utilities => utility}/emote.ts | 2 +- src/commands/{ => utility}/info.ts | 8 ++++---- src/commands/{utilities => utility}/lsemotes.ts | 0 .../subcommands => utility/modules}/emote-utils.ts | 0 src/commands/{utilities => utility}/react.ts | 2 +- src/commands/{utilities => utility}/say.ts | 0 src/commands/{ => utility}/scanemotes.ts | 4 ++-- src/commands/{utilities => utility}/shorten.ts | 0 src/commands/{utilities => utility}/time.ts | 0 src/core/permissions.ts | 2 +- 20 files changed, 26 insertions(+), 26 deletions(-) rename src/commands/fun/{subcommands => modules}/eco-core.ts (100%) rename src/commands/fun/{subcommands => modules}/eco-extras.ts (100%) rename src/commands/fun/{subcommands => modules}/eco-shop-items.ts (100%) rename src/commands/fun/{subcommands => modules}/eco-shop.ts (100%) rename src/commands/fun/{subcommands => modules}/eco-utils.ts (100%) rename src/commands/{ => system}/admin.ts (96%) rename src/commands/{ => system}/help.ts (96%) rename src/commands/{utilities => utility}/desc.ts (100%) rename src/commands/{utilities => utility}/emote.ts (89%) rename src/commands/{ => utility}/info.ts (98%) rename src/commands/{utilities => utility}/lsemotes.ts (100%) rename src/commands/{utilities/subcommands => utility/modules}/emote-utils.ts (100%) rename src/commands/{utilities => utility}/react.ts (98%) rename src/commands/{utilities => utility}/say.ts (100%) rename src/commands/{ => utility}/scanemotes.ts (99%) rename src/commands/{utilities => utility}/shorten.ts (100%) rename src/commands/{utilities => utility}/time.ts (100%) diff --git a/src/commands/fun/eco.ts b/src/commands/fun/eco.ts index 6df36ae..380cc33 100644 --- a/src/commands/fun/eco.ts +++ b/src/commands/fun/eco.ts @@ -1,8 +1,8 @@ import Command from "../../core/command"; -import {isAuthorized, getMoneyEmbed} from "./subcommands/eco-utils"; -import {DailyCommand, PayCommand, GuildCommand, LeaderboardCommand} from "./subcommands/eco-core"; -import {BuyCommand, ShopCommand} from "./subcommands/eco-shop"; -import {MondayCommand} from "./subcommands/eco-extras"; +import {isAuthorized, getMoneyEmbed} from "./modules/eco-utils"; +import {DailyCommand, PayCommand, GuildCommand, LeaderboardCommand} from "./modules/eco-core"; +import {BuyCommand, ShopCommand} from "./modules/eco-shop"; +import {MondayCommand} from "./modules/eco-extras"; import {callMemberByUsername} from "../../core/libd"; export default new Command({ diff --git a/src/commands/fun/subcommands/eco-core.ts b/src/commands/fun/modules/eco-core.ts similarity index 100% rename from src/commands/fun/subcommands/eco-core.ts rename to src/commands/fun/modules/eco-core.ts diff --git a/src/commands/fun/subcommands/eco-extras.ts b/src/commands/fun/modules/eco-extras.ts similarity index 100% rename from src/commands/fun/subcommands/eco-extras.ts rename to src/commands/fun/modules/eco-extras.ts diff --git a/src/commands/fun/subcommands/eco-shop-items.ts b/src/commands/fun/modules/eco-shop-items.ts similarity index 100% rename from src/commands/fun/subcommands/eco-shop-items.ts rename to src/commands/fun/modules/eco-shop-items.ts diff --git a/src/commands/fun/subcommands/eco-shop.ts b/src/commands/fun/modules/eco-shop.ts similarity index 100% rename from src/commands/fun/subcommands/eco-shop.ts rename to src/commands/fun/modules/eco-shop.ts diff --git a/src/commands/fun/subcommands/eco-utils.ts b/src/commands/fun/modules/eco-utils.ts similarity index 100% rename from src/commands/fun/subcommands/eco-utils.ts rename to src/commands/fun/modules/eco-utils.ts diff --git a/src/commands/fun/owoify.ts b/src/commands/fun/owoify.ts index 789d74a..af041df 100644 --- a/src/commands/fun/owoify.ts +++ b/src/commands/fun/owoify.ts @@ -1,12 +1,12 @@ -/// @ts-nocheck import Command from "../../core/command"; -import {getContent} from "../../core/libd"; +import {getContent} from "../../core/lib"; +import {URL} from "url"; export default new Command({ description: "OwO-ifies the input.", async run($) { let url = new URL(`https://nekos.life/api/v2/owoify?text=${$.args.join(" ")}`); - const content = await getContent(url.toString()); + const content = (await getContent(url.toString())) as any; // Apparently, the object in question is {owo: string}. $.channel.send(content.owo); } }); diff --git a/src/commands/admin.ts b/src/commands/system/admin.ts similarity index 96% rename from src/commands/admin.ts rename to src/commands/system/admin.ts index 72c5686..15ab73d 100644 --- a/src/commands/admin.ts +++ b/src/commands/system/admin.ts @@ -1,10 +1,10 @@ -import Command, {handler} from "../core/command"; -import {clean} from "../core/lib"; -import {botHasPermission} from "../core/libd"; -import {Config, Storage} from "../core/structures"; -import {getPermissionLevel, getPermissionName} from "../core/permissions"; +import Command, {handler} from "../../core/command"; +import {clean} from "../../core/lib"; +import {botHasPermission} from "../../core/libd"; +import {Config, Storage} from "../../core/structures"; +import {getPermissionLevel, getPermissionName} from "../../core/permissions"; import {Permissions} from "discord.js"; -import {logs} from "../globals"; +import {logs} from "../../globals"; function getLogBuffer(type: string) { return { diff --git a/src/commands/help.ts b/src/commands/system/help.ts similarity index 96% rename from src/commands/help.ts rename to src/commands/system/help.ts index 71f2ae3..fdf1249 100644 --- a/src/commands/help.ts +++ b/src/commands/system/help.ts @@ -1,7 +1,7 @@ -import Command from "../core/command"; -import {toTitleCase} from "../core/lib"; -import {loadableCommands, categories} from "../core/command"; -import {getPermissionName} from "../core/permissions"; +import Command from "../../core/command"; +import {toTitleCase} from "../../core/lib"; +import {loadableCommands, categories} from "../../core/command"; +import {getPermissionName} from "../../core/permissions"; export default new Command({ description: "Lists all commands. If a command is specified, their arguments are listed as well.", diff --git a/src/commands/utilities/desc.ts b/src/commands/utility/desc.ts similarity index 100% rename from src/commands/utilities/desc.ts rename to src/commands/utility/desc.ts diff --git a/src/commands/utilities/emote.ts b/src/commands/utility/emote.ts similarity index 89% rename from src/commands/utilities/emote.ts rename to src/commands/utility/emote.ts index b84d9ef..addaec0 100644 --- a/src/commands/utilities/emote.ts +++ b/src/commands/utility/emote.ts @@ -1,5 +1,5 @@ import Command from "../../core/command"; -import {queryClosestEmoteByName} from "./subcommands/emote-utils"; +import {queryClosestEmoteByName} from "./modules/emote-utils"; import {botHasPermission} from "../../core/libd"; import {Permissions} from "discord.js"; diff --git a/src/commands/info.ts b/src/commands/utility/info.ts similarity index 98% rename from src/commands/info.ts rename to src/commands/utility/info.ts index b95f19a..e2e6025 100644 --- a/src/commands/info.ts +++ b/src/commands/utility/info.ts @@ -1,10 +1,10 @@ import {MessageEmbed, version as djsversion} from "discord.js"; import ms from "ms"; import os from "os"; -import Command from "../core/command"; -import {formatBytes, trimArray} from "../core/lib"; -import {getMemberByUsername} from "../core/libd"; -import {verificationLevels, filterLevels, regions} from "../defs/info"; +import Command from "../../core/command"; +import {formatBytes, trimArray} from "../../core/lib"; +import {getMemberByUsername} from "../../core/libd"; +import {verificationLevels, filterLevels, regions} from "../../defs/info"; import moment from "moment"; import utc from "moment"; import {Guild} from "discord.js"; diff --git a/src/commands/utilities/lsemotes.ts b/src/commands/utility/lsemotes.ts similarity index 100% rename from src/commands/utilities/lsemotes.ts rename to src/commands/utility/lsemotes.ts diff --git a/src/commands/utilities/subcommands/emote-utils.ts b/src/commands/utility/modules/emote-utils.ts similarity index 100% rename from src/commands/utilities/subcommands/emote-utils.ts rename to src/commands/utility/modules/emote-utils.ts diff --git a/src/commands/utilities/react.ts b/src/commands/utility/react.ts similarity index 98% rename from src/commands/utilities/react.ts rename to src/commands/utility/react.ts index cc7c031..152e98d 100644 --- a/src/commands/utilities/react.ts +++ b/src/commands/utility/react.ts @@ -1,6 +1,6 @@ import Command from "../../core/command"; import {Message, Channel, TextChannel} from "discord.js"; -import {queryClosestEmoteByName} from "./subcommands/emote-utils"; +import {queryClosestEmoteByName} from "./modules/emote-utils"; export default new Command({ description: diff --git a/src/commands/utilities/say.ts b/src/commands/utility/say.ts similarity index 100% rename from src/commands/utilities/say.ts rename to src/commands/utility/say.ts diff --git a/src/commands/scanemotes.ts b/src/commands/utility/scanemotes.ts similarity index 99% rename from src/commands/scanemotes.ts rename to src/commands/utility/scanemotes.ts index 9596f9f..b087793 100644 --- a/src/commands/scanemotes.ts +++ b/src/commands/utility/scanemotes.ts @@ -1,5 +1,5 @@ -import Command, {handler} from "../core/command"; -import {pluralise} from "../core/lib"; +import Command, {handler} from "../../core/command"; +import {pluralise} from "../../core/lib"; import moment from "moment"; import {Collection, TextChannel} from "discord.js"; diff --git a/src/commands/utilities/shorten.ts b/src/commands/utility/shorten.ts similarity index 100% rename from src/commands/utilities/shorten.ts rename to src/commands/utility/shorten.ts diff --git a/src/commands/utilities/time.ts b/src/commands/utility/time.ts similarity index 100% rename from src/commands/utilities/time.ts rename to src/commands/utility/time.ts diff --git a/src/core/permissions.ts b/src/core/permissions.ts index c4c89ba..37b0000 100644 --- a/src/core/permissions.ts +++ b/src/core/permissions.ts @@ -63,6 +63,6 @@ export function getPermissionLevel(member: GuildMember): number { } export function getPermissionName(level: number) { - if (level > length || length < 0) return "N/A"; + if (level > length || level < 0) return "N/A"; else return PermissionLevels[level].name; }