Cleaned up some possible bugs

This commit is contained in:
Atridad Lahiji 2024-01-07 14:31:10 -07:00
parent d23e5cea74
commit 929214e4dd
No known key found for this signature in database
3 changed files with 5 additions and 3 deletions

2
go.mod
View file

@ -6,7 +6,7 @@ require github.com/diamondburned/arikawa/v3 v3.3.4
require (
golang.org/x/net v0.19.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sync v0.6.0 // indirect
)
require (

2
go.sum
View file

@ -33,6 +33,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View file

@ -235,13 +235,13 @@ func (h *handler) cmdPic(ctx context.Context, data cmdroute.CommandData) *api.In
test, ok := prediction.([]interface{})
if !ok {
fmt.Println("prediction is not []interface{}")
return errorResponse(errors.New("prediction is not []interface{}"))
}
imgUrl, ok := test[0].(string)
if !ok {
fmt.Println("prediction.Output[0] is not a string")
return errorResponse(errors.New("prediction.Output[0] is not a string"))
}
imageRes, imageGetErr := http.Get(imgUrl)