Skip to content

Commit

Permalink
Run auto fix
Browse files Browse the repository at this point in the history
  • Loading branch information
niklhut committed Dec 1, 2023
1 parent d614a7e commit b6372ec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/commands/coach/session/quit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/commands/coach/session/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 });
},
Expand Down
1 change: 1 addition & 0 deletions src/utils/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/utils/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ChannelType, {
Message,
RoleResolvable,
User,
UserResolvable
UserResolvable,
} from "discord.js";
import moment from "moment";
import { Command, StringReplacements } from "../../typings";
Expand Down Expand Up @@ -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}`);
}
}

Expand All @@ -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}`);
}
}

0 comments on commit b6372ec

Please sign in to comment.