From b6372ecfffdaa4837eea964f423b10cc9bf3e965 Mon Sep 17 00:00:00 2001 From: niklhut <49069026+niklhut@users.noreply.github.com> Date: Fri, 1 Dec 2023 20:48:27 +0100 Subject: [PATCH] Run auto fix --- src/commands/coach/session/quit.ts | 4 ++-- src/commands/coach/session/start.ts | 4 ++-- src/utils/errors.ts | 1 + src/utils/general.ts | 6 +++--- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/commands/coach/session/quit.ts b/src/commands/coach/session/quit.ts index 941db49..14b8813 100644 --- a/src/commands/coach/session/quit.ts +++ b/src/commands/coach/session/quit.ts @@ -3,7 +3,7 @@ import { Command } from "../../../../typings"; import { GuildModel } from "../../../models/guilds"; import { UserModel } from "../../../models/users"; import moment from "moment"; -import {removeRoleFromUser} from "../../../utils/general"; +import { removeRoleFromUser } from "../../../utils/general"; const command: Command = { name: "quit", @@ -34,7 +34,7 @@ const command: Command = { return await client.utils.embeds.SimpleEmbed(interaction, { title: "Coaching System", text: "You Have no Active Coaching Session.", empheral: true }); } - await removeRoleFromUser(g, user, 'active_session') + await removeRoleFromUser(g, user, "active_session"); //TODO: Terminate Rooms diff --git a/src/commands/coach/session/start.ts b/src/commands/coach/session/start.ts index 49aa152..5698c25 100644 --- a/src/commands/coach/session/start.ts +++ b/src/commands/coach/session/start.ts @@ -5,7 +5,7 @@ import { UserModel } from "../../../models/users"; import { SessionModel, sessionRole } from "../../../models/sessions"; import { Queue } from "../../../models/queues"; import { DocumentType } from "@typegoose/typegoose"; -import {assignRoleToUser} from "../../../utils/general"; +import { assignRoleToUser } from "../../../utils/general"; const command: Command = { name: "start", @@ -60,7 +60,7 @@ const command: Command = { userEntry.sessions.push(session._id); await userEntry.save(); - await assignRoleToUser(g, user, 'active_session') + await assignRoleToUser(g, user, "active_session"); client.utils.embeds.SimpleEmbed(interaction, { title: "Coaching System", text: "The Session was started.", empheral: true }); }, diff --git a/src/utils/errors.ts b/src/utils/errors.ts index 8dac797..8c7bf53 100644 --- a/src/utils/errors.ts +++ b/src/utils/errors.ts @@ -10,6 +10,7 @@ export const errorMessage = async (interaction: Message | discord.CommandInterac embed.setTitle(":x: __An Error Occured:__"); embed.setDescription((error instanceof Error) ? `${error.message}` : `${error}`); const res = await interaction.reply({ embeds: [embed] }); + /* eslint-disable @typescript-eslint/no-explicit-any */ let m: any = null; if (res instanceof Message) { m = res; diff --git a/src/utils/general.ts b/src/utils/general.ts index 7b19ff6..190d89d 100644 --- a/src/utils/general.ts +++ b/src/utils/general.ts @@ -10,7 +10,7 @@ import ChannelType, { Message, RoleResolvable, User, - UserResolvable + UserResolvable, } from "discord.js"; import moment from "moment"; import { Command, StringReplacements } from "../../typings"; @@ -408,7 +408,7 @@ export async function assignRoleToUser(g: Guild, user: User, roleName: string) { if (role && member && !member.roles.cache.has(role.id)) { await member.roles.add(role); } else { - console.error(`Could not assign role: ${roleName} to ${user.username} on guild: ${g.name}`) + console.error(`Could not assign role: ${roleName} to ${user.username} on guild: ${g.name}`); } } @@ -425,6 +425,6 @@ export async function removeRoleFromUser(g: Guild, user: User, roleName: string) if (role && member && member.roles.cache.has(role.id)) { await member.roles.remove(role); } else { - console.error(`Could not remove role: ${roleName} from ${user.username} on guild: ${g.name}`) + console.error(`Could not remove role: ${roleName} from ${user.username} on guild: ${g.name}`); } } \ No newline at end of file