Changed small functions to methods
Added custom color function
This commit is contained in:
@@ -2,7 +2,7 @@ import { REST, RESTPutAPIApplicationCommandsJSONBody, Routes } from "discord.js"
|
|||||||
import fs from "node:fs"
|
import fs from "node:fs"
|
||||||
import { ICommand } from "../src/interfaces"
|
import { ICommand } from "../src/interfaces"
|
||||||
import env from "../src/utils/Env"
|
import env from "../src/utils/Env"
|
||||||
import color from "../src/utils/functions/colors"
|
import { color } from "../src/utils/functions/colors"
|
||||||
const rest = new REST({ version: "10" }).setToken(env.prod.token)
|
const rest = new REST({ version: "10" }).setToken(env.prod.token)
|
||||||
|
|
||||||
const commands: RESTPutAPIApplicationCommandsJSONBody = []
|
const commands: RESTPutAPIApplicationCommandsJSONBody = []
|
||||||
|
|||||||
@@ -2,14 +2,12 @@ import { anilist } from "anilist"
|
|||||||
import { devMessage, embedColor } from "config/options.js"
|
import { devMessage, embedColor } from "config/options.js"
|
||||||
import { SlashCommandBuilder } from "discord.js"
|
import { SlashCommandBuilder } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { capitalizeFirstLetter, removeIndents } from "utils/functions/funcs.js"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "anime",
|
name: "anime",
|
||||||
description: "Anime subcommands",
|
description: "Anime subcommands",
|
||||||
public: true,
|
public: true,
|
||||||
dev: false,
|
dev: false,
|
||||||
subcommands: true,
|
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("anime")
|
.setName("anime")
|
||||||
@@ -59,14 +57,14 @@ export default {
|
|||||||
const animeEpisodes = anime.episodes ? animeEpisodesRaw : "No episodes available"
|
const animeEpisodes = anime.episodes ? animeEpisodesRaw : "No episodes available"
|
||||||
const animeStartDate = [anime.startDate?.day || "??", anime.startDate?.month || "??", anime.startDate?.year || "????"].join(".")
|
const animeStartDate = [anime.startDate?.day || "??", anime.startDate?.month || "??", anime.startDate?.year || "????"].join(".")
|
||||||
const animeEndDate = [anime.endDate?.day || "??", anime.endDate?.month || "??", anime.endDate?.year || "????"].join(".")
|
const animeEndDate = [anime.endDate?.day || "??", anime.endDate?.month || "??", anime.endDate?.year || "????"].join(".")
|
||||||
const animeSeasonRaw = capitalizeFirstLetter(anime.season ?? "null") + " " + anime.startDate?.year
|
const animeSeasonRaw = anime.season?.capitalizeFirstLetter() + " " + anime.startDate?.year
|
||||||
const animeSeason = anime.season ? animeSeasonRaw : "No season available"
|
const animeSeason = anime.season ? animeSeasonRaw : "No season available"
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: romaji + " | " + english,
|
title: romaji + " | " + english,
|
||||||
url: anime.siteUrl || "",
|
url: anime.siteUrl || "",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**Description:** ${animeDescription}
|
**Description:** ${animeDescription}
|
||||||
|
|
||||||
**Genres:** ${anime.genres.join(", ")}
|
**Genres:** ${anime.genres.join(", ")}
|
||||||
@@ -76,7 +74,7 @@ export default {
|
|||||||
**Season:** ${animeSeason}
|
**Season:** ${animeSeason}
|
||||||
**Start Date:** ${animeStartDate}
|
**Start Date:** ${animeStartDate}
|
||||||
**End Date:** ${animeEndDate}
|
**End Date:** ${animeEndDate}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: anime.coverImage?.medium || ""
|
url: anime.coverImage?.medium || ""
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { devMessage, embedColor } from "config/options.js"
|
|||||||
import { admin, helper } from "config/roles.js"
|
import { admin, helper } from "config/roles.js"
|
||||||
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -102,12 +101,12 @@ export default {
|
|||||||
icon_url: mod.user.avatarURL() || undefined
|
icon_url: mod.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Member Banned",
|
title: "Member Banned",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(member.user.id)}
|
**User:** ${userMention(member.user.id)}
|
||||||
**Mod:** ${userMention(mod.user.id)}
|
**Mod:** ${userMention(mod.user.id)}
|
||||||
**Reason:** ${reason}
|
**Reason:** ${reason}
|
||||||
**Messages Deleted:** ${messageDeletionDays} days
|
**Messages Deleted:** ${messageDeletionDays} days
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.user.avatarURL() || ""
|
url: mod.user.avatarURL() || ""
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import { ICommand } from "interfaces"
|
|||||||
import { createRequire } from "node:module"
|
import { createRequire } from "node:module"
|
||||||
import os from "os"
|
import os from "os"
|
||||||
import prettyMs from "pretty-ms"
|
import prettyMs from "pretty-ms"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
|
|
||||||
const require = createRequire(import.meta.url)
|
const require = createRequire(import.meta.url)
|
||||||
const { dependencies, devDependencies } = require("../../package.json")
|
const { dependencies, devDependencies } = require("../../package.json")
|
||||||
@@ -46,7 +45,7 @@ export default {
|
|||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Bot Info",
|
title: "Bot Info",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
__**Bot**__
|
__**Bot**__
|
||||||
> **Name**: \`${client.user!.username}\`
|
> **Name**: \`${client.user!.username}\`
|
||||||
> **ID**: \`${client.user!.id}\`
|
> **ID**: \`${client.user!.id}\`
|
||||||
@@ -67,7 +66,7 @@ export default {
|
|||||||
> **Channels:** \`${client.channels.cache.size}\`
|
> **Channels:** \`${client.channels.cache.size}\`
|
||||||
> **Users:** \`${client.users.cache.size}\`
|
> **Users:** \`${client.users.cache.size}\`
|
||||||
> **Roles:** \`${client.guilds.cache.reduce((a, b) => a + b.roles.cache.size, 0)}\`
|
> **Roles:** \`${client.guilds.cache.reduce((a, b) => a + b.roles.cache.size, 0)}\`
|
||||||
`),
|
`.removeIndents(),
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: client.user!.avatarURL() || ""
|
url: client.user!.avatarURL() || ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { embedColor } from "config/options.js"
|
import { embedColor } from "config/options.js"
|
||||||
import { channelMention, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
|
import { channelMention, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -53,11 +52,11 @@ export default {
|
|||||||
icon_url: interaction.user.avatarURL() || undefined
|
icon_url: interaction.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Messages Cleared",
|
title: "Messages Cleared",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**Channel:** ${channelMention(channel.id)}
|
**Channel:** ${channelMention(channel.id)}
|
||||||
**Amount:** \`${messages.size}\` messages
|
**Amount:** \`${messages.size}\` messages
|
||||||
**Mod:** ${userMention(interaction.user.id)}
|
**Mod:** ${userMention(interaction.user.id)}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: interaction.user.avatarURL() || ""
|
url: interaction.user.avatarURL() || ""
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { devMessage, embedColor } from "config/options.js"
|
|||||||
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import verify from "schemas/verifyTag.js"
|
import verify from "schemas/verifyTag.js"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
import roleManage from "utils/functions/rolesmanage.js"
|
import roleManage from "utils/functions/rolesmanage.js"
|
||||||
import { getIGN } from "utils/Hypixel.js"
|
import { getIGN } from "utils/Hypixel.js"
|
||||||
@@ -58,12 +57,12 @@ export default {
|
|||||||
name: mod.username,
|
name: mod.username,
|
||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(member.user.id)}
|
**User:** ${userMention(member.user.id)}
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
**IGN:** \`${ign}\`
|
**IGN:** \`${ign}\`
|
||||||
**UUID:** \`${uuid}\`
|
**UUID:** \`${uuid}\`
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.avatarURL() || ""
|
url: mod.avatarURL() || ""
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { waitingListRole } from "config/roles.js"
|
|||||||
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import verify from "schemas/verifyTag.js"
|
import verify from "schemas/verifyTag.js"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import roleManage from "utils/functions/rolesmanage.js"
|
import roleManage from "utils/functions/rolesmanage.js"
|
||||||
import { getGuild, getHeadURL, getIGN } from "utils/Hypixel.js"
|
import { getGuild, getHeadURL, getIGN } from "utils/Hypixel.js"
|
||||||
|
|
||||||
@@ -85,11 +84,11 @@ export default {
|
|||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: `
|
||||||
${usermentioned} was given the \`Default Member\` role.
|
${usermentioned} was given the \`Default Member\` role.
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
@@ -159,11 +158,11 @@ export default {
|
|||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: `
|
||||||
${usermentioned} was given the \`${replyRank}\` role.
|
${usermentioned} was given the \`${replyRank}\` role.
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { devMessage, embedColor, hypixelGuildID } from "config/options.js"
|
|||||||
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import verify from "schemas/verifyTag.js"
|
import verify from "schemas/verifyTag.js"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
import roleManage from "utils/functions/rolesmanage.js"
|
import roleManage from "utils/functions/rolesmanage.js"
|
||||||
import { getGuild, getHeadURL, getPlayer, getUUID } from "utils/Hypixel.js"
|
import { getGuild, getHeadURL, getPlayer, getUUID } from "utils/Hypixel.js"
|
||||||
@@ -173,12 +172,12 @@ export default {
|
|||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Force Verified",
|
title: "Force Verified",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(user.id)}
|
**User:** ${userMention(user.id)}
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
**IGN:** \`${player.displayname}\`
|
**IGN:** \`${player.displayname}\`
|
||||||
**UUID:** \`${uuid}\`
|
**UUID:** \`${uuid}\`
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.avatarURL() || ""
|
url: mod.avatarURL() || ""
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { devMessage, embedColor, instructionsgif } from "config/options.js"
|
import { devMessage, embedColor, instructionsgif } from "config/options.js"
|
||||||
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
import { PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "instructions",
|
name: "instructions",
|
||||||
@@ -19,14 +18,14 @@ export default {
|
|||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Verification",
|
title: "Verification",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
- Log onto hypixel.
|
- Log onto hypixel.
|
||||||
- Right click with the head in your hotbar.
|
- Right click with the head in your hotbar.
|
||||||
- Click on the social media icon.
|
- Click on the social media icon.
|
||||||
- Click on the discord icon.
|
- Click on the discord icon.
|
||||||
- Type your username in the chat and press enter.
|
- Type your username in the chat and press enter.
|
||||||
- Run the \`/verify\` command in this channel.
|
- Run the \`/verify\` command in this channel.
|
||||||
`),
|
`.removeIndents(),
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: interaction.guild?.iconURL() || ""
|
url: interaction.guild?.iconURL() || ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { devMessage, embedColor } from "config/options.js"
|
|||||||
import { admin, helper } from "config/roles.js"
|
import { admin, helper } from "config/roles.js"
|
||||||
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -76,11 +75,11 @@ export default {
|
|||||||
icon_url: mod.user.avatarURL() || undefined
|
icon_url: mod.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Member Kicked",
|
title: "Member Kicked",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(member.user.id)}
|
**User:** ${userMention(member.user.id)}
|
||||||
**Mod:** ${userMention(mod.user.id)}
|
**Mod:** ${userMention(mod.user.id)}
|
||||||
**Reason:** ${reason}
|
**Reason:** ${reason}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.user.avatarURL() || ""
|
url: mod.user.avatarURL() || ""
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { embedColor } from "config/options.js"
|
import { embedColor } from "config/options.js"
|
||||||
import { useMainPlayer } from "discord-player"
|
import { useMainPlayer } from "discord-player"
|
||||||
import { ChatInputCommandInteraction } from "discord.js"
|
import { ChatInputCommandInteraction } from "discord.js"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
|
|
||||||
export default async function nowplaying(interaction: ChatInputCommandInteraction) {
|
export default async function nowplaying(interaction: ChatInputCommandInteraction) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
@@ -42,11 +41,11 @@ export default async function nowplaying(interaction: ChatInputCommandInteractio
|
|||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Now Playing",
|
title: "Now Playing",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
[${current.title}](${current.url})
|
[${current.title}](${current.url})
|
||||||
|
|
||||||
${progressBar}
|
${progressBar}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: current.thumbnail
|
url: current.thumbnail
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { waitingListRole } from "config/roles.js"
|
|||||||
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import waitinglist from "schemas/waitinglistTag.js"
|
import waitinglist from "schemas/waitinglistTag.js"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -58,11 +57,11 @@ export default {
|
|||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Waiting List - Remove User",
|
title: "Waiting List - Remove User",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(member.user.id)}
|
**User:** ${userMention(member.user.id)}
|
||||||
**Reason:** ${reason}
|
**Reason:** ${reason}
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.avatarURL() || ""
|
url: mod.avatarURL() || ""
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { devMessage, embedColor } from "config/options.js"
|
import { devMessage, embedColor } from "config/options.js"
|
||||||
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -49,11 +48,11 @@ export default {
|
|||||||
icon_url: interaction.user.avatarURL() || undefined
|
icon_url: interaction.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Nickname",
|
title: "Nickname",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(member.id)}
|
**User:** ${userMention(member.id)}
|
||||||
**Nickname:** ${nickname}
|
**Nickname:** ${nickname}
|
||||||
**Moderator:** ${userMention(interaction.user.id)}
|
**Moderator:** ${userMention(interaction.user.id)}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: interaction.user.avatarURL() || ""
|
url: interaction.user.avatarURL() || ""
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { devMessage, embedColor } from "config/options.js"
|
import { devMessage, embedColor } from "config/options.js"
|
||||||
import { channelMention, ChannelType, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
|
import { channelMention, ChannelType, PermissionFlagsBits, SlashCommandBuilder, TextChannel, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -55,11 +54,11 @@ export default {
|
|||||||
icon_url: interaction.user.avatarURL() || undefined
|
icon_url: interaction.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Slowmode Update",
|
title: "Slowmode Update",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**Channel:** ${channelMention(channel.id)}
|
**Channel:** ${channelMention(channel.id)}
|
||||||
**Slowmode:** ${seconds} seconds
|
**Slowmode:** ${seconds} seconds
|
||||||
**Mod:** ${userMention(interaction.user.id)}
|
**Mod:** ${userMention(interaction.user.id)}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: interaction.user.avatarURL() || ""
|
url: interaction.user.avatarURL() || ""
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ChatInputCommandInteraction, GuildMember } from "discord.js"
|
|||||||
import { IGuildData } from "interfaces"
|
import { IGuildData } from "interfaces"
|
||||||
import verify from "schemas/verifyTag.js"
|
import verify from "schemas/verifyTag.js"
|
||||||
import env from "utils/Env.js"
|
import env from "utils/Env.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import roleManage from "utils/functions/rolesmanage.js"
|
import roleManage from "utils/functions/rolesmanage.js"
|
||||||
import { getGuild, getIGN } from "utils/Hypixel.js"
|
import { getGuild, getIGN } from "utils/Hypixel.js"
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { GuildMember, PermissionFlagsBits, SlashCommandBuilder, userMention } fr
|
|||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import ms from "ms"
|
import ms from "ms"
|
||||||
import prettyMs from "pretty-ms"
|
import prettyMs from "pretty-ms"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -144,12 +143,12 @@ export default {
|
|||||||
icon_url: mod.user.avatarURL() || undefined
|
icon_url: mod.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: title,
|
title: title,
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(target.id)}
|
**User:** ${userMention(target.id)}
|
||||||
${timeouttime === null ? "**Time:** `None`" : "**Time:** `" + prettyTime + "`"}
|
${timeouttime === null ? "**Time:** `None`" : "**Time:** `" + prettyTime + "`"}
|
||||||
**Reason:** \`${reason}\`
|
**Reason:** \`${reason}\`
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.user.avatarURL() || ""
|
url: mod.user.avatarURL() || ""
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { devMessage, embedColor } from "config/options.js"
|
import { devMessage, embedColor } from "config/options.js"
|
||||||
import { PermissionFlagsBits, SlashCommandBuilder, User, userMention } from "discord.js"
|
import { PermissionFlagsBits, SlashCommandBuilder, User, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -69,11 +68,11 @@ export default {
|
|||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Member Unbanned",
|
title: "Member Unbanned",
|
||||||
description: removeIndents(`
|
description: `
|
||||||
**User:** ${userMention(user!.id)}
|
**User:** ${userMention(user!.id)}
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
**Reason:** ${reason}
|
**Reason:** ${reason}
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.avatarURL() || ""
|
url: mod.avatarURL() || ""
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import { waitingListRole } from "config/roles.js"
|
|||||||
import { GuildMember, SlashCommandBuilder } from "discord.js"
|
import { GuildMember, SlashCommandBuilder } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import verify from "schemas/verifyTag.js"
|
import verify from "schemas/verifyTag.js"
|
||||||
import { removeIndents } from "utils/functions/funcs.js"
|
|
||||||
import roleManage from "utils/functions/rolesmanage.js"
|
import roleManage from "utils/functions/rolesmanage.js"
|
||||||
import { getGuild, getHeadURL, getIGN } from "utils/Hypixel.js"
|
import { getGuild, getHeadURL, getIGN } from "utils/Hypixel.js"
|
||||||
|
|
||||||
@@ -68,11 +67,11 @@ export default {
|
|||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: `
|
||||||
Updated your roles to \`Default Member\`
|
Updated your roles to \`Default Member\`
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
@@ -143,11 +142,11 @@ export default {
|
|||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: `
|
||||||
Updated your roles to \`${replyRank}\`
|
Updated your roles to \`${replyRank}\`
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`.removeIndents(),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { ActionRowBuilder, ButtonBuilder, ButtonStyle, TextChannel } from "disco
|
|||||||
import { IButton } from "interfaces"
|
import { IButton } from "interfaces"
|
||||||
import guildapp from "schemas/guildAppTag.js"
|
import guildapp from "schemas/guildAppTag.js"
|
||||||
import waitingList from "schemas/waitinglistTag.js"
|
import waitingList from "schemas/waitinglistTag.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import { getGuild, getIGN } from "utils/Hypixel.js"
|
import { getGuild, getIGN } from "utils/Hypixel.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
7
src/enviroment.d.ts
vendored
7
src/enviroment.d.ts
vendored
@@ -7,4 +7,11 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface String {
|
||||||
|
removeIndents(): string
|
||||||
|
capitalizeFirstLetter(): string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export {}
|
export {}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { devMessage, embedColor, guildLogChannel, hypixelGuildID } from "config/options.js"
|
import { devMessage, embedColor, guildLogChannel, hypixelGuildID } from "config/options.js"
|
||||||
import { TextChannel } from "discord.js"
|
import { TextChannel } from "discord.js"
|
||||||
import { ICron, IGuildData } from "interfaces"
|
import { ICron, IGuildData } from "interfaces"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import { getGuild, getIGN } from "utils/Hypixel.js"
|
import { getGuild, getIGN } from "utils/Hypixel.js"
|
||||||
import { client } from "utils/Illegitimate.js"
|
import { client } from "utils/Illegitimate.js"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ButtonInteraction, ChatInputCommandInteraction } from "discord.js"
|
import { ButtonInteraction, ChatInputCommandInteraction } from "discord.js"
|
||||||
import { IEvent } from "interfaces"
|
import { IEvent } from "interfaces"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "logBtnsCmds",
|
name: "logBtnsCmds",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { IEvent } from "interfaces"
|
import { IEvent } from "interfaces"
|
||||||
import { ExtendedClient as Client } from "utils/Client.js"
|
import { ExtendedClient as Client } from "utils/Client.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "conolelog",
|
name: "conolelog",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import fs from "fs"
|
|||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { ExtendedClient } from "./Client.js"
|
import { ExtendedClient } from "./Client.js"
|
||||||
import env from "./Env.js"
|
import env from "./Env.js"
|
||||||
import color from "./functions/colors.js"
|
import { color } from "./functions/colors.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
|
|
||||||
export default async function autoDeployCommands(fileType: FileType, client: ExtendedClient) {
|
export default async function autoDeployCommands(fileType: FileType, client: ExtendedClient) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Client, Collection, GatewayIntentBits, Partials } from "discord.js"
|
|||||||
import { IAutocomplete, IButton, ICommand, IContextMenu, IModal } from "interfaces"
|
import { IAutocomplete, IButton, ICommand, IContextMenu, IModal } from "interfaces"
|
||||||
import autoDeployCommands from "./Autodeploy.js"
|
import autoDeployCommands from "./Autodeploy.js"
|
||||||
import env from "./Env.js"
|
import env from "./Env.js"
|
||||||
import color from "./functions/colors.js"
|
import { color } from "./functions/colors.js"
|
||||||
|
|
||||||
export class ExtendedClient extends Client {
|
export class ExtendedClient extends Client {
|
||||||
commands: Collection<string, ICommand> = new Collection()
|
commands: Collection<string, ICommand> = new Collection()
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import fs from "fs"
|
|||||||
import { IAutocomplete } from "interfaces"
|
import { IAutocomplete } from "interfaces"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { ExtendedClient as Client } from "utils/Client.js"
|
import { ExtendedClient as Client } from "utils/Client.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
const __dirname = import.meta.dirname
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import fs from "fs"
|
|||||||
import { IButton } from "interfaces"
|
import { IButton } from "interfaces"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { ExtendedClient as Client } from "utils/Client.js"
|
import { ExtendedClient as Client } from "utils/Client.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
const __dirname = import.meta.dirname
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import fs from "fs"
|
|||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { ExtendedClient as Client } from "utils/Client.js"
|
import { ExtendedClient as Client } from "utils/Client.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
const __dirname = import.meta.dirname
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import fs from "fs"
|
|||||||
import { IContextMenu } from "interfaces"
|
import { IContextMenu } from "interfaces"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { ExtendedClient as Client } from "utils/Client.js"
|
import { ExtendedClient as Client } from "utils/Client.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
const __dirname = import.meta.dirname
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import fs from "fs"
|
|||||||
import { IModal } from "interfaces"
|
import { IModal } from "interfaces"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { ExtendedClient as Client } from "utils/Client.js"
|
import { ExtendedClient as Client } from "utils/Client.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
import logToChannel from "utils/functions/logtochannel.js"
|
import logToChannel from "utils/functions/logtochannel.js"
|
||||||
type FileType = "js" | "ts"
|
type FileType = "js" | "ts"
|
||||||
const __dirname = import.meta.dirname
|
const __dirname = import.meta.dirname
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Redis } from "ioredis"
|
import { Redis } from "ioredis"
|
||||||
import { ExtendedClient as Client } from "utils/Client.js"
|
import { ExtendedClient as Client } from "utils/Client.js"
|
||||||
import env from "utils/Env.js"
|
import env from "utils/Env.js"
|
||||||
import color from "utils/functions/colors.js"
|
import { color } from "utils/functions/colors.js"
|
||||||
// import { connect } from "mongoose"
|
// import { connect } from "mongoose"
|
||||||
import { Player } from "discord-player"
|
import { Player } from "discord-player"
|
||||||
import { YoutubeiExtractor } from "discord-player-youtubei"
|
import { YoutubeiExtractor } from "discord-player-youtubei"
|
||||||
@@ -38,6 +38,7 @@ class Illegitimate {
|
|||||||
await player.extractors.register(YoutubeiExtractor, {})
|
await player.extractors.register(YoutubeiExtractor, {})
|
||||||
await client.start()
|
await client.start()
|
||||||
await this.databases()
|
await this.databases()
|
||||||
|
this.loadMethods()
|
||||||
}
|
}
|
||||||
|
|
||||||
private async databases() {
|
private async databases() {
|
||||||
@@ -71,6 +72,16 @@ class Illegitimate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private loadMethods() {
|
||||||
|
String.prototype.removeIndents = function(this: string) {
|
||||||
|
return this.replace(/^ */gm, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
String.prototype.capitalizeFirstLetter = function(this: string) {
|
||||||
|
return this[0].toUpperCase() + this.slice(1).toLowerCase()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { client, Illegitimate, redis, sequelize }
|
export { client, Illegitimate, redis, sequelize }
|
||||||
|
|||||||
@@ -7,10 +7,14 @@ const colors = {
|
|||||||
pink: "#f5c2e7"
|
pink: "#f5c2e7"
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function color(text: string, type: keyof typeof colors) {
|
export function color(text: string, type: keyof typeof colors) {
|
||||||
return chalk.hex(colors[type])(text)
|
return chalk.hex(colors[type])(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function colorCustom(text: string, color: string) {
|
||||||
|
return chalk.hex(color)(text)
|
||||||
|
}
|
||||||
|
|
||||||
/* const colors = {
|
/* const colors = {
|
||||||
reset: "\x1b[0m",
|
reset: "\x1b[0m",
|
||||||
bright: "\x1b[1m",
|
bright: "\x1b[1m",
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
export function capitalizeFirstLetter(str: string): string {
|
|
||||||
return str[0].toUpperCase() + str.slice(1).toLowerCase()
|
|
||||||
}
|
|
||||||
|
|
||||||
export function removeIndents(str: string): string {
|
|
||||||
return str.replace(/^ */gm, "")
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user