diff --git a/addons/addon-example.js b/addons/addon-example.js index 76ec67b..b17ff96 100644 --- a/addons/addon-example.js +++ b/addons/addon-example.js @@ -14,6 +14,7 @@ module.exports = { description: example.ExampleAddonDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); message.channel.send(example.ExampleAddonMessage) } -}; \ No newline at end of file +}; diff --git a/commands/addUser.js b/commands/addUser.js index d30ca34..62ef5d5 100644 --- a/commands/addUser.js +++ b/commands/addUser.js @@ -11,7 +11,8 @@ module.exports = { name: supportbot.AddUser, description: supportbot.AddUserDesc, - execute(message, args) { + execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.AddUser}!`); let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff) @@ -61,4 +62,4 @@ module.exports = { } } -}; \ No newline at end of file +}; diff --git a/commands/announce.js b/commands/announce.js index fff1a6e..a6e1f68 100644 --- a/commands/announce.js +++ b/commands/announce.js @@ -13,7 +13,9 @@ module.exports = { description: supportbot.AnnounceDesc, execute(message, args) { - + + if (supportbot.DeleteMessages == "true") message.delete(); + let locateChannel = message.guild.channels.cache.find(AnnouncementChannel => AnnouncementChannel.name === supportbot.AnnouncementChannel); const errornochannel = new Discord.MessageEmbed() @@ -65,4 +67,4 @@ module.exports = { } -}; \ No newline at end of file +}; diff --git a/commands/botSay.js b/commands/botSay.js index c90df2c..1e930b5 100644 --- a/commands/botSay.js +++ b/commands/botSay.js @@ -13,7 +13,8 @@ module.exports = { description: supportbot.BotSayDesc, execute(message, args) { - + if (supportbot.DeleteMessages == "true") message.delete(); + let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Staff); const NoPerms = new Discord.MessageEmbed() @@ -47,4 +48,4 @@ module.exports = { } -}; \ No newline at end of file +}; diff --git a/commands/close.js b/commands/close.js index d45fae6..3610fe6 100644 --- a/commands/close.js +++ b/commands/close.js @@ -13,6 +13,8 @@ module.exports = { description: supportbot.CloseTicketDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); + console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.CloseTicket}!`); if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) { @@ -144,4 +146,4 @@ module.exports = { } } -}; \ No newline at end of file +}; diff --git a/commands/help.js b/commands/help.js index 4a54852..bfe65d6 100644 --- a/commands/help.js +++ b/commands/help.js @@ -12,6 +12,8 @@ module.exports = { description: supportbot.HelpDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); + let generalCommands = ""; generalCommands += `**${supportbot.Prefix}${supportbot.HelpCommand}** ${supportbot.HelpDesc}\n`; generalCommands += `**${supportbot.Prefix}${supportbot.LinksCommand}** ${supportbot.LinkDesc}\n`; diff --git a/commands/links.js b/commands/links.js index 4282cad..4f3746f 100644 --- a/commands/links.js +++ b/commands/links.js @@ -13,6 +13,7 @@ module.exports = { description: supportbot.LinksDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); const LinksEmbed = new Discord.MessageEmbed() .setColor(supportbot.EmbedColour) @@ -30,4 +31,4 @@ module.exports = { message.channel.send({ embed: LinksEmbed }); } -}; \ No newline at end of file +}; diff --git a/commands/newticket.js b/commands/newticket.js index 2e5aac4..c0fadc9 100644 --- a/commands/newticket.js +++ b/commands/newticket.js @@ -14,6 +14,8 @@ module.exports = { description: supportbot.NewTicketDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); + console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.NewTicket}!`); // Ticket ID diff --git a/commands/ping.js b/commands/ping.js index e69206c..f476a2b 100644 --- a/commands/ping.js +++ b/commands/ping.js @@ -12,6 +12,8 @@ module.exports = { description: supportbot.PingDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); + let ping = Date.now() - message.createdTimestamp + " ms"; const PingCommandEmbed = new Discord.MessageEmbed() @@ -20,4 +22,4 @@ module.exports = { message.channel.send({ embed: PingCommandEmbed }); } -}; \ No newline at end of file +}; diff --git a/commands/removeUser.js b/commands/removeUser.js index 34cb52f..61e9990 100644 --- a/commands/removeUser.js +++ b/commands/removeUser.js @@ -12,6 +12,8 @@ module.exports = { description: supportbot.RemoveUserDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); + console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[32m`, `${message.author.tag} has executed ${supportbot.Prefix}${supportbot.RemoveUser}!`); let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff) @@ -59,4 +61,4 @@ module.exports = { } } -}; \ No newline at end of file +}; diff --git a/commands/suggest.js b/commands/suggest.js index 7ffd398..118f45d 100644 --- a/commands/suggest.js +++ b/commands/suggest.js @@ -12,6 +12,8 @@ module.exports = { description: supportbot.SuggestionDesc, execute(message, args) { + if (supportbot.DeleteMessages == "true") message.delete(); + let locateChannel = message.guild.channels.cache.find(SuggestionChannel => SuggestionChannel.name === supportbot.SuggestionChannel); const errornochannel = new Discord.MessageEmbed() @@ -55,4 +57,4 @@ module.exports = { }); } -}; \ No newline at end of file +}; diff --git a/events/message.js b/events/message.js index f3a92fb..800ea86 100644 --- a/events/message.js +++ b/events/message.js @@ -19,6 +19,4 @@ module.exports = async (bot, message) => { const cmd = bot.commands.get(command); if(!cmd) return; cmd.execute(message, args); - message.delete(); - -}; \ No newline at end of file +}; diff --git a/supportbot-config.yml b/supportbot-config.yml index dcc2c49..cf734e9 100644 --- a/supportbot-config.yml +++ b/supportbot-config.yml @@ -19,6 +19,8 @@ BotActivity: "-help ~ SupportBot 6.0" ActivityType: "PLAYING" # Activity status can either be PLAYING, WATCHING or LISTENING. +DeleteMessages: "true" + # Embed Configuration EmbedColour: "#04b545"