aboutsummaryrefslogtreecommitdiff
path: root/telegram/utils.go
diff options
context:
space:
mode:
authorBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-12 04:47:54 +0300
committerBohdan Horbeshko <bodqhrohro@gmail.com>2022-02-12 04:47:54 +0300
commite38f3897e63265aa497ea2767a662e5e40842301 (patch)
tree3a5bb4240a2ce3a4ebd18bf72502ba75dd624bf6 /telegram/utils.go
parentbc53a66b2ffc7863615d71a93ab210f8c3c0857e (diff)
Fix avatars losing && take care of avatar changes
Diffstat (limited to 'telegram/utils.go')
-rw-r--r--telegram/utils.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/telegram/utils.go b/telegram/utils.go
index da8d849..086b7ae 100644
--- a/telegram/utils.go
+++ b/telegram/utils.go
@@ -178,6 +178,12 @@ func (c *Client) ProcessStatusUpdate(chatID int64, status string, show string, o
var photo string
if chat != nil && chat.Photo != nil {
path := chat.Photo.Small.Local.Path
+ if path == "" {
+ tgFile, err := c.DownloadFile(chat.Photo.Small.Id, 1, true)
+ if err == nil {
+ path = tgFile.Local.Path
+ }
+ }
file, err := os.Open(path)
if err == nil {
defer file.Close()