diff --git a/src/commands/profile/index.ts b/src/commands/profile/index.ts index 7dfe9f9..e2a617a 100644 --- a/src/commands/profile/index.ts +++ b/src/commands/profile/index.ts @@ -1,30 +1,30 @@ -// Dependencies -import { SlashCommandBuilder } from '@discordjs/builders'; -import { CommandInteraction } from 'discord.js'; - -// Modules -import view from './modules/view'; - -// Function -export default { - data: new SlashCommandBuilder() - .setName('profile') - .setDescription('Check a profile.') - .addSubcommand((subcommand) => - subcommand - .setName('view') - .setDescription('View a profile.') - .addUserOption((option) => - option - .setName('target') - .setDescription('The profile you wish to view') - ) - ), - async execute(interaction: CommandInteraction) { - // Module - View - if (interaction.options.getSubcommand() === 'view') { - // Execute Module - View - await view(interaction); - } - }, -}; +// Dependencies +import { SlashCommandBuilder } from "@discordjs/builders"; +import { CommandInteraction } from "discord.js"; + +// Modules +import view from "./modules/view"; + +// Function +export default { + data: new SlashCommandBuilder() + .setName("profile") + .setDescription("Check a profile.") + .addSubcommand((subcommand) => + subcommand + .setName("view") + .setDescription("View a profile.") + .addUserOption((option) => + option + .setName("target") + .setDescription("The profile you wish to view") + ) + ), + async execute(interaction: CommandInteraction) { + // Module - View + if (interaction.options.getSubcommand() === "view") { + // Execute Module - View + await view(interaction); + } + }, +}; diff --git a/src/commands/profile/modules/view.ts b/src/commands/profile/modules/view.ts index f4faa89..37cc0d5 100644 --- a/src/commands/profile/modules/view.ts +++ b/src/commands/profile/modules/view.ts @@ -1,14 +1,14 @@ -import i18next from 'i18next'; -import config from '../../../../config.json'; -import logger from '../../../handlers/logger'; -import users from '../../../helpers/database/models/userSchema'; -import { CommandInteraction } from 'discord.js'; +import i18next from "i18next"; +import config from "../../../../config.json"; +import logger from "../../../handlers/logger"; +import users from "../../../helpers/database/models/userSchema"; +import { CommandInteraction } from "discord.js"; export default async (interaction: CommandInteraction) => { // Destructure const { client, options, user, guild } = interaction; // Target information - const target = options?.getUser('target'); + const target = options?.getUser("target"); // Discord User Information const discordUser = await client.users.fetch( @@ -31,27 +31,27 @@ export default async (interaction: CommandInteraction) => { fields: [ { name: `:dollar: Credits`, - value: `${userObj.credits || 'Not found'}`, + value: `${userObj.credits || "Not found"}`, inline: true, }, { name: `:squeeze_bottle: Level`, - value: `${userObj.level || 'Not found'}`, + value: `${userObj.level || "Not found"}`, inline: true, }, { name: `:squeeze_bottle: Points`, - value: `${userObj.points || 'Not found'}`, + value: `${userObj.points || "Not found"}`, inline: true, }, { name: `:loudspeaker: Reputation`, - value: `${userObj.reputation || 'Not found'}`, + value: `${userObj.reputation || "Not found"}`, inline: true, }, { name: `:rainbow_flag: Language`, - value: `${userObj.language || 'Not found'}`, + value: `${userObj.language || "Not found"}`, inline: true, }, ], diff --git a/src/commands/reputation/index.ts b/src/commands/reputation/index.ts index 8ec7572..2766fc6 100644 --- a/src/commands/reputation/index.ts +++ b/src/commands/reputation/index.ts @@ -1,42 +1,42 @@ -// Dependencies -import { SlashCommandBuilder } from '@discordjs/builders'; -import { CommandInteraction } from 'discord.js'; - -// Modules -import give from './modules/give'; - -// Function -export default { - data: new SlashCommandBuilder() - .setName('reputation') - .setDescription('Give reputation.') - .addSubcommand((subcommand) => - subcommand - .setName('give') - .setDescription('Give reputation to a user') - .addUserOption((option) => - option - .setName('target') - .setDescription('The user you want to repute.') - .setRequired(true) - ) - .addStringOption((option) => - option - .setName('type') - .setDescription('What type of reputation you want to repute') - .setRequired(true) - .addChoice('Positive', 'positive') - .addChoice('Negative', 'negative') - ) - ), - async execute(interaction: CommandInteraction) { - // Destructure - const { options } = interaction; - - // Module - Give - if (options.getSubcommand() === 'give') { - // Execute Module - Give - await give(interaction); - } - }, -}; +// Dependencies +import { SlashCommandBuilder } from "@discordjs/builders"; +import { CommandInteraction } from "discord.js"; + +// Modules +import give from "./modules/give"; + +// Function +export default { + data: new SlashCommandBuilder() + .setName("reputation") + .setDescription("Give reputation.") + .addSubcommand((subcommand) => + subcommand + .setName("give") + .setDescription("Give reputation to a user") + .addUserOption((option) => + option + .setName("target") + .setDescription("The user you want to repute.") + .setRequired(true) + ) + .addStringOption((option) => + option + .setName("type") + .setDescription("What type of reputation you want to repute") + .setRequired(true) + .addChoice("Positive", "positive") + .addChoice("Negative", "negative") + ) + ), + async execute(interaction: CommandInteraction) { + // Destructure + const { options } = interaction; + + // Module - Give + if (options.getSubcommand() === "give") { + // Execute Module - Give + await give(interaction); + } + }, +}; diff --git a/src/commands/reputation/modules/give.ts b/src/commands/reputation/modules/give.ts index 501e79d..5919693 100644 --- a/src/commands/reputation/modules/give.ts +++ b/src/commands/reputation/modules/give.ts @@ -1,19 +1,19 @@ -import i18next from 'i18next'; -import { CommandInteraction } from 'discord.js'; -import config from '../../../../config.json'; -import logger from '../../../handlers/logger'; -import users from '../../../helpers/database/models/userSchema'; -import timeouts from '../../../helpers/database/models/timeoutSchema'; +import i18next from "i18next"; +import { CommandInteraction } from "discord.js"; +import config from "../../../../config.json"; +import logger from "../../../handlers/logger"; +import users from "../../../helpers/database/models/userSchema"; +import timeouts from "../../../helpers/database/models/timeoutSchema"; export default async (interaction: CommandInteraction) => { // Destructure const { options, user, guild } = interaction; // Target information - const target = options.getUser('target'); + const target = options.getUser("target"); // Type information - const type = options.getString('type'); + const type = options.getString("type"); // User information const userObj = await users.findOne({ @@ -34,8 +34,8 @@ export default async (interaction: CommandInteraction) => { if (target?.id === user?.id) { // Embed object const embed = { - title: ':loudspeaker: Reputation - Give', - description: 'You can not repute yourself.', + title: ":loudspeaker: Reputation - Give", + description: "You can not repute yourself.", timestamp: new Date(), color: config.colors.error as any, footer: { iconURL: config.footer.icon, text: config.footer.text }, @@ -46,12 +46,12 @@ export default async (interaction: CommandInteraction) => { } // If type is positive - if (type === 'positive') { + if (type === "positive") { userObj.reputation += 1; } // If type is negative - if (type === 'negative') { + if (type === "negative") { userObj.reputation -= 1; } @@ -59,7 +59,7 @@ export default async (interaction: CommandInteraction) => { await userObj.save().then(async () => { // Embed object const embed = { - title: ':loudspeaker: Reputation - Give', + title: ":loudspeaker: Reputation - Give", description: `You have given ${target} a ${type} reputation!`, timestamp: new Date(), color: config.colors.success as any, @@ -100,7 +100,7 @@ export default async (interaction: CommandInteraction) => { } else { // Create embed object const embed = { - title: ':loudspeaker: Reputation - Give', + title: ":loudspeaker: Reputation - Give", description: `You have given reputation within the last ${ config.reputation.timeout / 1000 } seconds, you can not repute now!`, diff --git a/src/helpers/index.ts b/src/helpers/index.ts index 977d742..d9a9544 100644 --- a/src/helpers/index.ts +++ b/src/helpers/index.ts @@ -1,6 +1,6 @@ -import database from './database'; -import deployCommands from './deployCommands'; -import dbGuildFix from './dbGuildFix'; -import dbMemberFix from './dbMemberFix'; +import database from "./database"; +import deployCommands from "./deployCommands"; +import dbGuildFix from "./dbGuildFix"; +import dbMemberFix from "./dbMemberFix"; export default { database, deployCommands, dbGuildFix, dbMemberFix }; diff --git a/src/index.ts b/src/index.ts index 1461f84..86afd4e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,13 +1,13 @@ // Dependencies -import { Client, Intents } from 'discord.js'; // discord.js +import { Client, Intents } from "discord.js"; // discord.js -import database from './helpers/database'; -import events from './handlers/events'; -import commands from './handlers/commands'; -import locale from './handlers/locale'; -import schedules from './handlers/schedules'; +import database from "./helpers/database"; +import events from "./handlers/events"; +import commands from "./handlers/commands"; +import locale from "./handlers/locale"; +import schedules from "./handlers/schedules"; -import config from '../config.json'; // config.json +import config from "../config.json"; // config.json (async () => { // Initialize discord.js client