fix: add channel
This commit is contained in:
@@ -20,14 +20,16 @@ import (
|
||||
func (t *TClient) Channel(ctx context.Context, channel *tg.Channel, cfg *DBChannel, onlyAddChannel bool) error {
|
||||
inputPeer := &tg.InputPeerChannel{ChannelID: channel.ID, AccessHash: channel.AccessHash}
|
||||
|
||||
limit := 50
|
||||
request := &tg.MessagesGetHistoryRequest{
|
||||
Peer: inputPeer,
|
||||
Limit: limit,
|
||||
Limit: 10,
|
||||
}
|
||||
|
||||
request.OffsetID = cfg.MinID + limit
|
||||
request.MinID = cfg.MinID
|
||||
if !onlyAddChannel {
|
||||
request.Limit = 50
|
||||
request.OffsetID = cfg.MinID + request.Limit
|
||||
request.MinID = cfg.MinID
|
||||
}
|
||||
|
||||
logger.Info("get channel message history", zap.Int("min_id", request.MinID), zap.Int("offset", request.OffsetID), zap.Int("limit", request.Limit))
|
||||
history, err := t.Client.API().MessagesGetHistory(ctx, request)
|
||||
|
||||
Reference in New Issue
Block a user