Add support for sending stats to Matrix, split out some code into more generic classes. #1
4
index.js
4
index.js
|
@ -137,7 +137,7 @@ async function sendSummary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function sendSummaryMatrix(yesterday, stats) {
|
async function sendSummaryMatrix(yesterday, stats) {
|
||||||
const html = ```
|
const html = `
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -153,7 +153,7 @@ async function sendSummaryMatrix(yesterday, stats) {
|
||||||
${stats.isNewRecord ? `<tr><td colspan="2">🎉 NEW RECORD! 🎉 A new record has been set, at ${stats.totalCallsMade}!</td></tr>` : ''}
|
${stats.isNewRecord ? `<tr><td colspan="2">🎉 NEW RECORD! 🎉 A new record has been set, at ${stats.totalCallsMade}!</td></tr>` : ''}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
```;
|
`;
|
||||||
var message = {
|
var message = {
|
||||||
"msgtype": "m.text",
|
"msgtype": "m.text",
|
||||||
"format": "org.matrix.custom.html",
|
"format": "org.matrix.custom.html",
|
||||||
|
|
Loading…
Reference in a new issue