Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Databingo committed Oct 30, 2023
1 parent a3b4e81 commit fbc1683
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cd ryy && go build -o ../vi && cd -
go build -tags vi
5 changes: 3 additions & 2 deletions chatgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ func Chatgpt() {
// channel_chatgpt <- "click_chatgpt"
//}

page_chatgpt.MustElementX("//div[contains(text(), 'Stop generating')]")
var regenerate_icon = false
for i := 1; i <= 60; i++ {
if page_chatgpt.MustHas("svg path[d='M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15']") {
Expand All @@ -109,8 +110,8 @@ func Chatgpt() {
time.Sleep(1 * time.Second)
}
if regenerate_icon == true {
//answer := page_chatgpt.MustElementX("(//div[contains(@class, 'group w-full')])[last()]").MustText()[7:]
answer := page_chatgpt.MustElementX("(//div[contains(@class, 'group final-completion w-full')])[last()]").MustText()[7:]
answer := page_chatgpt.MustElementX("(//div[contains(@class, 'group w-full')])[last()]").MustText()[7:]
//answer := page_chatgpt.MustElementX("(//div[contains(@class, 'group final-completion w-full')])[last()]").MustText()[7:]
if strings.Contains(answer,
"An error occurred. Either the engine you requested does not exist or there was another issue processing your request. If this issue persists please contact us through our help center at help.openai.com.") {
relogin_chatgpt = true
Expand Down
Binary file added ryy/ryy
Binary file not shown.

0 comments on commit fbc1683

Please sign in to comment.