Skip to content

Commit d37eee3

Browse files
authored
break out utils into separate files (#86)
# Break out utils into separate files Having a "Utils" file is extremely bad practice, and should ideally be broken out into separate files or folders pertaining to only one section of the code ex: docker or roles. # Changes * renamed `roleUtils` to roles * renamed `channelUtils` to `channels` * split `docker` and `sleep` into separate files
2 parents aabe656 + df1d6a0 commit d37eee3

File tree

17 files changed

+21
-21
lines changed

17 files changed

+21
-21
lines changed

commands/owner/createRoles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ICommand } from "wokcommands";
2-
import { createRoles } from "../../utils/roleUtils";
2+
import { createRoles } from "../../utils/roles";
33
import chalk from "chalk";
44
import { classModel } from "../../models/classModel";
55
import { staffModel } from "../../models/staffModel";

commands/owner/csClassPoll.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
import chalk from "chalk";
88
import { ICommand } from "wokcommands";
99
import { classModel, IClass } from "../../models/classModel";
10-
import { checkForRoles } from "../../utils/roleUtils";
11-
import { sleep } from "../../utils/util";
10+
import { checkForRoles } from "../../utils/roles";
11+
import { sleep } from "../../utils/sleep";
1212

1313
// Splits any size list into lists of at most `max_list_len`
1414
function split_list<T>(list: T[], max_list_len: number): T[][] {

commands/owner/csCreateChannels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
findCategory,
1111
moveChannel,
1212
concatCategoryName,
13-
} from "../../utils/channelUtils";
13+
} from "../../utils/channels";
1414

1515
function create_default_embed(
1616
client: Client,

commands/owner/staffPoll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import chalk from "chalk";
22
import { MessageEmbed, MessageActionRow, MessageSelectMenu } from "discord.js";
33
import { ICommand } from "wokcommands";
4-
import { checkForRoles } from "../../utils/roleUtils";
4+
import { checkForRoles } from "../../utils/roles";
55

66
export default {
77
name: "staffPoll",

commands/owner/yearPoll.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import chalk from "chalk";
22
import { MessageEmbed, MessageActionRow, MessageSelectMenu } from "discord.js";
33
import { ICommand } from "wokcommands";
4-
import { checkForRoles } from "../../utils/roleUtils";
4+
import { checkForRoles } from "../../utils/roles";
55

66
export default {
77
name: "yearPoll",

commands/user/clear.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ICommand } from "wokcommands";
44
import { classModel } from "../../models/classModel";
55
import { staffModel } from "../../models/staffModel";
66
import { yearModel } from "../../models/yearModel";
7-
import { removeRole } from "../../utils/roleUtils";
7+
import { removeRole } from "../../utils/roles";
88

99
export default {
1010
name: "clear",

commands/user/view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import chalk from "chalk";
22
import { GuildMember } from "discord.js";
33
import { ICommand } from "wokcommands";
4-
import { getUsersRoles } from "../../utils/roleUtils";
4+
import { getUsersRoles } from "../../utils/roles";
55

66
export default {
77
name: "view",

features/interactionCreate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Client, MessageEmbed, GuildMember } from "discord.js";
22
import { yearModel } from "../models/yearModel";
3-
import { removeRole, addNewRole } from "../utils/roleUtils";
3+
import { removeRole, addNewRole } from "../utils/roles";
44
import { staffModel } from "../models/staffModel";
55
import { classModel } from "../models/classModel";
66

features/statuspage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import axios from "axios";
22
import { Client } from "discord.js";
3-
import { isDocker } from "../utils/util";
3+
import { isDocker } from "../utils/docker";
44

55
export default (client: Client): void => {
66
// Check if the bot is running in a docker container by checking if the env variable UPTIME_KUMA_CONTAINERIZED is true

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import WOKCommands from "wokcommands";
44
import path from "path";
55
import chalk from "chalk";
66
import dotenv from "dotenv";
7-
import { isDocker } from "./utils/util";
7+
import { isDocker } from "./utils/docker";
88

99
// import custom modules
10-
import { checkForRoles, checkIfCollectionsExist } from "./utils/roleUtils";
10+
import { checkForRoles, checkIfCollectionsExist } from "./utils/roles";
1111
import { classModel } from "./models/classModel";
1212
import { staffModel } from "./models/staffModel";
1313
import { yearModel } from "./models/yearModel";

0 commit comments

Comments
 (0)