Skip to content

Commit

Permalink
change object foreach
Browse files Browse the repository at this point in the history
to Object.assign
  • Loading branch information
ruan11223344 committed Dec 8, 2022
1 parent 0fd5e55 commit 98686e2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/chatgpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ export class ChatGPTBot {
console.log(`Chatgpt pool size: ${chatGPTPools.length}`);
this.chatGPTPools = chatGPTPools;
config.botConfig.forEach((item: { [key: string]: string; }) => {
Object.keys(item).forEach((configItemKey: string ) =>{
this.botConfig[configItemKey] = item[configItemKey]
})
Object.assign(this.botConfig, item)
});
}
get chatgpt(): ChatGPTAPI {
Expand Down

0 comments on commit 98686e2

Please sign in to comment.