Handle nil message (telegram). Fixes #777

This commit is contained in:
Wim 2019-04-05 00:04:08 +02:00
parent 8cc2d3b4fe
commit 01d0a9f412

View File

@ -125,6 +125,11 @@ func (b *Btelegram) handleRecv(updates <-chan tgbotapi.Update) {
// handle groups
message = b.handleGroups(&rmsg, message, update)
if message == nil {
b.Log.Error("message is nil, this shouldn't happen.")
continue
}
// set the ID's from the channel or group message
rmsg.ID = strconv.Itoa(message.MessageID)
rmsg.Channel = strconv.FormatInt(message.Chat.ID, 10)