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
| Name | Type | Required | Description |
|---|---|---|---|
Ton | bool | — | If set, returns the channel/ad revenue balance in nanotons. |
Peer | InputPeerClass | yes | Peer of which to get the balance. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 403 | BOT_ACCESS_FORBIDDEN | The 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. |
| 400 | BUSINESS_CONNECTION_INVALID | The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
payments.getStarsStatus#4ea9b3bf