Skip to content

Commit

Permalink
💩 [Fix] for damo
Browse files Browse the repository at this point in the history
  • Loading branch information
Najah7 committed Oct 12, 2024
1 parent 3de8d76 commit 5fe8b7f
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pkg/handler/vonage.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,15 @@ func (v *VonageWebhook) Handle(c *gin.Context) {
}

userdata := model.User{}
doc, err := v.fs.Collection("users").
Where("phone_number", "==", req.PhoneNumber).
Documents(c).Next()
if err != nil {
c.JSON(500, gin.H{"error": err.Error()})
return
}
doc.DataTo(&userdata)

//気分: Feeling
//今日の通話のサマリー: TodayActivity
//伝言: Message

notifyText := "本日の通話が終了しました\n\n"
notifyText += fmt.Sprintf("気分: %s\n", req.Feeling)
notifyText += fmt.Sprintf("今日の通話のサマリー: %s\n", req.TodayActivity)
notifyText += fmt.Sprintf("伝言: %s\n", req.Message)
notifyText += fmt.Sprintf("気分: 元気\n")
notifyText += fmt.Sprintf("今日の通話のサマリー: 今日の朝おにぎりを食べた。\n")
notifyText += fmt.Sprintf("伝言: 今日はハッカソンに出てます。\n")

slog.Info("notifyText", slog.String("notifyText", notifyText))
if err := v.line.PushTextMessage(userdata.LINEID, notifyText); err != nil {
Expand Down

0 comments on commit 5fe8b7f

Please sign in to comment.