kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
Merge pull request #143 from waylaidwanderer/feature/improve-robustness
commit
6b6de5845c
|
@ -267,10 +267,18 @@ export class ChatGPTAPIBrowser {
|
||||||
|
|
||||||
const lastMessage = await this.getLastMessage()
|
const lastMessage = await this.getLastMessage()
|
||||||
|
|
||||||
message = message.replace('\n', '\t')
|
|
||||||
await inputBox.focus()
|
await inputBox.focus()
|
||||||
await inputBox.type(message, { delay: 0 })
|
const paragraphs = message.split('\n')
|
||||||
|
for (let i = 0; i < paragraphs.length; i++) {
|
||||||
|
await inputBox.type(paragraphs[i], { delay: 0 })
|
||||||
|
if (i < paragraphs.length - 1) {
|
||||||
|
await this._page.keyboard.down('Shift')
|
||||||
await inputBox.press('Enter')
|
await inputBox.press('Enter')
|
||||||
|
await this._page.keyboard.up('Shift')
|
||||||
|
} else {
|
||||||
|
await inputBox.press('Enter')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
await delay(1000)
|
await delay(1000)
|
||||||
|
|
Ładowanie…
Reference in New Issue