Skip to content

Commit

Permalink
fixed error
Browse files Browse the repository at this point in the history
"botConfig" now useing "Record" struct
  • Loading branch information
ruan11223344 committed Dec 8, 2022
1 parent c719360 commit 0fd5e55
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chatgpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class ChatGPTBot {
// Record talkid with conversation id
conversations = new Map<string, ChatGPTConversation>();
chatGPTPools: Array<ChatGPTAPI> | [] = [];
botConfig: { [key: string]: string } = {
botConfig: Record<string,string> = {
trigger_keywords:""
};

Expand Down Expand Up @@ -70,7 +70,9 @@ export class ChatGPTBot {
console.log(`Chatgpt pool size: ${chatGPTPools.length}`);
this.chatGPTPools = chatGPTPools;
config.botConfig.forEach((item: { [key: string]: string; }) => {
this.botConfig = { ...this.botConfig, ...item };
Object.keys(item).forEach((configItemKey: string ) =>{
this.botConfig[configItemKey] = item[configItemKey]
})
});
}
get chatgpt(): ChatGPTAPI {
Expand Down

0 comments on commit 0fd5e55

Please sign in to comment.