Skip to content

Commit

Permalink
添加代理设置
Browse files Browse the repository at this point in the history
  • Loading branch information
yxw21 committed Dec 26, 2022
1 parent 9eaf819 commit d3b6135
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 2 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Config struct {
FriendAddPolicy string
TokenFile string
DeviceFile string
Proxy string
}

var (
Expand All @@ -35,6 +36,7 @@ func init() {
FriendAddPolicy: os.Getenv("QQ_CHAT_GPT_POLICY"),
TokenFile: "qq.token",
DeviceFile: "device.json",
Proxy: os.Getenv("QQ_PROXY"),
}
qq, err := strconv.ParseInt(os.Getenv("QQ_UIN"), 10, 64)
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/Baozisoftware/qrcode-terminal-go v0.0.0-20170407111555-c0650d8dff0f
github.com/Mrs4s/MiraiGo v0.0.0-20221206193101-cf66e2864798
github.com/tuotoo/qrcode v0.0.0-20220425170535-52ccc2bebf5d
github.com/yxw21/chatgpt v0.8.0
github.com/yxw21/chatgpt v0.9.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ github.com/ulikunitz/xz v0.5.9 h1:RsKRIA2MO8x56wkkcd3LbtcE/uMszhb6DpRf+3uwa3I=
github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos=
github.com/yxw21/chatgpt v0.8.0 h1:rCfYKcdR3vvaYUN12xpbuAJKHWfLEtw/ksnivEswZ2c=
github.com/yxw21/chatgpt v0.8.0/go.mod h1:40HZqYFtcZoUNXsG0LKCgzea+KHdW1XJ7MnVvhFm8z4=
github.com/yxw21/chatgpt v0.9.0 h1:QVAbgT1EBGSY6Z0j+cV265A/t7ZtYNwFms8+GqaSJGk=
github.com/yxw21/chatgpt v0.9.0/go.mod h1:40HZqYFtcZoUNXsG0LKCgzea+KHdW1XJ7MnVvhFm8z4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db h1:D/cFflL63o2KSLJIwjlcIt8PR064j/xsmdEJL/YvY/o=
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
Expand Down
5 changes: 4 additions & 1 deletion qqchatgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ func main() {
qq *client.QQClient
err error
)
browser, closeBrowser, err := chatgpt.NewBrowser(config.Instance.Key)
browser, closeBrowser, err := chatgpt.NewBrowser(chatgpt.BrowserOptions{
ExtensionKey: config.Instance.Key,
Proxy: config.Instance.Proxy,
})
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit d3b6135

Please sign in to comment.