This commit is contained in:
Nikhil Nawgiri 2024-08-25 03:40:54 +02:00
parent 644ce2096c
commit f2efdebc90

View file

@ -1,21 +1,21 @@
import { config } from "../config.js";
import {
MatrixClient,
SimpleFsStorageProvider,
RustSdkCryptoStorageProvider,
AutojoinRoomsMixin
} from "matrix-bot-sdk";
const sdk = require("matrix-bot-sdk");
import { config } from "../config.ts";
import { callOpenAiAPI } from "./openai.js";
const {
homeserverUrl,
accessToken,
storageLocation,
cryptoFolderLocation,
openaiApiKey,
} = config;
const {
MatrixClient,
SimpleFsStorageProvider,
RustSdkCryptoStorageProvider,
AutojoinRoomsMixin
} = sdk;
// In order to make sure the bot doesn't lose its state between restarts, we'll give it a place to cache
// any information it needs to. You can implement your own storage provider if you like, but a JSON file
// will work fine for this example.