Skip to content

Commit 3145a86

Browse files
committed
add ctx.TransferStarGift
1 parent 6a31da5 commit 3145a86

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ext/context.go

+18
Original file line numberDiff line numberDiff line change
@@ -813,3 +813,21 @@ func (ctx *Context) DownloadMedia(media tg.MessageMediaClass, downloadOutput Dow
813813
}
814814
return downloadOutput.run(ctx, d)
815815
}
816+
817+
func (ctx *Context) TransferStarGift(msgId int, toId int64) (tg.UpdatesClass, error) {
818+
peerUser := ctx.PeerStorage.GetPeerById(toId)
819+
if peerUser == nil {
820+
return nil, mtp_errors.ErrPeerNotFound
821+
}
822+
upd, err := ctx.Raw.PaymentsTransferStarGift(ctx, &tg.PaymentsTransferStarGiftRequest{
823+
MsgID: msgId,
824+
ToID: &tg.InputUser{
825+
UserID: peerUser.ID,
826+
AccessHash: peerUser.AccessHash,
827+
},
828+
})
829+
if err != nil {
830+
return nil, err
831+
}
832+
return upd, err
833+
}

0 commit comments

Comments
 (0)