fix: convert to ES modules for matrix-js-sdk v42 compatibility

This commit is contained in:
unfunny
2026-09-13 00:55:46 -04:00
parent 09097d3554
commit afc70dbf01
2 changed files with 7 additions and 5 deletions

View File

@@ -1,12 +1,14 @@
require('dotenv').config(); import * as dotenv from 'dotenv';
const { MatrixClient } = require('matrix-js-sdk'); import { MatrixClient } from 'matrix-js-sdk';
const fs = require('fs'); import fs from 'fs';
dotenv.config();
const client = new MatrixClient({ const client = new MatrixClient({
accessToken: process.env.MATRIX_ACCESS_TOKEN, accessToken: process.env.MATRIX_ACCESS_TOKEN,
matrix_homeserver: { matrix_homeserver: {
baseUrl: process.env.MATRIX_HOME_SERVER, baseUrl: process.env.MATRIX_HOME_SERVER,
} },
}); });
function loadQuotes() { function loadQuotes() {

View File

@@ -2,6 +2,7 @@
"name": "ancestor-bot", "name": "ancestor-bot",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"type": "module",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
@@ -9,7 +10,6 @@
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"type": "commonjs",
"dependencies": { "dependencies": {
"dotenv": "^17.4.2", "dotenv": "^17.4.2",
"matrix-js-sdk": "^42.3.0" "matrix-js-sdk": "^42.3.0"