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) {
|
||||
const html = ```
|
||||
const html = `
|
||||
<table>
|
||||
<thead>
|
||||
<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>` : ''}
|
||||
</tbody>
|
||||
</table>
|
||||
```;
|
||||
`;
|
||||
var message = {
|
||||
"msgtype": "m.text",
|
||||
"format": "org.matrix.custom.html",
|
||||
|
|
Loading…
Reference in a new issue