Skip to content

Commit

Permalink
chore(util): error message
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Dec 6, 2022
1 parent ada1ead commit c262778
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/utils/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,18 @@ func (t telegram) GetInputPeer(ctx context.Context, manager *peers.Manager, from
return p, nil
}

if p, err := manager.ResolveChannelID(ctx, id); err == nil {
var p peers.Peer
if p, err = manager.ResolveChannelID(ctx, id); err == nil {
return p, nil
}

if p, err := manager.ResolveUserID(ctx, id); err == nil {
if p, err = manager.ResolveUserID(ctx, id); err == nil {
return p, nil
}

if p, err := manager.ResolveChatID(ctx, id); err == nil {
if p, err = manager.ResolveChatID(ctx, id); err == nil {
return p, nil
}

return nil, fmt.Errorf("failed to get result from %d", id)
return nil, fmt.Errorf("failed to get result from %d:%v", id, err)
}

func (t telegram) GetPeerID(peer tg.PeerClass) int64 {
Expand Down

0 comments on commit c262778

Please sign in to comment.