Replaced clang format with prettuier (sadly)
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { SlashCommandBuilder, PermissionFlagsBits, ChannelType, GuildTextBasedChannel } from "discord.js"
|
||||
import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
ChannelType,
|
||||
GuildTextBasedChannel,
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "../../config/options.json"
|
||||
import { Command } from "../interfaces"
|
||||
|
||||
@@ -16,32 +21,40 @@ export = {
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription("The message to send.")
|
||||
.setRequired(true))
|
||||
.setRequired(true),
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the message to."))
|
||||
.setDescription("The channel to send the message to."),
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
const message = interaction.options.getString("message")!
|
||||
const channel2 = interaction.options.getChannel("channel") ?? interaction.channel
|
||||
const channel2 =
|
||||
interaction.options.getChannel("channel") ?? interaction.channel
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (channel2?.type !== ChannelType.GuildText) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "You can only send a message to a text channel.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"You can only send a message to a text channel.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL({
|
||||
forceStatic: false,
|
||||
}) || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -55,25 +68,34 @@ export = {
|
||||
description: message,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL({ forceStatic: false })!
|
||||
url: interaction.guild!.iconURL({
|
||||
forceStatic: false,
|
||||
})!,
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.id + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL({ forceStatic: true }) || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
icon_url:
|
||||
interaction.guild!.iconURL({ forceStatic: true }) ||
|
||||
undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Message sent.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Message sent.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL({
|
||||
forceStatic: false,
|
||||
}) || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
} as Command
|
||||
},
|
||||
} as Command
|
||||
|
||||
Reference in New Issue
Block a user