1
0
Fork 0

Added WebhookInfo utils

This commit is contained in:
Maxim Lebedev 2019-03-14 14:06:59 +05:00
parent b3f324e1b3
commit 6f7a4c9645
No known key found for this signature in database
GPG Key ID: F8978F46FF0FFA4F
1 changed files with 16 additions and 0 deletions

16
utils_webhook_info.go Normal file
View File

@ -0,0 +1,16 @@
package telegram
import "time"
func (wi *WebhookInfo) HasURL() bool {
return wi != nil && wi.URL != ""
}
func (wi *WebhookInfo) LastErrorTime() *time.Time {
if wi == nil {
return nil
}
led := time.Unix(wi.LastErrorDate, 0)
return &led
}