Skip to content

Commit

Permalink
add ctx.TransferStarGift
Browse files Browse the repository at this point in the history
  • Loading branch information
celestix committed Jan 15, 2025
1 parent 6a31da5 commit 3145a86
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -813,3 +813,21 @@ func (ctx *Context) DownloadMedia(media tg.MessageMediaClass, downloadOutput Dow
}
return downloadOutput.run(ctx, d)
}

func (ctx *Context) TransferStarGift(msgId int, toId int64) (tg.UpdatesClass, error) {
peerUser := ctx.PeerStorage.GetPeerById(toId)
if peerUser == nil {
return nil, mtp_errors.ErrPeerNotFound
}
upd, err := ctx.Raw.PaymentsTransferStarGift(ctx, &tg.PaymentsTransferStarGiftRequest{
MsgID: msgId,
ToID: &tg.InputUser{
UserID: peerUser.ID,
AccessHash: peerUser.AccessHash,
},
})
if err != nil {
return nil, err
}
return upd, err
}

0 comments on commit 3145a86

Please sign in to comment.