This commit is contained in:
cangui 2025-05-11 10:06:12 +02:00
parent dac3592e2a
commit 8da353545e
2 changed files with 7 additions and 7 deletions

View File

@ -216,7 +216,7 @@ func WebhookHandler(db *gorm.DB) http.HandlerFunc {
MessageID: msgID, MessageID: msgID,
Type: typeMsg, Type: typeMsg,
Content: content, Content: content,
Direction: "inbound", Direction: "Entrant",
}) })
credit := MessageTypeCreditCost[typeMsg] credit := MessageTypeCreditCost[typeMsg]
@ -243,7 +243,7 @@ func extractMessageContent(m map[string]interface{}) string {
t := m["type"].(string) t := m["type"].(string)
switch t { switch t {
case "text": case "text":
return m["text"].(map[string]interface{})["body"].(string) return m["Message reçu"].(map[string]interface{})["body"].(string)
case "image", "video", "audio", "document", "sticker": case "image", "video", "audio", "document", "sticker":
return m[t].(map[string]interface{})["id"].(string) return m[t].(map[string]interface{})["id"].(string)
case "interactive": case "interactive":
@ -523,8 +523,8 @@ func HandleTemplateTest(db *gorm.DB) http.HandlerFunc {
MessageID: messageID, MessageID: messageID,
Type: "template", Type: "template",
Content: description, Content: description,
Direction: "outbound", Direction: "Sortant",
Status: "sent", Status: "Envoyé",
}) })
w.WriteHeader(resp.StatusCode) w.WriteHeader(resp.StatusCode)

View File

@ -6,9 +6,9 @@
{{ if eq .User.Role "ADMIN" }} {{ if eq .User.Role "ADMIN" }}
<li><a href="/admin/user">👤 Utilisateurs</a></li> <li><a href="/admin/user">👤 Utilisateurs</a></li>
<li><a href="/test/send">📤 Test envoi</a></li> <!-- <li><a href="/test/send">📤 Test envoi</a></li> -->
<li><a href="/test/send2">📤 Test envoi template</a></li> <li><a href="/test/send2">📤 Test envoi via un template</a></li>
<li><a href="/apidoc">Api doc </a></li> <li><a href="/apidoc">📚 API Doc</a></li>
{{ end }} {{ end }}