From afc70dbf011777a2798af852bf468868b9f4340e Mon Sep 17 00:00:00 2001 From: unfunny Date: Sun, 13 Sep 2026 00:55:46 -0400 Subject: [PATCH] fix: convert to ES modules for matrix-js-sdk v42 compatibility --- index.js | 10 ++++++---- package.json | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 9ea737e..735b472 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,14 @@ -require('dotenv').config(); -const { MatrixClient } = require('matrix-js-sdk'); -const fs = require('fs'); +import * as dotenv from 'dotenv'; +import { MatrixClient } from 'matrix-js-sdk'; +import fs from 'fs'; + +dotenv.config(); const client = new MatrixClient({ accessToken: process.env.MATRIX_ACCESS_TOKEN, matrix_homeserver: { baseUrl: process.env.MATRIX_HOME_SERVER, - } + }, }); function loadQuotes() { diff --git a/package.json b/package.json index f903b57..799b28a 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "name": "ancestor-bot", "version": "1.0.0", "description": "", + "type": "module", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" @@ -9,7 +10,6 @@ "keywords": [], "author": "", "license": "ISC", - "type": "commonjs", "dependencies": { "dotenv": "^17.4.2", "matrix-js-sdk": "^42.3.0"