Skip to main content

payments.getStarsStatus

Get the current Telegram Stars balance of the current account (with peer=inputPeerSelf), or the stars balance of the bot or channel specified in peer.

func (c *Client) PaymentsGetStarsStatus(ctx context.Context, request *PaymentsGetStarsStatusRequest) (*PaymentsStarsStatus, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.PaymentsGetStarsStatus(ctx, &tg.PaymentsGetStarsStatusRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // *PaymentsStarsStatus
return nil
})

Parameters

NameTypeRequiredDescription
TonboolIf set, returns the channel/ad revenue balance in nanotons.
PeerInputPeerClassyesPeer of which to get the balance.

Returns

*PaymentsStarsStatus

Possible errors

CodeTypeDescription
403BOT_ACCESS_FORBIDDENThe specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection.
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.

References