🩹 code smells

This commit is contained in:
Axel Olausson Holtenäs 2022-04-14 04:05:33 +02:00
parent e1caeffa75
commit 92989c14cb
No known key found for this signature in database
GPG key ID: 9347A5E873995701
17 changed files with 16 additions and 19 deletions

View file

@ -13,7 +13,6 @@ import logger from "@logger";
import timeoutSchema from "@schemas/timeout";
// Helpers
import pluralize from "@helpers/pluralize";
import fetchUser from "@helpers/fetchUser";
import fetchGuild from "@helpers/fetchGuild";

View file

@ -43,7 +43,7 @@ export default {
);
},
execute: async (interaction: CommandInteraction) => {
const { options, guild, user } = interaction;
const { options, guild } = interaction;
const discordChannel = options?.getChannel("channel");
const countingWord = options?.getString("word");

View file

@ -32,7 +32,7 @@ export default {
);
},
execute: async (interaction: CommandInteraction) => {
const { options, guild, user } = interaction;
const { options, guild } = interaction;
const discordChannel = options?.getChannel("channel");

View file

@ -13,7 +13,6 @@ import {
import logger from "@logger";
// Helpers
import pluralize from "@helpers/pluralize";
// Models
import fetchUser from "@helpers/fetchUser";
@ -39,7 +38,7 @@ export default {
);
},
execute: async (interaction: CommandInteraction) => {
const { options, user, guild } = interaction;
const { options, guild } = interaction;
const discordUser = options.getUser("user");
const creditAmount = options.getInteger("amount");

View file

@ -40,7 +40,7 @@ export default {
},
execute: async (interaction: CommandInteraction) => {
// Destructure
const { guild, user, options } = interaction;
const { guild, options } = interaction;
// User option
const optionUser = options?.getUser("user");

View file

@ -46,7 +46,7 @@ export default {
},
execute: async (interaction: CommandInteraction) => {
// Destructure member
const { guild, options, user } = interaction;
const { guild, options } = interaction;
// Get options
const optionFromUser = options?.getUser("from");

View file

@ -25,7 +25,7 @@ export default {
)
),
async execute(interaction: CommandInteraction) {
const { options, guild, user, commandName } = interaction;
const { options } = interaction;
if (options?.getSubcommand() === "view") {
logger?.verbose(`Executing view subcommand`);

View file

@ -16,7 +16,7 @@ export default {
.setDescription("Manage reputation.")
.addSubcommand(give.data),
async execute(interaction: CommandInteraction) {
const { options, guild, user, commandName } = interaction;
const { options } = interaction;
if (options?.getSubcommand() === "give") {
logger?.verbose(`Executing give subcommand`);

View file

@ -25,8 +25,7 @@ export default {
},
execute: async (interaction: CommandInteraction) => {
// Destructure member
const { memberPermissions, options, commandName, user, guild } =
interaction;
const { memberPermissions, options } = interaction;
// Check permission
if (!memberPermissions?.has(Permissions?.FLAGS?.MANAGE_GUILD)) {

View file

@ -46,7 +46,7 @@ export default {
},
execute: async (interaction: CommandInteraction) => {
// Destructure member
const { guild, user, options } = interaction;
const { guild, options } = interaction;
// Get options
const status = options?.getBoolean("status");

View file

@ -36,7 +36,7 @@ export default {
},
execute: async (interaction: CommandInteraction) => {
// Destructure member
const { options, guild, user } = interaction;
const { options, guild } = interaction;
// Get options
const status = options?.getBoolean("status");

View file

@ -33,7 +33,7 @@ export default {
},
execute: async (interaction: CommandInteraction) => {
// Destructure member
const { options, guild, user } = interaction;
const { options, guild } = interaction;
// Get options
const url = options?.getString("url");

View file

@ -19,7 +19,7 @@ export default {
.addSubcommandGroup(userGroup.data),
async execute(interaction: CommandInteraction) {
const { options, commandName, user, guild } = interaction;
const { options } = interaction;
if (options.getSubcommandGroup() === "guild") {
logger.verbose(`Executing guild subcommand`);

View file

@ -28,7 +28,7 @@ export default {
);
},
execute: async (interaction: CommandInteraction) => {
const { guild, user, options, commandName } = interaction;
const { options } = interaction;
if (options?.getSubcommand() === "appearance") {
logger?.verbose(`Executing appearance subcommand`);

View file

@ -20,7 +20,7 @@ export default {
.addSubcommand(pterodactyl.data)
.addSubcommandGroup(roles.data),
async execute(interaction: CommandInteraction) {
const { options, commandName, user, guild } = interaction;
const { options } = interaction;
if (options?.getSubcommand() === "pterodactyl") {
logger.verbose(`Executing pterodactyl subcommand`);

View file

@ -19,7 +19,7 @@ export default {
.addSubcommand(cancel.data);
},
execute: async (interaction: CommandInteraction) => {
const { options, commandName, guild, user } = interaction;
const { options } = interaction;
if (options?.getSubcommand() === "buy") {
logger.verbose(`Executing buy subcommand`);

View file

@ -20,7 +20,7 @@ export default {
.addSubcommand(about.data)
.addSubcommand(stats.data),
async execute(interaction: CommandInteraction) {
const { options, guild, user, commandName } = interaction;
const { options } = interaction;
if (options?.getSubcommand() === "lookup") {
logger.verbose(`Executing lookup subcommand`);