From 9fecc38ef8ed8ccc4655e83060f74347c9d79115 Mon Sep 17 00:00:00 2001 From: John Schiltz Date: Wed, 7 Sep 2022 15:22:50 -0500 Subject: [PATCH] Move util and roleUtils into separate utils folder --- commands/owner/createRoles.ts | 2 +- commands/owner/csClassPoll.ts | 4 ++-- commands/owner/staffPoll.ts | 2 +- commands/owner/yearPoll.ts | 2 +- commands/user/clear.ts | 2 +- commands/user/view.ts | 2 +- features/interactionCreate.ts | 2 +- models/classModel.ts | 2 +- models/staffModel.ts | 2 +- models/yearModel.ts | 2 +- rolesOps.ts => utils/roleUtils.ts | 6 +++--- util.ts => utils/util.ts | 0 12 files changed, 14 insertions(+), 14 deletions(-) rename rolesOps.ts => utils/roleUtils.ts (96%) rename util.ts => utils/util.ts (100%) diff --git a/commands/owner/createRoles.ts b/commands/owner/createRoles.ts index 2b1efd4..17115d0 100644 --- a/commands/owner/createRoles.ts +++ b/commands/owner/createRoles.ts @@ -1,5 +1,5 @@ import { ICommand } from "wokcommands"; -import { createRoles } from "../../rolesOps"; +import { createRoles } from "../../utils/roleUtils"; import chalk from "chalk"; import { classModel } from "../../models/classModel"; import { staffModel } from "../../models/staffModel"; diff --git a/commands/owner/csClassPoll.ts b/commands/owner/csClassPoll.ts index 37457e6..447aab3 100644 --- a/commands/owner/csClassPoll.ts +++ b/commands/owner/csClassPoll.ts @@ -7,8 +7,8 @@ import { import chalk from "chalk"; import { ICommand } from "wokcommands"; import { classModel, IClass } from "../../models/classModel"; -import { checkForRoles } from "../../rolesOps"; -import { sleep } from "../../util"; +import { checkForRoles } from "../../utils/roleUtils"; +import { sleep } from "../../utils/util"; // Splits any size list into lists of at most `max_list_len` function split_list(list: T[], max_list_len: number): T[][] { diff --git a/commands/owner/staffPoll.ts b/commands/owner/staffPoll.ts index 8b6cc06..2a010a3 100644 --- a/commands/owner/staffPoll.ts +++ b/commands/owner/staffPoll.ts @@ -1,7 +1,7 @@ import chalk from "chalk"; import { MessageEmbed, MessageActionRow, MessageSelectMenu } from "discord.js"; import { ICommand } from "wokcommands"; -import { checkForRoles } from "../../rolesOps"; +import { checkForRoles } from "../../utils/roleUtils"; export default { name: "staffPoll", diff --git a/commands/owner/yearPoll.ts b/commands/owner/yearPoll.ts index 2042765..1f434c0 100644 --- a/commands/owner/yearPoll.ts +++ b/commands/owner/yearPoll.ts @@ -1,7 +1,7 @@ import chalk from "chalk"; import { MessageEmbed, MessageActionRow, MessageSelectMenu } from "discord.js"; import { ICommand } from "wokcommands"; -import { checkForRoles } from "../../rolesOps"; +import { checkForRoles } from "../../utils/roleUtils"; export default { name: "yearPoll", diff --git a/commands/user/clear.ts b/commands/user/clear.ts index d3520a9..7c90193 100644 --- a/commands/user/clear.ts +++ b/commands/user/clear.ts @@ -4,7 +4,7 @@ import { ICommand } from "wokcommands"; import { classModel } from "../../models/classModel"; import { staffModel } from "../../models/staffModel"; import { yearModel } from "../../models/yearModel"; -import { removeRole } from "../../rolesOps"; +import { removeRole } from "../../utils/roleUtils"; export default { name: "clear", diff --git a/commands/user/view.ts b/commands/user/view.ts index c6b0cd9..c5eee6e 100644 --- a/commands/user/view.ts +++ b/commands/user/view.ts @@ -1,7 +1,7 @@ import chalk from "chalk"; import { GuildMember } from "discord.js"; import { ICommand } from "wokcommands"; -import { getUsersRoles } from "../../rolesOps"; +import { getUsersRoles } from "../../utils/roleUtils"; export default { name: "view", diff --git a/features/interactionCreate.ts b/features/interactionCreate.ts index 7f25607..25a51b6 100644 --- a/features/interactionCreate.ts +++ b/features/interactionCreate.ts @@ -1,6 +1,6 @@ import { Client, MessageEmbed, GuildMember } from "discord.js"; import { yearModel } from "../models/yearModel"; -import { removeRole, addNewRole } from "../rolesOps"; +import { removeRole, addNewRole } from "../utils/roleUtils"; import { staffModel } from "../models/staffModel"; import { classModel } from "../models/classModel"; diff --git a/models/classModel.ts b/models/classModel.ts index b0d3c07..c2f449e 100644 --- a/models/classModel.ts +++ b/models/classModel.ts @@ -1,5 +1,5 @@ import mongoose, { Schema } from "mongoose"; -import { IRole } from "../rolesOps"; +import { IRole } from "../utils/roleUtils"; export interface IClass extends IRole { id: string; diff --git a/models/staffModel.ts b/models/staffModel.ts index 3d6f3c2..c6b0822 100644 --- a/models/staffModel.ts +++ b/models/staffModel.ts @@ -1,5 +1,5 @@ import mongoose, { Schema } from "mongoose"; -import { IRole } from "../rolesOps"; +import { IRole } from "../utils/roleUtils"; export interface IStaff extends IRole { id: string; diff --git a/models/yearModel.ts b/models/yearModel.ts index dcded9e..dc6463b 100644 --- a/models/yearModel.ts +++ b/models/yearModel.ts @@ -1,5 +1,5 @@ import mongoose, { Schema } from "mongoose"; -import { IRole } from "../rolesOps"; +import { IRole } from "../utils/roleUtils"; export interface IYear extends IRole { id: string; diff --git a/rolesOps.ts b/utils/roleUtils.ts similarity index 96% rename from rolesOps.ts rename to utils/roleUtils.ts index 4b5767b..509d012 100644 --- a/rolesOps.ts +++ b/utils/roleUtils.ts @@ -1,8 +1,8 @@ import { GuildMember, Guild } from "discord.js"; import chalk from "chalk"; -import { classModel } from "./models/classModel"; -import { staffModel } from "./models/staffModel"; -import { yearModel } from "./models/yearModel"; +import { classModel } from "../models/classModel"; +import { staffModel } from "../models/staffModel"; +import { yearModel } from "../models/yearModel"; import { Model } from "mongoose"; export interface IRole { diff --git a/util.ts b/utils/util.ts similarity index 100% rename from util.ts rename to utils/util.ts