Update BotSay.js

This commit is contained in:
ItzEmerald committed 2020-07-15 02:20:05 +01:00
1 parent d93991ad86
commit cc5a6b7317
1 file changed
+24 -16
+24 -16
View File
@@ -1,5 +1,5 @@
// SupportBot 6.0, Created by Emerald Services // SupportBot 6.0, Created by Emerald Services
// Bot Say Command // Say Command
const Discord = require("discord.js"); const Discord = require("discord.js");
const fs = require("fs"); const fs = require("fs");
@@ -14,28 +14,36 @@ module.exports = {
execute(message, args) { execute(message, args) {
let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff) let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Staff);
let Admins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin)
const NoPerms = new Discord.MessageEmbed() const NoPerms = new Discord.MessageEmbed()
.setTitle("Invalid Permissions!") .setTitle("Invalid Permissions!")
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``) .setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
.setColor(supportbot.WarningColour) .setColor(supportbot.WarningColour)
if (!message.member.roles.cache.has(SupportStaff.id || Admins.id)) { if (!message.member.roles.cache.has(SupportStaff.id))
const BotSpeaks = agrs.join(" ");
const Speaking = new Discord.MessageEmbed()
.setDescription(args.join)
.setColor(supportbot.EmbedColour)
message.channel.send({ embed: Speaking })
} else {
return message.channel.send({ embed: NoPerms }); 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 })
})
} }