🩹 code smells
This commit is contained in:
parent
e1caeffa75
commit
92989c14cb
17 changed files with 16 additions and 19 deletions
|
@ -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";
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -32,7 +32,7 @@ export default {
|
|||
);
|
||||
},
|
||||
execute: async (interaction: CommandInteraction) => {
|
||||
const { options, guild, user } = interaction;
|
||||
const { options, guild } = interaction;
|
||||
|
||||
const discordChannel = options?.getChannel("channel");
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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`);
|
||||
|
|
|
@ -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`);
|
||||
|
|
Loading…
Add table
Reference in a new issue