diff --git a/apis/index.go b/apis/index.go index 95902ce..a9d64bc 100644 --- a/apis/index.go +++ b/apis/index.go @@ -157,6 +157,7 @@ func SendMediaFileWithBase64(c *fiber.Ctx) error { func SendMessage(c *fiber.Ctx) error { body := new(apiSendMessage) c.BodyParser(body) + if err := utility.ValidateReqInput(body); err != nil { return err } diff --git a/main.go b/main.go index 04fa100..b22cbb0 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,6 @@ package main import ( - "bufio" "encoding/json" "errors" "fmt" @@ -27,13 +26,13 @@ var app *fiber.App func main() { println(version) - if time.Now().Unix() > 1719562963 { - println("Please Update The Binary From Keyur Shah") - println("Press Any Key To Close") - input := bufio.NewScanner(os.Stdin) - input.Scan() - return - } + // if time.Now().Unix() > 1719562963 { + // println("Please Update The Binary From Keyur Shah") + // println("Press Any Key To Close") + // input := bufio.NewScanner(os.Stdin) + // input.Scan() + // return + // } env.CurrentDirectory = FindAndReturnCurrentDir() go func() { diff --git a/whatsapp/interfaces.go b/whatsapp/interfaces.go index 423f3bc..50ce99e 100644 --- a/whatsapp/interfaces.go +++ b/whatsapp/interfaces.go @@ -290,10 +290,14 @@ func (connection *WhatsappConnection) sendMediaFile(to []string, fileByte []byte FileLength: &resp.FileLength, }, } + println("finished uploading") if strings.Contains(extensionName, "pdf") { + println("PDF to thumb") thumb, err := utility.ExtractFirstPage(fileByte) - if err != nil && len(thumb) > 0 { + if err == nil && len(thumb) > 0 { docProto.DocumentMessage.JpegThumbnail = thumb + } else { + println(err.Error()) } } }