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 MessagesDeleteParticipantReactionRequest struct {
Peer InputPeerClass
MsgID int
Participant InputPeerClass
}
const MessagesDeleteParticipantReactionRequestTypeID = 0xe3b7f82c
var (
_ bin .Encoder = &MessagesDeleteParticipantReactionRequest {}
_ bin .Decoder = &MessagesDeleteParticipantReactionRequest {}
_ bin .BareEncoder = &MessagesDeleteParticipantReactionRequest {}
_ bin .BareDecoder = &MessagesDeleteParticipantReactionRequest {}
)
func (d *MessagesDeleteParticipantReactionRequest ) Zero () bool {
if d == nil {
return true
}
if !(d .Peer == nil ) {
return false
}
if !(d .MsgID == 0 ) {
return false
}
if !(d .Participant == nil ) {
return false
}
return true
}
func (d *MessagesDeleteParticipantReactionRequest ) String () string {
if d == nil {
return "MessagesDeleteParticipantReactionRequest(nil)"
}
type Alias MessagesDeleteParticipantReactionRequest
return fmt .Sprintf ("MessagesDeleteParticipantReactionRequest%+v" , Alias (*d ))
}
func (d *MessagesDeleteParticipantReactionRequest ) FillFrom (from interface {
GetPeer () (value InputPeerClass )
GetMsgID () (value int )
GetParticipant () (value InputPeerClass )
}) {
d .Peer = from .GetPeer ()
d .MsgID = from .GetMsgID ()
d .Participant = from .GetParticipant ()
}
func (*MessagesDeleteParticipantReactionRequest ) TypeID () uint32 {
return MessagesDeleteParticipantReactionRequestTypeID
}
func (*MessagesDeleteParticipantReactionRequest ) TypeName () string {
return "messages.deleteParticipantReaction"
}
func (d *MessagesDeleteParticipantReactionRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.deleteParticipantReaction" ,
ID : MessagesDeleteParticipantReactionRequestTypeID ,
}
if d == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Peer" ,
SchemaName : "peer" ,
},
{
Name : "MsgID" ,
SchemaName : "msg_id" ,
},
{
Name : "Participant" ,
SchemaName : "participant" ,
},
}
return typ
}
func (d *MessagesDeleteParticipantReactionRequest ) Encode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deleteParticipantReaction#e3b7f82c as nil" )
}
b .PutID (MessagesDeleteParticipantReactionRequestTypeID )
return d .EncodeBare (b )
}
func (d *MessagesDeleteParticipantReactionRequest ) EncodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't encode messages.deleteParticipantReaction#e3b7f82c as nil" )
}
if d .Peer == nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReaction#e3b7f82c: field peer is nil" )
}
if err := d .Peer .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReaction#e3b7f82c: field peer: %w" , err )
}
b .PutInt (d .MsgID )
if d .Participant == nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReaction#e3b7f82c: field participant is nil" )
}
if err := d .Participant .Encode (b ); err != nil {
return fmt .Errorf ("unable to encode messages.deleteParticipantReaction#e3b7f82c: field participant: %w" , err )
}
return nil
}
func (d *MessagesDeleteParticipantReactionRequest ) Decode (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deleteParticipantReaction#e3b7f82c to nil" )
}
if err := b .ConsumeID (MessagesDeleteParticipantReactionRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.deleteParticipantReaction#e3b7f82c: %w" , err )
}
return d .DecodeBare (b )
}
func (d *MessagesDeleteParticipantReactionRequest ) DecodeBare (b *bin .Buffer ) error {
if d == nil {
return fmt .Errorf ("can't decode messages.deleteParticipantReaction#e3b7f82c to nil" )
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.deleteParticipantReaction#e3b7f82c: field peer: %w" , err )
}
d .Peer = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.deleteParticipantReaction#e3b7f82c: field msg_id: %w" , err )
}
d .MsgID = value
}
{
value , err := DecodeInputPeer (b )
if err != nil {
return fmt .Errorf ("unable to decode messages.deleteParticipantReaction#e3b7f82c: field participant: %w" , err )
}
d .Participant = value
}
return nil
}
func (d *MessagesDeleteParticipantReactionRequest ) GetPeer () (value InputPeerClass ) {
if d == nil {
return
}
return d .Peer
}
func (d *MessagesDeleteParticipantReactionRequest ) GetMsgID () (value int ) {
if d == nil {
return
}
return d .MsgID
}
func (d *MessagesDeleteParticipantReactionRequest ) GetParticipant () (value InputPeerClass ) {
if d == nil {
return
}
return d .Participant
}
func (c *Client ) MessagesDeleteParticipantReaction (ctx context .Context , request *MessagesDeleteParticipantReactionRequest ) (UpdatesClass , error ) {
var result UpdatesBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Updates , 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 .