Add support for sending stats to Matrix, split out some code into more generic classes. #1

Open
rory.gay wants to merge 35 commits from rory.gay/freepbx-stats:main into main
Showing only changes of commit 25cf0254ec - Show all commits

View file

@ -123,7 +123,7 @@ async function sendSummary() {
await records.toJSONFile(JSON_FILE);
const yesterday = getYesterday();
const makeField = (name, value) => ({ name, value: value.toString(), inline: false });
const makeField = (name, value) => ({ name, value: value === undefined ? "***ERR: UNDEFINED***" : value.toString(), inline: false });
let embed = {
title: `Summary from <t:${Math.floor(yesterday.start / 1000)}:f> to <t:${Math.floor(yesterday.end / 1000)}:f>`,