2020-12-18 13:37:56 +00:00
|
|
|
// SupportBot, Created by Emerald Services
|
2020-07-14 19:17:40 +01:00
|
|
|
// Say Command
|
|
|
|
|
|
|
|
|
|
const Discord = require("discord.js");
|
|
|
|
|
const fs = require("fs");
|
|
|
|
|
|
|
|
|
|
const yaml = require('js-yaml');
|
|
|
|
|
const { execute } = require("./help");
|
|
|
|
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
name: supportbot.BotSay,
|
|
|
|
|
description: supportbot.BotSayDesc,
|
|
|
|
|
|
|
|
|
|
execute(message, args) {
|
2021-05-23 10:39:18 +02:00
|
|
|
if (supportbot.DeleteMessages) message.delete();
|
2020-07-27 10:43:59 -04:00
|
|
|
|
2021-05-23 10:39:18 +02:00
|
|
|
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Staff) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Staff)
|
2020-07-14 19:17:40 +01:00
|
|
|
|
2021-02-02 17:01:58 +00:00
|
|
|
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.BotSay}!`);
|
|
|
|
|
|
2020-07-14 19:17:40 +01:00
|
|
|
const NoPerms = new Discord.MessageEmbed()
|
|
|
|
|
.setTitle("Invalid Permissions!")
|
|
|
|
|
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
|
|
|
|
.setColor(supportbot.WarningColour)
|
|
|
|
|
|
|
|
|
|
if (!message.member.roles.cache.has(SupportStaff.id))
|
|
|
|
|
return message.channel.send({ embed: NoPerms });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const embed = new Discord.MessageEmbed()
|
|
|
|
|
.setDescription(`> **What would you like me to say!**`)
|
|
|
|
|
.setColor(supportbot.EmbedColour)
|
|
|
|
|
message.channel.send({ embed: embed });
|
|
|
|
|
|
|
|
|
|
let announcement = []
|
|
|
|
|
message.channel.awaitMessages(response => response.content.length > 2, {
|
|
|
|
|
max: 1,
|
|
|
|
|
time: 500000,
|
|
|
|
|
errors: ['time'],
|
|
|
|
|
}).then((collected) => {
|
|
|
|
|
announcement.push(collected.map(r => r.content));
|
|
|
|
|
|
|
|
|
|
const AnnouncementEmbed = new Discord.MessageEmbed()
|
|
|
|
|
.setDescription(announcement)
|
|
|
|
|
.setColor(supportbot.EmbedColour)
|
|
|
|
|
|
|
|
|
|
message.channel.send({ embed: AnnouncementEmbed })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-27 10:43:59 -04:00
|
|
|
};
|