style: run format:apply
This commit is contained in:
+22
-11
@@ -1,29 +1,34 @@
|
||||
import { ChatInputCommandInteraction, MessageCreateOptions, MessageFlags, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import { Command } from "../../commands";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
MessageCreateOptions,
|
||||
MessageFlags,
|
||||
SlashCommandBuilder,
|
||||
TextChannel
|
||||
} from 'discord.js';
|
||||
import { Command } from '../../commands';
|
||||
|
||||
const builder = new SlashCommandBuilder()
|
||||
.setName('bot-mimic')
|
||||
.setDescription('Makes the bot send a message')
|
||||
.addStringOption(opt =>
|
||||
.addStringOption((opt) =>
|
||||
opt
|
||||
.setName('content')
|
||||
.setDescription('The text content of the message')
|
||||
.setRequired(false)
|
||||
)
|
||||
.addAttachmentOption(opt =>
|
||||
.addAttachmentOption((opt) =>
|
||||
opt
|
||||
.setName('attachment')
|
||||
.setDescription('An attachment for the message')
|
||||
.setRequired(false)
|
||||
)
|
||||
.addStringOption(opt =>
|
||||
.addStringOption((opt) =>
|
||||
opt
|
||||
.setName('reply')
|
||||
.setDescription('The message ID that the bot should reply to')
|
||||
.setRequired(false)
|
||||
);
|
||||
|
||||
|
||||
const command: Command = {
|
||||
name: 'bot-mimic',
|
||||
builder: builder,
|
||||
@@ -32,7 +37,9 @@ const command: Command = {
|
||||
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
|
||||
|
||||
if (!interaction.channel?.isTextBased()) {
|
||||
await interaction.editReply('This command can only be used in a text channel.');
|
||||
await interaction.editReply(
|
||||
'This command can only be used in a text channel.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -46,7 +53,9 @@ const command: Command = {
|
||||
const replyId = interaction.options.getString('reply');
|
||||
|
||||
if (!content && !attachment) {
|
||||
await interaction.editReply('Unable to send empty message. Specify content or attachment, or both.');
|
||||
await interaction.editReply(
|
||||
'Unable to send empty message. Specify content or attachment, or both.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -70,10 +79,12 @@ const command: Command = {
|
||||
}
|
||||
|
||||
if (attachment) {
|
||||
message.files = [{
|
||||
message.files = [
|
||||
{
|
||||
attachment: attachment.proxyURL,
|
||||
name: attachment.name
|
||||
}];
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -84,6 +95,6 @@ const command: Command = {
|
||||
await interaction.editReply('Failed to send message.');
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default command;
|
||||
|
||||
Reference in New Issue
Block a user