Beautifying

This commit is contained in:
2023-04-24 23:38:33 +02:00
parent e2747dab3f
commit 3a3bb89635
40 changed files with 4010 additions and 3388 deletions

View File

@@ -1,57 +1,62 @@
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
const { color } = require('../config/options.json');
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
const { color } = require("../config/options.json");
module.exports = {
name: 'send',
description: 'Send a message to a channel.',
type: 'slash',
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.'))
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
async execute(interaction) {
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.")
)
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false),
await interaction.deferReply({ ephemeral: true });
async execute(interaction) {
await interaction.deferReply({ ephemeral: true });
const message = interaction.options.getString('message');
const channel = interaction.options.getChannel('channel');
const embedColor = Number(color.replace("#", "0x"));
const message = interaction.options.getString("message");
const channel = interaction.options.getChannel("channel");
const embedColor = Number(color.replace("#", "0x"));
if (!message) {
interaction.editReply({ content: 'Please provide a message to send.', ephemeral: true })
return
}
if (!channel) {
interaction.editReply({ content: 'Please provide a channel to send the message to.', ephemeral: true })
return
}
channel.send({
embeds: [
{
title: interaction.guild.name,
description: message,
color: embedColor,
thumbnail: {
url: interaction.guild.iconURL({ dynamic: true })
},
footer: {
text: "Developed by @Taken#0002"
}
}
]
});
if (!message) {
interaction.editReply({
content: "Please provide a message to send.",
ephemeral: true
});
return;
}
};
if (!channel) {
interaction.editReply({
content: "Please provide a channel to send the message to.",
ephemeral: true
});
return;
}
channel.send({
embeds: [
{
title: interaction.guild.name,
description: message,
color: embedColor,
thumbnail: {
url: interaction.guild.iconURL({ dynamic: true })
},
footer: {
text: "Developed by @Taken#0002"
}
}
]
});
}
};