Refactor
This commit is contained in:
parent
644ce2096c
commit
f2efdebc90
18
src/main.ts
18
src/main.ts
|
@ -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 {
|
const {
|
||||||
homeserverUrl,
|
homeserverUrl,
|
||||||
accessToken,
|
accessToken,
|
||||||
storageLocation,
|
storageLocation,
|
||||||
cryptoFolderLocation,
|
cryptoFolderLocation,
|
||||||
|
openaiApiKey,
|
||||||
} = config;
|
} = 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
|
// 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
|
// 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.
|
// will work fine for this example.
|
||||||
|
|
Loading…
Reference in a new issue