From 4d5aaaf99da89088d96327382e68fa4f79f4234e Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 1 Nov 2020 21:50:29 +0200 Subject: [PATCH] Link thread channel if logs are not available but the thread is open when using !log --- src/modules/logs.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modules/logs.js b/src/modules/logs.js index 5599bd8..fca9b0c 100644 --- a/src/modules/logs.js +++ b/src/modules/logs.js @@ -2,6 +2,7 @@ const threads = require("../data/threads"); const moment = require("moment"); const utils = require("../utils"); const { getLogUrl, getLogFile, getLogCustomResponse, saveLogToStorage } = require("../data/logs"); +const { THREAD_STATUS } = require("../data/constants"); const LOG_LINES_PER_PAGE = 10; @@ -95,6 +96,11 @@ module.exports = ({ bot, knex, config, commands, hooks }) => { return; } + if (thread.status === THREAD_STATUS.OPEN) { + msg.channel.createMessage(`This thread's logs are not currently available, but it's open at <#${thread.channel_id}>`); + return; + } + msg.channel.createMessage("This thread's logs are not currently available"); };