Skip to content

Commit

Permalink
print bad msg
Browse files Browse the repository at this point in the history
  • Loading branch information
boypt committed Dec 25, 2019
1 parent ab5c5c3 commit 541cfd9
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bot/service.go
Expand Up @@ -122,7 +122,16 @@ func BroadNews(source *model.Source, subs []model.Subscribe, contents []model.Co
log.Println(err)
if strings.Contains(err.Error(), "Forbidden") {
log.Printf("Unsubscribe UserID:%d SourceID:%d", sub.UserID, sub.SourceID)
_ = sub.Unsub()
sub.Unsub()
}

/*
Telegram return error if markdown message has incomplete format.
Print the msg to warn the user
api error: Bad Request: can't parse entities: Can't find end of the entity starting at byte offset 894
*/
if strings.Contains(err.Error(), "parse entities") {
log.Println("Markdown Err: ", msg)
}
}
}
Expand Down

0 comments on commit 541cfd9

Please sign in to comment.