new file: .env
new file: bot.db new file: db/db.go new file: go.mod new file: go.sum new file: handlers/dashboard.go new file: handlers/webhook.go new file: main.go new file: services/openrouter.go new file: services/whatsapp.go new file: templates/dashboard.html new file: types/types.go
This commit is contained in:
25
handlers/webhook.go
Normal file
25
handlers/webhook.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// Meta verification
|
||||
func VerifyWebhook(c *gin.Context) {
|
||||
challenge := c.Query("hub.challenge")
|
||||
token := c.Query("hub.verify_token")
|
||||
|
||||
if token == "YOUR_SECRET_TOKEN" {
|
||||
c.String(http.StatusOK, challenge)
|
||||
} else {
|
||||
c.Status(http.StatusForbidden)
|
||||
}
|
||||
}
|
||||
|
||||
func HandleMessage(c *gin.Context) {
|
||||
// You should bind your WhatsApp types here
|
||||
// go services.Process(...)
|
||||
c.Status(http.StatusOK)
|
||||
}
|
||||
Reference in New Issue
Block a user