Skip to content

Commit

Permalink
Add handling for "test" message in callbackHandler function
Browse files Browse the repository at this point in the history
  • Loading branch information
kkdai committed Jan 25, 2024
1 parent be8db15 commit 5c4d18d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ func callbackHandler(w http.ResponseWriter, r *http.Request) {
switch e := event.(type) {
case webhook.MessageEvent:
switch message := e.Message.(type) {

// Handle only on text message
case webhook.TextMessageContent:
if message.Text == "test" {
if err := SendFlexMsg(e.ReplyToken); err != nil {
log.Print(err)
}
continue
}

// 取得用戶 ID
var uID string
switch source := e.Source.(type) {
Expand Down

0 comments on commit 5c4d18d

Please sign in to comment.