Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
Fix issue when encryption disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
bertybuttface committed Feb 8, 2023
1 parent 43dc126 commit 4fc1a3a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import ChatGPTClient from '@waylaidwanderer/chatgpt-api';
import Keyv from 'keyv'
import { KeyvFile } from 'keyv-file';
import {
MatrixAuth, MatrixClient, AutojoinRoomsMixin,
LogService, LogLevel, RichConsoleLogger,
RustSdkCryptoStorageProvider, IStorageProvider, SimpleFsStorageProvider,
MatrixAuth, MatrixClient, AutojoinRoomsMixin, LogService, LogLevel, RichConsoleLogger,
RustSdkCryptoStorageProvider, IStorageProvider, SimpleFsStorageProvider, ICryptoStorageProvider,
} from "matrix-bot-sdk";

import * as path from "path";
Expand Down Expand Up @@ -34,7 +33,8 @@ if (KEYV_BOT_STORAGE) {
storage = new SimpleFsStorageProvider(path.join(DATA_PATH, "bot.json")); // /storage/bot.json
}

const cryptoStore = MATRIX_ENCRYPTION ? new RustSdkCryptoStorageProvider(path.join(DATA_PATH, "encrypted")) : undefined; // /storage/encrypted
let cryptoStore: ICryptoStorageProvider;
if (MATRIX_ENCRYPTION) cryptoStore = new RustSdkCryptoStorageProvider(path.join(DATA_PATH, "encrypted")); // /storage/encrypted

async function main() {
if (!MATRIX_ACCESS_TOKEN){
Expand Down

0 comments on commit 4fc1a3a

Please sign in to comment.