package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type MessagesDeleteParticipantReactionsRequest struct {
Peer InputPeerClass
Participant InputPeerClass
}
const MessagesDeleteParticipantReactionsRequestTypeID = 0xa0b80cf8
var (
_ bin .Encoder = &MessagesDeleteParticipantReactionsRequest {}
_ bin .Decoder = &MessagesDeleteParticipantReactionsRequest {}
_ bin .BareEncoder = &MessagesDeleteParticipantReactionsRequest {}
_ bin .BareDecoder = &MessagesDeleteParticipantReactionsRequest {}
)
func (d *MessagesDeleteParticipantReactionsRequest ) Zero () bool {
if d == nil {
return true
}
if !(d .Peer == nil ) {
return false
}
if !(d .Participant == nil ) {
return false
}
return true
}
func (d *MessagesDeleteParticipantReactionsRequest ) String () string {
if d == nil {
return "MessagesDeleteParticipantReactionsRequest(nil)"
}
type Alias MessagesDeleteParticipantReactionsRequest
return fmt .Sprintf ("MessagesDeleteParticipantReactionsRequest%+v" , Alias (*d ))
}
func (d *MessagesDeleteParticipantReactionsRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetParticipant () (value InputPeerClass )
}) {
d .Peer = from .GetPeer ()
d .Participant = from .GetParticipant ()
}
func (*MessagesDeleteParticipantReactionsRequest ) TypeID () uint32 {
return MessagesDeleteParticipantReactionsRequestTypeID
}
func (*MessagesDeleteParticipantReactionsRequest ) TypeName () string {
return "messages.deleteParticipantReactions"
}
func (d *MessagesDeleteParticipantReactionsRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.deleteParticipantReactions" ,
ID : MessagesDeleteParticipantReactionsRequestTypeID ,
}
if d == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "Participant" ,
SchemaName : "participant" ,
},
}
return typ
}
func (d *MessagesDeleteParticipantReactionsRequest ) Encode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deleteParticipantReactions#a0b80cf8 as nil" )
}
b .PutID (MessagesDeleteParticipantReactionsRequestTypeID )
return d .EncodeBare (b )
}
func (d *MessagesDeleteParticipantReactionsRequest ) EncodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deleteParticipantReactions#a0b80cf8 as nil" )
}
if d .Peer == nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReactions#a0b80cf8: field peer is nil" )
}
if err := d .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReactions#a0b80cf8: field peer: %w" , err )
}
if d .Participant == nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReactions#a0b80cf8: field participant is nil" )
}
if err := d .Participant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReactions#a0b80cf8: field participant: %w" , err )
}
return nil
}
func (d *MessagesDeleteParticipantReactionsRequest ) Decode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deleteParticipantReactions#a0b80cf8 to nil" )
}
if err := b .ConsumeID (MessagesDeleteParticipantReactionsRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.deleteParticipantReactions#a0b80cf8: %w" , err )
}
return d .DecodeBare (b )
}
func (d *MessagesDeleteParticipantReactionsRequest ) DecodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deleteParticipantReactions#a0b80cf8 to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.deleteParticipantReactions#a0b80cf8: field peer: %w" , err )
}
d .Peer = value
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.deleteParticipantReactions#a0b80cf8: field participant: %w" , err )
}
d .Participant = value
}
return nil
}
func (d *MessagesDeleteParticipantReactionsRequest ) GetPeer () (value InputPeerClass ) {
if d == nil {
return
}
return d .Peer
}
func (d *MessagesDeleteParticipantReactionsRequest ) GetParticipant () (value InputPeerClass ) {
if d == nil {
return
}
return d .Participant
}
func (c *Client ) MessagesDeleteParticipantReactions (ctx context .Context , request *MessagesDeleteParticipantReactionsRequest ) (bool , error ) {
var result BoolBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return false , err
}
_ , ok := result .Bool .(*BoolTrue )
return ok , nil
}
The pages are generated with Golds v0.8.4 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .