From 470e8ce45ec11395ba2bd2e0383e4b2d35778399 Mon Sep 17 00:00:00 2001 From: Vermium Sifell Date: Sun, 10 Apr 2022 22:08:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20code=20smel?= =?UTF-8?q?l=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/admin/counters/modules/add.ts | 26 ++++++++++------------ 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/commands/admin/counters/modules/add.ts b/src/commands/admin/counters/modules/add.ts index c19514f..a058d09 100644 --- a/src/commands/admin/counters/modules/add.ts +++ b/src/commands/admin/counters/modules/add.ts @@ -1,14 +1,14 @@ // Dependencies -import { ColorResolvable, CommandInteraction } from "discord.js"; +import { ColorResolvable, CommandInteraction } from 'discord.js'; // Configurations -import config from "../../../../../config.json"; +import config from '../../../../../config.json'; // Handlers -import logger from "../../../../handlers/logger"; +import logger from '../../../../handlers/logger'; // Models -import counterSchema from "../../../../helpers/database/models/counterSchema"; +import counterSchema from '../../../../helpers/database/models/counterSchema'; // Function export default async (interaction: CommandInteraction) => { @@ -16,20 +16,19 @@ export default async (interaction: CommandInteraction) => { const { options, guild, user } = interaction; // Channel option - const optionChannel = options?.getChannel("channel"); + const optionChannel = options?.getChannel('channel'); // Word option - const optionWord = options?.getString("word"); + const optionWord = options?.getString('word'); // Start option - const optionStart = options?.getNumber("start"); + const optionStart = options?.getNumber('start'); - if (optionChannel?.type !== "GUILD_TEXT") { - // Embed object + if (optionChannel?.type !== 'GUILD_TEXT') { const embed = { - title: ":toolbox: Admin - Counters [Add]" as string, + title: ':toolbox: Admin - Counters [Add]' as string, description: - "That channel is not supported, it needs to be a text channel." as string, + 'That channel is not supported, it needs to be a text channel.' as string, timestamp: new Date() as Date, color: config?.colors?.error as ColorResolvable, footer: { @@ -56,9 +55,8 @@ export default async (interaction: CommandInteraction) => { counter: optionStart || 0, }); - // Embed object const embed = { - title: ":toolbox: Admin - Counters [Add]" as string, + title: ':toolbox: Admin - Counters [Add]' as string, description: `${optionChannel} is now counting when hearing word ${optionWord} and it starts at number ${ optionStart || 0 @@ -82,7 +80,7 @@ export default async (interaction: CommandInteraction) => { // Embed object const embed = { - title: ":toolbox: Admin - Counters [Add]" as string, + title: ':toolbox: Admin - Counters [Add]' as string, description: `${optionChannel} is already a counting channel.` as string, timestamp: new Date() as Date, color: config?.colors?.error as ColorResolvable,