fix: issues
This commit is contained in:
10
.vscode/launch.json
vendored
10
.vscode/launch.json
vendored
@@ -12,9 +12,13 @@
|
|||||||
"program": "${workspaceFolder}/main.go",
|
"program": "${workspaceFolder}/main.go",
|
||||||
"args": [
|
"args": [
|
||||||
"export",
|
"export",
|
||||||
"--alias",
|
// https://t.me/yunpanshare/26640
|
||||||
"yunpanshare",
|
// "--alias", "yunpanshare",
|
||||||
// "--history",
|
// https://t.me/Aliyun_4K_Movies/26640
|
||||||
|
// "--alias", "Aliyun_4K_Movies",
|
||||||
|
// https://t.me/abskoop/8501
|
||||||
|
"--alias", "abskoop",
|
||||||
|
"--history",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -61,6 +61,16 @@ func (t *TClient) Channel(ctx context.Context, channel *tg.Channel, cfg *DBChann
|
|||||||
channelMessage.WithMessage(msg.GetMessage())
|
channelMessage.WithMessage(msg.GetMessage())
|
||||||
|
|
||||||
if mediaClass, ok := msg.GetMedia(); ok {
|
if mediaClass, ok := msg.GetMedia(); ok {
|
||||||
|
switch mediaClass.(type) {
|
||||||
|
case *tg.MessageMediaDocument:
|
||||||
|
if doc, ok := mediaClass.(*tg.MessageMediaDocument).GetDocument(); ok {
|
||||||
|
t.logger.Warn("document", zap.String("file_name", doc.String()))
|
||||||
|
}
|
||||||
|
return
|
||||||
|
case *tg.MessageMediaWebPage:
|
||||||
|
t.logger.Warn("web_page", zap.String("url", mediaClass.(*tg.MessageMediaWebPage).GetWebpage().String()))
|
||||||
|
return
|
||||||
|
case *tg.MessageMediaPhoto:
|
||||||
if photoClass, ok := mediaClass.(*tg.MessageMediaPhoto).GetPhoto(); ok {
|
if photoClass, ok := mediaClass.(*tg.MessageMediaPhoto).GetPhoto(); ok {
|
||||||
photo := photoClass.(*tg.Photo)
|
photo := photoClass.(*tg.Photo)
|
||||||
|
|
||||||
@@ -86,6 +96,7 @@ func (t *TClient) Channel(ctx context.Context, channel *tg.Channel, cfg *DBChann
|
|||||||
t.logger.Info("download photo success", zap.String("location", saveTo))
|
t.logger.Info("download photo success", zap.String("location", saveTo))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user