diff --git a/src/commands/anime.ts b/src/commands/anime.ts index 65cf14a..07578d1 100644 --- a/src/commands/anime.ts +++ b/src/commands/anime.ts @@ -2,7 +2,7 @@ import { SlashCommandBuilder } from "discord.js" import { ICommand } from "interfaces" import { devMessage, embedColor } from "config/options" import { anilist } from "anilist" -import { capitalizeFirstLetter } from "utils/functions/funcs" +import { capitalizeFirstLetter, removeIndents } from "utils/functions/funcs" export = { name: "anime", @@ -66,7 +66,7 @@ export = { embeds: [{ title: romaji + " | " + english, url: anime.siteUrl || "", - description: ` + description: removeIndents(` **Description:** ${animeDescription} **Genres:** ${anime.genres.join(", ")} @@ -76,7 +76,7 @@ export = { **Season:** ${animeSeason} **Start Date:** ${animeStartDate} **End Date:** ${animeEndDate} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: anime.coverImage?.medium || "" diff --git a/src/commands/ban.ts b/src/commands/ban.ts index b9633f3..d5a08da 100644 --- a/src/commands/ban.ts +++ b/src/commands/ban.ts @@ -3,6 +3,7 @@ import { admin, helper } from "config/roles" import { embedColor, devMessage } from "config/options" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "ban", @@ -101,12 +102,12 @@ export = { icon_url: mod.user.avatarURL() || undefined }, title: "Member Banned", - description: ` + description: removeIndents(` **User:** ${userMention(member.user.id)} **Mod:** ${userMention(mod.user.id)} **Reason:** ${reason} **Messages Deleted:** ${messageDeletionDays} days - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: mod.user.avatarURL() || "" diff --git a/src/commands/botinfo.ts b/src/commands/botinfo.ts index 70f6db3..115bebe 100644 --- a/src/commands/botinfo.ts +++ b/src/commands/botinfo.ts @@ -3,12 +3,13 @@ import { ICommand } from "interfaces" import { embedColor, devMessage } from "config/options" import os from "os" import { execSync } from "child_process" +import { removeIndents } from "utils/functions/funcs" const { dependencies, devDependencies } = require("../../package.json") export = { name: "botinfo", description: "Get information about the bot", - dev: true, + dev: false, public: true, data: new SlashCommandBuilder() @@ -42,7 +43,7 @@ export = { await interaction.reply({ embeds: [{ title: "Bot Info", - description: ` + description: removeIndents(` __**Bot**__ > **Name**: \`${client.user!.username}\` > **ID**: \`${client.user!.id}\` @@ -63,7 +64,7 @@ export = { > **Channels:** \`${client.channels.cache.size}\` > **Users:** \`${client.users.cache.size}\` > **Roles:** \`${client.guilds.cache.reduce((a, b) => a + b.roles.cache.size, 0)}\` - `.replace(/\n */g, "\n"), + `), thumbnail: { url: client.user!.avatarURL() || "", }, diff --git a/src/commands/clear.ts b/src/commands/clear.ts index c9bb463..e154433 100644 --- a/src/commands/clear.ts +++ b/src/commands/clear.ts @@ -2,6 +2,7 @@ import { SlashCommandBuilder, PermissionFlagsBits, TextChannel, channelMention, import { embedColor } from "config/options" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "clear", @@ -52,11 +53,11 @@ export = { icon_url: interaction.user.avatarURL() || undefined }, title: "Messages Cleared", - description: ` + description: removeIndents(` **Channel:** ${channelMention(channel.id)} **Amount:** \`${messages.size}\` messages **Mod:** ${userMention(interaction.user.id)} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: interaction.user.avatarURL() || "" diff --git a/src/commands/forceunverify.ts b/src/commands/forceunverify.ts index 9acff58..f601086 100644 --- a/src/commands/forceunverify.ts +++ b/src/commands/forceunverify.ts @@ -5,6 +5,7 @@ import { ICommand } from "interfaces" import roleManage from "utils/functions/rolesmanage" import logToChannel from "utils/functions/logtochannel" import { getIGN } from "utils/Hypixel" +import { removeIndents } from "utils/functions/funcs" export = { name: "forceunverify", @@ -56,12 +57,12 @@ export = { name: mod.username, icon_url: mod.avatarURL() || undefined }, - description: ` + description: removeIndents(` **User:** ${userMention(member.user.id)} **Mod:** ${userMention(mod.id)} **IGN:** \`${ign}\` **UUID:** \`${uuid}\` - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: mod.avatarURL() || "" diff --git a/src/commands/forceupdate.ts b/src/commands/forceupdate.ts index e51e636..8efea7e 100644 --- a/src/commands/forceupdate.ts +++ b/src/commands/forceupdate.ts @@ -5,6 +5,7 @@ import verify from "schemas/verifySchema" import { ICommand } from "interfaces" import roleManage from "utils/functions/rolesmanage" import { waitingListRole } from "config/roles" +import { removeIndents } from "utils/functions/funcs" export = { name: "forceupdate", @@ -84,11 +85,11 @@ export = { await interaction.editReply({ embeds: [{ - description: ` + description: removeIndents(` ${usermentioned} was given the \`Default Member\` role. IGN: \`${ign}\` - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: head! @@ -158,11 +159,11 @@ export = { await interaction.editReply({ embeds: [{ - description: ` + description: removeIndents(` ${usermentioned} was given the \`${replyRank}\` role. IGN: \`${ign}\` - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: head! diff --git a/src/commands/forceverify.ts b/src/commands/forceverify.ts index 52a5da8..686e631 100644 --- a/src/commands/forceverify.ts +++ b/src/commands/forceverify.ts @@ -6,6 +6,7 @@ import mongoose from "mongoose" import roleManage from "utils/functions/rolesmanage" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "forceverify", @@ -174,12 +175,12 @@ export = { icon_url: mod.avatarURL() || undefined }, title: "Force Verified", - description: ` + description: removeIndents(` **User:** ${userMention(user.id)} **Mod:** ${userMention(mod.id)} **IGN:** \`${player.displayname}\` **UUID:** \`${uuid}\` - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: mod.avatarURL() || "" diff --git a/src/commands/kick.ts b/src/commands/kick.ts index 845d6ce..7453389 100644 --- a/src/commands/kick.ts +++ b/src/commands/kick.ts @@ -3,6 +3,7 @@ import { admin, helper } from "config/roles" import { embedColor, devMessage } from "config/options" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "kick", @@ -75,11 +76,11 @@ export = { icon_url: mod.user.avatarURL() || undefined }, title: "Member Kicked", - description: ` + description: removeIndents(` **User:** ${userMention(member.user.id)} **Mod:** ${userMention(mod.user.id)} **Reason:** ${reason} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: mod.user.avatarURL() || "" diff --git a/src/commands/music/nowplaying.ts b/src/commands/music/nowplaying.ts index fc892c3..e0fe8d4 100644 --- a/src/commands/music/nowplaying.ts +++ b/src/commands/music/nowplaying.ts @@ -1,6 +1,7 @@ import { embedColor } from "config/options" import { useMainPlayer } from "discord-player" import { ChatInputCommandInteraction } from "discord.js" +import { removeIndents } from "utils/functions/funcs" export default async function nowplaying(interaction: ChatInputCommandInteraction) { await interaction.deferReply() @@ -41,11 +42,11 @@ export default async function nowplaying(interaction: ChatInputCommandInteractio await interaction.editReply({ embeds: [{ title: "Now Playing", - description: ` + description: removeIndents(` [${current.title}](${current.url}) ${progressBar} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: current.thumbnail diff --git a/src/commands/remove.ts b/src/commands/remove.ts index 7b74b50..65f010b 100644 --- a/src/commands/remove.ts +++ b/src/commands/remove.ts @@ -4,6 +4,7 @@ import waitinglistSchema from "schemas/waitinglistSchema" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" import { waitingListRole } from "config/roles" +import { removeIndents } from "utils/functions/funcs" export = { name: "remove", @@ -57,11 +58,11 @@ export = { icon_url: mod.avatarURL() || undefined }, title: "Waiting List - Remove User", - description: ` + description: removeIndents(` **User:** ${userMention(member.user.id)} **Reason:** ${reason} **Mod:** ${userMention(mod.id)} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: mod.avatarURL() || "" diff --git a/src/commands/setnick.ts b/src/commands/setnick.ts index 614302e..3adf248 100644 --- a/src/commands/setnick.ts +++ b/src/commands/setnick.ts @@ -2,6 +2,7 @@ import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } fr import { embedColor, devMessage } from "config/options" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "setnick", @@ -48,11 +49,11 @@ export = { icon_url: interaction.user.avatarURL() || undefined }, title: "Nickname", - description: ` + description: removeIndents(` **User:** ${userMention(member.id)} **Nickname:** ${nickname} **Moderator:** ${userMention(interaction.user.id)} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: interaction.user.avatarURL() || "" diff --git a/src/commands/slowmode.ts b/src/commands/slowmode.ts index 5748e1b..ac1b053 100644 --- a/src/commands/slowmode.ts +++ b/src/commands/slowmode.ts @@ -2,6 +2,7 @@ import { SlashCommandBuilder, PermissionFlagsBits, ChannelType, TextChannel, cha import { embedColor, devMessage } from "config/options" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "slowmode", @@ -54,11 +55,11 @@ export = { icon_url: interaction.user.avatarURL() || undefined }, title: "Slowmode Update", - description: ` + description: removeIndents(` **Channel:** ${channelMention(channel.id)} **Slowmode:** ${seconds} seconds **Mod:** ${userMention(interaction.user.id)} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: interaction.user.avatarURL() || "" diff --git a/src/commands/timeout.ts b/src/commands/timeout.ts index dff6de9..8a644af 100644 --- a/src/commands/timeout.ts +++ b/src/commands/timeout.ts @@ -3,6 +3,7 @@ import { embedColor, devMessage } from "config/options" import { ICommand } from "interfaces" import ms from "ms" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "timeout", @@ -132,12 +133,12 @@ export = { icon_url: mod.user.avatarURL() || undefined }, title: title, - description: ` + description: removeIndents(` **User:** ${userMention(target.id)} ${timeouttime === null ? "**Time:** `None`" : "**Time:** `" + prettyTime + "`"} **Reason:** \`${reason}\` **Mod:** ${userMention(mod.id)} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: mod.user.avatarURL() || "" diff --git a/src/commands/unban.ts b/src/commands/unban.ts index 1de44c0..2dfcd3a 100644 --- a/src/commands/unban.ts +++ b/src/commands/unban.ts @@ -2,6 +2,7 @@ import { SlashCommandBuilder, PermissionFlagsBits, userMention, User } from "dis import { embedColor, devMessage } from "config/options" import { ICommand } from "interfaces" import logToChannel from "utils/functions/logtochannel" +import { removeIndents } from "utils/functions/funcs" export = { name: "unban", @@ -67,11 +68,11 @@ export = { icon_url: mod.avatarURL() || undefined }, title: "Member Unbanned", - description: ` + description: removeIndents(` **User:** ${userMention(user!.id)} **Mod:** ${userMention(mod.id)} **Reason:** ${reason} - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: mod.avatarURL() || "" diff --git a/src/commands/update.ts b/src/commands/update.ts index e1ab8ae..fbc2a44 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -5,6 +5,7 @@ import { embedColor, hypixelGuildID, devMessage } from "config/options" import roleManage from "utils/functions/rolesmanage" import { ICommand } from "interfaces" import { waitingListRole } from "config/roles" +import { removeIndents } from "utils/functions/funcs" export = { name: "update", @@ -67,11 +68,11 @@ export = { await interaction.editReply({ embeds: [{ - description: ` + description: removeIndents(` Updated your roles to \`Default Member\` IGN: \`${ign}\` - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: head! @@ -142,11 +143,11 @@ export = { await interaction.editReply({ embeds: [{ - description: ` + description: removeIndents(` Updated your roles to \`${replyRank}\` IGN: \`${ign}\` - `.replace(/\n */g, "\n"), + `), color: embedColor, thumbnail: { url: head! diff --git a/src/utils/functions/funcs.ts b/src/utils/functions/funcs.ts index 6ee9938..6e34fc1 100644 --- a/src/utils/functions/funcs.ts +++ b/src/utils/functions/funcs.ts @@ -1,3 +1,7 @@ export function capitalizeFirstLetter(str: string): string { return str[0].toUpperCase() + str.slice(1).toLowerCase() +} + +export function removeIndents(str: string): string { + return str.replace(/^ */gm, "") } \ No newline at end of file