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 MessagesBotPreparedInlineMessage struct {
ID string
ExpireDate int
}
const MessagesBotPreparedInlineMessageTypeID = 0x8ecf0511
var (
_ bin .Encoder = &MessagesBotPreparedInlineMessage {}
_ bin .Decoder = &MessagesBotPreparedInlineMessage {}
_ bin .BareEncoder = &MessagesBotPreparedInlineMessage {}
_ bin .BareDecoder = &MessagesBotPreparedInlineMessage {}
)
func (b *MessagesBotPreparedInlineMessage ) Zero () bool {
if b == nil {
return true
}
if !(b .ID == "" ) {
return false
}
if !(b .ExpireDate == 0 ) {
return false
}
return true
}
func (b *MessagesBotPreparedInlineMessage ) String () string {
if b == nil {
return "MessagesBotPreparedInlineMessage(nil)"
}
type Alias MessagesBotPreparedInlineMessage
return fmt .Sprintf ("MessagesBotPreparedInlineMessage%+v" , Alias (*b ))
}
func (b *MessagesBotPreparedInlineMessage ) FillFrom (from interface {
GetID () (value string )
GetExpireDate () (value int )
}) {
b .ID = from .GetID ()
b .ExpireDate = from .GetExpireDate ()
}
func (*MessagesBotPreparedInlineMessage ) TypeID () uint32 {
return MessagesBotPreparedInlineMessageTypeID
}
func (*MessagesBotPreparedInlineMessage ) TypeName () string {
return "messages.botPreparedInlineMessage"
}
func (b *MessagesBotPreparedInlineMessage ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.botPreparedInlineMessage" ,
ID : MessagesBotPreparedInlineMessageTypeID ,
}
if b == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "ID" ,
SchemaName : "id" ,
},
{
Name : "ExpireDate" ,
SchemaName : "expire_date" ,
},
}
return typ
}
func (b *MessagesBotPreparedInlineMessage ) Encode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode messages.botPreparedInlineMessage#8ecf0511 as nil" )
}
buf .PutID (MessagesBotPreparedInlineMessageTypeID )
return b .EncodeBare (buf )
}
func (b *MessagesBotPreparedInlineMessage ) EncodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't encode messages.botPreparedInlineMessage#8ecf0511 as nil" )
}
buf .PutString (b .ID )
buf .PutInt (b .ExpireDate )
return nil
}
func (b *MessagesBotPreparedInlineMessage ) Decode (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode messages.botPreparedInlineMessage#8ecf0511 to nil" )
}
if err := buf .ConsumeID (MessagesBotPreparedInlineMessageTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.botPreparedInlineMessage#8ecf0511: %w" , err )
}
return b .DecodeBare (buf )
}
func (b *MessagesBotPreparedInlineMessage ) DecodeBare (buf *bin .Buffer ) error {
if b == nil {
return fmt .Errorf ("can't decode messages.botPreparedInlineMessage#8ecf0511 to nil" )
}
{
value , err := buf .String ()
if err != nil {
return fmt .Errorf ("unable to decode messages.botPreparedInlineMessage#8ecf0511: field id: %w" , err )
}
b .ID = value
}
{
value , err := buf .Int ()
if err != nil {
return fmt .Errorf ("unable to decode messages.botPreparedInlineMessage#8ecf0511: field expire_date: %w" , err )
}
b .ExpireDate = value
}
return nil
}
func (b *MessagesBotPreparedInlineMessage ) GetID () (value string ) {
if b == nil {
return
}
return b .ID
}
func (b *MessagesBotPreparedInlineMessage ) GetExpireDate () (value int ) {
if b == nil {
return
}
return b .ExpireDate
}
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 .