add pre group one bot setting
This commit is contained in:
+14
-1
@@ -27,7 +27,20 @@ func PushLineMessage(c *context.Context) {
|
||||
textObj := line.TextMessage{}
|
||||
textObj.Text = bodyData.Message
|
||||
|
||||
line.PushMessage(bodyData.Group, textObj)
|
||||
group, err := model.GetLineGroup(bodyData.Group)
|
||||
if err != nil {
|
||||
c.ServerError(nil)
|
||||
log.Println("get group :: ", err)
|
||||
return
|
||||
}
|
||||
bot, err := group.GetBot()
|
||||
if err != nil || bot == nil {
|
||||
log.Println("get group binding bot fail :: ", err)
|
||||
c.ServerError(nil)
|
||||
return
|
||||
}
|
||||
|
||||
line.PushMessage(bot.AccessToken, bodyData.Group, textObj)
|
||||
|
||||
c.Success(nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user