[CodeFactor] Apply fixes
This commit is contained in:
parent
9928c5239f
commit
1f9c34c480
1 changed files with 12 additions and 12 deletions
|
@ -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,22 +16,22 @@ 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') {
|
||||
if (optionChannel?.type !== "GUILD_TEXT") {
|
||||
// Return interaction reply
|
||||
return interaction?.editReply({
|
||||
embeds: [
|
||||
{
|
||||
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(),
|
||||
color: config?.colors?.error as ColorResolvable,
|
||||
footer: {
|
||||
|
@ -66,7 +66,7 @@ export default async (interaction: CommandInteraction) => {
|
|||
return interaction?.editReply({
|
||||
embeds: [
|
||||
{
|
||||
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
|
||||
}.`,
|
||||
|
@ -85,7 +85,7 @@ export default async (interaction: CommandInteraction) => {
|
|||
return interaction?.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: ':toolbox: Admin - Counters [Add]' as string,
|
||||
title: ":toolbox: Admin - Counters [Add]" as string,
|
||||
description: `${optionChannel} is already a counting channel.`,
|
||||
timestamp: new Date(),
|
||||
color: config?.colors?.error as ColorResolvable,
|
||||
|
|
Loading…
Add table
Reference in a new issue