Update transcript.js
This commit is contained in:
1 parent
12a03c36f3
commit
79a498d1d6
1 file changed
+2
-8
@@ -1,20 +1,16 @@
|
|||||||
|
|
||||||
// SupportBot, Created by Emerald Services
|
// SupportBot, Created by Emerald Services
|
||||||
// Announce
|
// Announce
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
const yaml = require('js-yaml');
|
||||||
const { execute } = require("./help");
|
const { execute } = require("./help");
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: supportbot.ChatLog,
|
name: supportbot.ChatLog,
|
||||||
description: supportbot.ChatLogDesc,
|
description: supportbot.ChatLogDesc,
|
||||||
|
|
||||||
execute(message, args) {
|
execute(message, args) {
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
if (supportbot.DeleteMessages) message.delete();
|
||||||
|
|
||||||
let name = message.channel.name;
|
let name = message.channel.name;
|
||||||
|
|
||||||
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
||||||
@@ -38,10 +34,9 @@ module.exports = {
|
|||||||
.setDescription(supportbot.ChatLogSavedMessage)
|
.setDescription(supportbot.ChatLogSavedMessage)
|
||||||
.setColor(supportbot.SuccessColour)
|
.setColor(supportbot.SuccessColour)
|
||||||
message.channel.send({embed: TranscriptSavedEmbed})
|
message.channel.send({embed: TranscriptSavedEmbed})
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
const errornochannel = new Discord.MessageEmbed()
|
||||||
.setTitle("SupportBot Error!")
|
.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);
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
const ChatLogs = new Discord.MessageEmbed()
|
const ChatLogs = new Discord.MessageEmbed()
|
||||||
@@ -53,7 +48,6 @@ module.exports = {
|
|||||||
)
|
)
|
||||||
.setColor(supportbot.EmbedColour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(supportbot.EmbedFooter)
|
.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)
|
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 });
|
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
||||||
|
|||||||
Reference in new issue
Block a user