Layer 220
AccountToggleNoPaidMessagesException
Allow a user to send us messages without paying if paid messages are enabled.
method
Users
account.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?true require_payment:flags.2?true parent_peer:flags.1?InputPeer user_id:InputUser = Bool;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| RefundCharged | flags.0?true | If set and require_payment is not set, refunds the amounts the user has already paid us to send us messages (directly or via a monoforum). |
| RequirePayment | flags.2?true | If set, requires the user to pay in order to send us messages. Can only be set by monoforums, not users, i. e. parent_peer must be set if this flag is set; users must instead use the input Privacy Key No Paid Messages privacy setting to remove a previously added exemption. If not set, allows the user to send us messages without paying (can be unset by both monoforums and users). |
| ParentPeer | flags.1?InputPeer | If set, applies the setting within the monoforum aka direct messages (pass the ID of the monoforum, not the ID of the associated channel). |
| UserId | InputUser | The user to exempt or unexempt. |
Returns
BoolPossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | PARENT_PEER_INVALID | The specified parent_peer is invalid. |
| 400 | UNSUPPORTED | require_payment cannot be set by users, only by monoforums: users must instead use the input Privacy Key No Paid Messages privacy setting to remove a previously added exemption. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
Gogram Example
// AccountToggleNoPaidMessagesException - using Params struct result, err := client.AccountToggleNoPaidMessagesException(&tg.AccountToggleNoPaidMessagesExceptionParams{ UserId: &tg.InputUserSelf{}, // Optional fields: // RefundCharged: true, // RequirePayment: true, // ParentPeer: &tg.InputPeerUser{UserID: int64(123456789)}, }) if err != nil { // handle error } // result is *tg.Bool