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 MessagesEmojiGameOutcome struct {
Seed []byte
StakeTonAmount int64
TonAmount int64
}
const MessagesEmojiGameOutcomeTypeID = 0xda2ad647
var (
_ bin .Encoder = &MessagesEmojiGameOutcome {}
_ bin .Decoder = &MessagesEmojiGameOutcome {}
_ bin .BareEncoder = &MessagesEmojiGameOutcome {}
_ bin .BareDecoder = &MessagesEmojiGameOutcome {}
)
func (e *MessagesEmojiGameOutcome ) Zero () bool {
if e == nil {
return true
}
if !(e .Seed == nil ) {
return false
}
if !(e .StakeTonAmount == 0 ) {
return false
}
if !(e .TonAmount == 0 ) {
return false
}
return true
}
func (e *MessagesEmojiGameOutcome ) String () string {
if e == nil {
return "MessagesEmojiGameOutcome(nil)"
}
type Alias MessagesEmojiGameOutcome
return fmt .Sprintf ("MessagesEmojiGameOutcome%+v" , Alias (*e ))
}
func (e *MessagesEmojiGameOutcome ) FillFrom (from interface {
GetSeed () (value []byte )
GetStakeTonAmount () (value int64 )
GetTonAmount () (value int64 )
}) {
e .Seed = from .GetSeed ()
e .StakeTonAmount = from .GetStakeTonAmount ()
e .TonAmount = from .GetTonAmount ()
}
func (*MessagesEmojiGameOutcome ) TypeID () uint32 {
return MessagesEmojiGameOutcomeTypeID
}
func (*MessagesEmojiGameOutcome ) TypeName () string {
return "messages.emojiGameOutcome"
}
func (e *MessagesEmojiGameOutcome ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.emojiGameOutcome" ,
ID : MessagesEmojiGameOutcomeTypeID ,
}
if e == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Seed" ,
SchemaName : "seed" ,
},
{
Name : "StakeTonAmount" ,
SchemaName : "stake_ton_amount" ,
},
{
Name : "TonAmount" ,
SchemaName : "ton_amount" ,
},
}
return typ
}
func (e *MessagesEmojiGameOutcome ) Encode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode messages.emojiGameOutcome#da2ad647 as nil" )
}
b .PutID (MessagesEmojiGameOutcomeTypeID )
return e .EncodeBare (b )
}
func (e *MessagesEmojiGameOutcome ) EncodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't encode messages.emojiGameOutcome#da2ad647 as nil" )
}
b .PutBytes (e .Seed )
b .PutLong (e .StakeTonAmount )
b .PutLong (e .TonAmount )
return nil
}
func (e *MessagesEmojiGameOutcome ) Decode (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode messages.emojiGameOutcome#da2ad647 to nil" )
}
if err := b .ConsumeID (MessagesEmojiGameOutcomeTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.emojiGameOutcome#da2ad647: %w" , err )
}
return e .DecodeBare (b )
}
func (e *MessagesEmojiGameOutcome ) DecodeBare (b *bin .Buffer ) error {
if e == nil {
return fmt .Errorf ("can't decode messages.emojiGameOutcome#da2ad647 to nil" )
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode messages.emojiGameOutcome#da2ad647: field seed: %w" , err )
}
e .Seed = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.emojiGameOutcome#da2ad647: field stake_ton_amount: %w" , err )
}
e .StakeTonAmount = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode messages.emojiGameOutcome#da2ad647: field ton_amount: %w" , err )
}
e .TonAmount = value
}
return nil
}
func (e *MessagesEmojiGameOutcome ) GetSeed () (value []byte ) {
if e == nil {
return
}
return e .Seed
}
func (e *MessagesEmojiGameOutcome ) GetStakeTonAmount () (value int64 ) {
if e == nil {
return
}
return e .StakeTonAmount
}
func (e *MessagesEmojiGameOutcome ) GetTonAmount () (value int64 ) {
if e == nil {
return
}
return e .TonAmount
}
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 .