Fixed formatting on all command files
This commit is contained in:
@@ -1,11 +1,4 @@
|
||||
import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
ChannelType,
|
||||
TextChannel,
|
||||
channelMention,
|
||||
userMention
|
||||
} from "discord.js"
|
||||
import { SlashCommandBuilder, PermissionFlagsBits, ChannelType, TextChannel, channelMention, userMention } from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
@@ -28,10 +21,7 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to set the slowmode of.")
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -40,64 +30,57 @@ export = {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
const seconds = interaction.options.getInteger("seconds") ?? 5
|
||||
const channel = (interaction.options.getChannel("channel") ||
|
||||
interaction.channel) as TextChannel
|
||||
const channel = (interaction.options.getChannel("channel") || interaction.channel) as TextChannel
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (seconds > 21600) {
|
||||
await channel.setRateLimitPerUser(21600)
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: `Set the slowmode of ${channel} to 21600 seconds.`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined
|
||||
},
|
||||
title: "Slowmode Update",
|
||||
description: `
|
||||
**Channel:** ${channelMention(channel.id)}
|
||||
**Slowmode:** ${seconds} seconds
|
||||
**Mod:** ${userMention(interaction.user.id)}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: " ID: " + channel.id
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
|
||||
embeds: [{
|
||||
description: `Set the slowmode of ${channel} to 21600 seconds.`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined
|
||||
},
|
||||
title: "Slowmode Update",
|
||||
description: `
|
||||
**Channel:** ${channelMention(channel.id)}
|
||||
**Slowmode:** ${seconds} seconds
|
||||
**Mod:** ${userMention(interaction.user.id)}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: " ID: " + channel.id
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
await channel.setRateLimitPerUser(seconds)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user