Link thread channel if logs are not available but the thread is open when using !log

cshd
Dragory 2020-11-01 21:50:29 +02:00
parent b15e0e955c
commit 4d5aaaf99d
No known key found for this signature in database
GPG Key ID: 5F387BA66DF8AAC1
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ const threads = require("../data/threads");
const moment = require("moment"); const moment = require("moment");
const utils = require("../utils"); const utils = require("../utils");
const { getLogUrl, getLogFile, getLogCustomResponse, saveLogToStorage } = require("../data/logs"); const { getLogUrl, getLogFile, getLogCustomResponse, saveLogToStorage } = require("../data/logs");
const { THREAD_STATUS } = require("../data/constants");
const LOG_LINES_PER_PAGE = 10; const LOG_LINES_PER_PAGE = 10;
@ -95,6 +96,11 @@ module.exports = ({ bot, knex, config, commands, hooks }) => {
return; 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"); msg.channel.createMessage("This thread's logs are not currently available");
}; };