fix: convert to ES modules for matrix-js-sdk v42 compatibility
This commit is contained in:
10
index.js
10
index.js
@@ -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() {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user