From 79a498d1d6c1f8d5fdb384a2bf611d3499d3da5c Mon Sep 17 00:00:00 2001 From: Xiled Emerald Date: Sat, 7 Aug 2021 16:19:13 +0100 Subject: [PATCH] Update transcript.js --- commands/transcript.js | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/commands/transcript.js b/commands/transcript.js index b71abdf..33f2a2d 100644 --- a/commands/transcript.js +++ b/commands/transcript.js @@ -1,20 +1,16 @@ + // SupportBot, Created by Emerald Services // Announce - 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.ChatLog, description: supportbot.ChatLogDesc, - execute(message, args) { if (supportbot.DeleteMessages) message.delete(); - let name = message.channel.name; message.channel.messages.fetch({ limit: 100 }).then( msgs => { @@ -38,10 +34,9 @@ module.exports = { .setDescription(supportbot.ChatLogSavedMessage) .setColor(supportbot.SuccessColour) message.channel.send({embed: TranscriptSavedEmbed}) - const errornochannel = new Discord.MessageEmbed() .setTitle("SupportBot Error!") - .setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.TicketLog}\`\n\nError Code: \`SB-03\``) + .setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.ChatLogChannel}\`\n\nError Code: \`SB-03\``) .setColor(supportbot.ErrorColour); const ChatLogs = new Discord.MessageEmbed() @@ -53,7 +48,6 @@ module.exports = { ) .setColor(supportbot.EmbedColour) .setFooter(supportbot.EmbedFooter) - let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === supportbot.ChatLogChannel) || message.guild.channels.cache.find(LocateChannel => LocateChannel.id === supportbot.ChatLogChannel) if(!locateChannel) return message.channel.send({ embed: errornochannel }); @@ -63,4 +57,4 @@ module.exports = { }) } -} \ No newline at end of file +}