feat: update

This commit is contained in:
Rogee
2024-09-04 11:46:58 +08:00
parent 676b31bed3
commit a035a63f52
8 changed files with 154 additions and 12 deletions

View File

@@ -5,6 +5,8 @@ import (
"mime"
"os"
"exporter/pkg/errorx"
"github.com/dustin/go-humanize"
"github.com/gotd/td/telegram/downloader"
"github.com/gotd/td/tg"
@@ -35,7 +37,7 @@ func (t *TClient) Channel(ctx context.Context, channel *tg.Channel, cfg *DBChann
}
if len(messages.(*tg.MessagesChannelMessages).GetMessages()) == 0 {
logger.Info("no new message", zap.Int64("channel", channel.ID))
return errors.New("no new message")
return errorx.ErrNoNewMessage
}
for _, item := range messages.(*tg.MessagesChannelMessages).GetMessages() {