Initial commit
This commit is contained in:
52
commands/send.js
Normal file
52
commands/send.js
Normal file
@@ -0,0 +1,52 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'send',
|
||||
description: 'Send a message to a channel.',
|
||||
type: 'slash',
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('send')
|
||||
.setDescription('Send a message to a channel.')
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName('message')
|
||||
.setDescription('The message to send.'))
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName('channel')
|
||||
.setDescription('The channel to send the message to.'))
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const message = interaction.options.getString('message');
|
||||
const channel = interaction.options.getChannel('channel');
|
||||
|
||||
if (!message) {
|
||||
interaction.reply({ content: 'Please provide a message to send.', ephemeral: true })
|
||||
return
|
||||
}
|
||||
|
||||
if (!channel) {
|
||||
interaction.reply({ content: 'Please provide a channel to send the message to.', ephemeral: true })
|
||||
return
|
||||
}
|
||||
|
||||
channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description: message,
|
||||
color: 0x00ff00,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
footer: {
|
||||
text: "Developed by @Taken#0002"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user