Show staff reply numbers in threads/logs
parent
3002473905
commit
e74363a55c
|
@ -197,7 +197,7 @@ class Thread {
|
|||
}
|
||||
|
||||
// Save the log entry
|
||||
const logContent = formatters.formatStaffReplyLogMessage(moderator, text, { isAnonymous, attachmentLinks });
|
||||
const logContent = formatters.formatStaffReplyLogMessage(moderator, text, threadMessage.message_number, { isAnonymous, attachmentLinks });
|
||||
const threadMessage = await this._addThreadMessageToDB({
|
||||
message_type: THREAD_MESSAGE_TYPE.TO_USER,
|
||||
user_id: moderator.id,
|
||||
|
|
|
@ -31,6 +31,7 @@ const ThreadMessage = require('./data/ThreadMessage');
|
|||
* @callback FormatStaffReplyLogMessage
|
||||
* @param {Eris.Member} moderator
|
||||
* @param {string} text
|
||||
* @param {number} messageNumber
|
||||
* @param {{
|
||||
* isAnonymous: boolean,
|
||||
* attachmentLinks: string[],
|
||||
|
@ -128,7 +129,6 @@ const defaultFormatters = {
|
|||
? `(Anonymous) (${modName}) ${mainRole ? mainRole.name : 'Moderator'}`
|
||||
: (mainRole ? `(${mainRole.name}) ${modName}` : modName);
|
||||
|
||||
// TODO: Add \`[${messageNumber}]\` here once !edit and !delete exist
|
||||
let result = `**${modInfo}:** ${text}`;
|
||||
|
||||
if (config.threadTimestamps) {
|
||||
|
@ -136,10 +136,12 @@ const defaultFormatters = {
|
|||
result = `[${formattedTimestamp}] ${result}`;
|
||||
}
|
||||
|
||||
result = `\`[${messageNumber}]\` ${result}`;
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
formatStaffReplyLogMessage(moderator, text, opts = {}) {
|
||||
formatStaffReplyLogMessage(moderator, text, messageNumber, opts = {}) {
|
||||
const mainRole = utils.getMainRole(moderator);
|
||||
const modName = moderator.user.username;
|
||||
|
||||
|
@ -157,6 +159,8 @@ const defaultFormatters = {
|
|||
}
|
||||
}
|
||||
|
||||
result = `[${messageNumber}] ${result}`;
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue