const Discord = require('discord.
js')
const { Database } = require('[Link]');
const { ApplicationCommandType, ApplicationCommandOptionType, ChannelType } =
require('[Link]');
const config = require('../../[Link]')
const { MessageEmbed, MessageActionRow, SelectMenuBuilder } =
require('[Link]');
const { ActionRowBuilder, EmbedBuilder } = require('@discordjs/builders');
[Link] = {
name: 'say',
type: [Link],
description: 'Faz com que o bot diga alguma mensagem.',
options: [
{
name: 'mensagem',
type: [Link],
description: 'A mensagem que será enviada no canal.',
required: true
},
{
name: 'título',
type: [Link],
description: 'A mensagem que será enviada no canal.',
required: true
},
{
name: 'cor',
type: [Link],
description: 'Cores disponíveis: RED, BLUE, PURPLE, YELLOW,
ORANGE, GREEN, WHITE, BLACK.',
required: true
}
],
run: async (client, interaction, args) => {
let cor = [Link]('cor')
const cores = ["RED", "BLUE", "PURPLE", "YELLOW", "ORANGE", "GREEN",
"WHITE", "BLACK"]
let embedcores = new [Link]()
.setDescription(`> **Erro**\n\n> A cor que forneceu não é
**válida**`)
.setColor('FF3232')
.setThumbnail([Link]())
.setFooter({ text: [Link]})
.setTimestamp(new Date())
if (){ return [Link]({embeds:
[embedcores], components: [] })}
switch(cor) {
case "RED":
cor = 'FF3232'
break
case "GREEN":
cor = '75FF54'
break
case "BLUE":
cor = '30D0FF'
break
case "PURPLE":
cor = 'B706A9'
break
case "YELLOW":
cor = 'E8FF00'
break
case "ORANGE":
cor = 'FF7D10'
break
case "WHITE":
cor = 'FFFFFF'
break
case "BLACK":
cor = '000000'
break
if () return
[Link]({ content: 'Você não possui permissão para usar este
comando :c', ephemeral: true })
const channels = [Link]
let embedcanais = new [Link]()
.setDescription(`> **Erro**\n\n> Não consigo enviar a **mensagem**
em nenhum dos canais do **servidor**.`)
.setColor('FF3232')
.setThumbnail([Link]())
.setFooter({ text: [Link]})
.setTimestamp(new Date())
if (![Link]) return [Link]({ embeds:
[embedcanais], components: [], ephemeral: true })
const actionRow = new ActionRowBuilder()
.addComponents([
new SelectMenuBuilder()
.setCustomId('channelSelect')
.setPlaceholder('Selecione um canal')
.addOptions(
channels
.map(c => {
return {
label: [Link],
value: [Link]
}
})
)
])
const reply = await [Link]({content: '**Selecione abaixo o
canal onde deseja enviar a mensagem**',components: [actionRow]})
const filter = (i) => [Link] === [Link]
const collector = [Link]({ filter, max: 1,
time: (3 * 60000) })
[Link]('collect', (i) => {
const idCanal = [Link][0]
const categoria1 = [Link](idCanal);
let embedcanal = new [Link]()
.setColor('FF3232')
.setDescription(`**Erro**\n\n> O **canal** fornecido não é válido\n\n>
**Canal** fornecido: **<#${idCanal}>**`)
if ([Link] !== [Link]) return
[Link]({embeds: [embedcanal]})
const canal = [Link](idCanal)
const texto = [Link]('mensagem')
const titulo = [Link]('título')
const embed = new [Link]()
.setTitle(`> ${titulo}`)
.setDescription(`> ${texto}`)
.setColor(cor)
.setThumbnail([Link]())
.setFooter({ text: [Link]})
.setTimestamp(new Date())
const embed1 = new [Link]()
.setDescription(`> **Erro**\n\n> Ocorreu um **erro** ao tentar
enviar a **mensagem**`)
.setColor('FF3232')
.setThumbnail([Link]())
.setFooter({ text: [Link]})
.setTimestamp(new Date())
const embed2 = new [Link]()
.setDescription(`> **Mensagem**\n\n> Mensagem enviada com
**sucesso** no canal ${[Link]()}`)
.setColor('75FF54')
.setThumbnail([Link]())
.setFooter({ text: [Link]})
.setTimestamp(new Date())
[Link]({ embeds: [embed] })
.then(() => [Link]({ embeds: [embed2], components:
[] }))
.catch(() => [Link]({ embeds: [embed1], components:
[] }))
})
const embed3 = new [Link]()
.setDescription(`> **Erro**\n\n> O tempo para **informar** o canal
se **esgotou**`)
.setColor('FF3232')
.setThumbnail([Link]())
.setFooter({ text: [Link]})
.setTimestamp(new Date())
[Link]('end', (collected, reason) => {
if (reason === 'time') [Link]({ embeds: [embed3],
components: [] })
})
}
}