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 MessagesGetRecentReactionsRequest struct {
Limit int
Hash int64
}
const MessagesGetRecentReactionsRequestTypeID = 0x39461db2
var (
_ bin .Encoder = &MessagesGetRecentReactionsRequest {}
_ bin .Decoder = &MessagesGetRecentReactionsRequest {}
_ bin .BareEncoder = &MessagesGetRecentReactionsRequest {}
_ bin .BareDecoder = &MessagesGetRecentReactionsRequest {}
)
func (g *MessagesGetRecentReactionsRequest ) Zero () bool {
if g == nil {
return true
}
if !(g .Limit == 0 ) {
return false
}
if !(g .Hash == 0 ) {
return false
}
return true
}
func (g *MessagesGetRecentReactionsRequest ) String () string {
if g == nil {
return "MessagesGetRecentReactionsRequest(nil)"
}
type Alias MessagesGetRecentReactionsRequest
return fmt .Sprintf ("MessagesGetRecentReactionsRequest%+v" , Alias (*g ))
}
func (g *MessagesGetRecentReactionsRequest ) FillFrom (from interface {
GetLimit () (value int )
GetHash () (value int64 )
}) {
g .Limit = from .GetLimit ()
g .Hash = from .GetHash ()
}
func (*MessagesGetRecentReactionsRequest ) TypeID () uint32 {
return MessagesGetRecentReactionsRequestTypeID
}
func (*MessagesGetRecentReactionsRequest ) TypeName () string {
return "messages.getRecentReactions"
}
func (g *MessagesGetRecentReactionsRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.getRecentReactions" ,
ID : MessagesGetRecentReactionsRequestTypeID ,
}
if g == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Limit" ,
SchemaName : "limit" ,
},
{
Name : "Hash" ,
SchemaName : "hash" ,
},
}
return typ
}
func (g *MessagesGetRecentReactionsRequest ) Encode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getRecentReactions#39461db2 as nil" )
}
b .PutID (MessagesGetRecentReactionsRequestTypeID )
return g .EncodeBare (b )
}
func (g *MessagesGetRecentReactionsRequest ) EncodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't encode messages.getRecentReactions#39461db2 as nil" )
}
b .PutInt (g .Limit )
b .PutLong (g .Hash )
return nil
}
func (g *MessagesGetRecentReactionsRequest ) Decode (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getRecentReactions#39461db2 to nil" )
}
if err := b .ConsumeID (MessagesGetRecentReactionsRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.getRecentReactions#39461db2: %w" , err )
}
return g .DecodeBare (b )
}
func (g *MessagesGetRecentReactionsRequest ) DecodeBare (b *bin .Buffer ) error {
if g == nil {
return fmt .Errorf ("can't decode messages.getRecentReactions#39461db2 to nil" )
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getRecentReactions#39461db2: field limit: %w" , err )
}
g .Limit = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.getRecentReactions#39461db2: field hash: %w" , err )
}
g .Hash = value
}
return nil
}
func (g *MessagesGetRecentReactionsRequest ) GetLimit () (value int ) {
if g == nil {
return
}
return g .Limit
}
func (g *MessagesGetRecentReactionsRequest ) GetHash () (value int64 ) {
if g == nil {
return
}
return g .Hash
}
func (c *Client ) MessagesGetRecentReactions (ctx context .Context , request *MessagesGetRecentReactionsRequest ) (MessagesReactionsClass , error ) {
var result MessagesReactionsBox
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .Reactions , nil
}
The pages are generated with Golds v0.6.7 . (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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds .