updated announce.js
cleaned up the code + updated the command executed message
This commit is contained in:
1 parent
67b291eb09
commit
0dc8c1e68a
1 file changed
+11
-24
+11
-24
@@ -1,14 +1,17 @@
|
|||||||
// SupportBot
|
// SupportBot
|
||||||
// Command: Say
|
// Created by © 2020 Emerald Services
|
||||||
|
// Command: Announce (including @everyone)
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const bot = new Discord.Client()
|
const bot = new Discord.Client();
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
bot.settings = require("../settings.json");
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
exports.run = (bot, message, args) => {
|
||||||
message.delete();
|
message.delete();
|
||||||
|
|
||||||
|
console.log(`\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${bot.settings.prefix}${bot.settings.Announcement_Command}`);
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
const rolemissing = new Discord.RichEmbed()
|
||||||
@@ -35,30 +38,14 @@ exports.run = async(bot, message, args) => {
|
|||||||
ac.send(embed);
|
ac.send(embed);
|
||||||
});
|
});
|
||||||
|
|
||||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
const AccSuccessEmbed = new Discord.RichEmbed()
|
||||||
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${ac.id}>`)
|
.setTitle("Announcement Created")
|
||||||
|
.setDescription(`👍 Successfully sent your announcement to <#${ac.id}>`)
|
||||||
.setColor(bot.settings.colour)
|
.setColor(bot.settings.colour)
|
||||||
message.channel.send(SuggestionSuccessEmbed);
|
message.channel.send({embed: AccSucessEmbed});
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Announcement_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Announcement_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: bot.settings.Announcement_Command,
|
name: bot.settings.Announcement_Command,
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user