mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
* add timestamp to moderator Slack messages * fix test errors * import moment, condense formatting * add timestamp to author_name variable * update test to include timestamp, fix footer matching * change ISODate to Date * update test to include timestamp
This commit is contained in:
committed by
Matteo Pagliazzi
parent
26e9827d39
commit
97a069642d
@@ -3,6 +3,7 @@ import { IncomingWebhook } from '@slack/client';
|
||||
import logger from './logger';
|
||||
import { TAVERN_ID } from '../models/group';
|
||||
import nconf from 'nconf';
|
||||
import moment from 'moment';
|
||||
|
||||
const SLACK_FLAGGING_URL = nconf.get('SLACK:FLAGGING_URL');
|
||||
const SLACK_FLAGGING_FOOTER_LINK = nconf.get('SLACK:FLAGGING_FOOTER_LINK');
|
||||
@@ -52,12 +53,14 @@ function sendFlagNotification ({
|
||||
authorName = `${message.user} - ${authorEmail} - ${message.uuid}`;
|
||||
}
|
||||
|
||||
const timestamp = `${moment(message.timestamp).utc().format('YYYY-MM-DD HH:mm')} UTC`;
|
||||
|
||||
flagSlack.send({
|
||||
text,
|
||||
attachments: [{
|
||||
fallback: 'Flag Message',
|
||||
color: 'danger',
|
||||
author_name: authorName,
|
||||
author_name: `${authorName}\n${timestamp}`,
|
||||
title,
|
||||
title_link: titleLink,
|
||||
text: message.text,
|
||||
|
||||
Reference in New Issue
Block a user