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 MessagesCheckChatInviteRequest struct {
Hash string
}
const MessagesCheckChatInviteRequestTypeID = 0x3eadb1bb
var (
_ bin .Encoder = &MessagesCheckChatInviteRequest {}
_ bin .Decoder = &MessagesCheckChatInviteRequest {}
_ bin .BareEncoder = &MessagesCheckChatInviteRequest {}
_ bin .BareDecoder = &MessagesCheckChatInviteRequest {}
)
func (c *MessagesCheckChatInviteRequest ) Zero () bool {
if c == nil {
return true
}
if !(c .Hash == "" ) {
return false
}
return true
}
func (c *MessagesCheckChatInviteRequest ) String () string {
if c == nil {
return "MessagesCheckChatInviteRequest(nil)"
}
type Alias MessagesCheckChatInviteRequest
return fmt .Sprintf ("MessagesCheckChatInviteRequest%+v" , Alias (*c ))
}
func (c *MessagesCheckChatInviteRequest ) FillFrom (from interface {
GetHash () (value string )
}) {
c .Hash = from .GetHash ()
}
func (*MessagesCheckChatInviteRequest ) TypeID () uint32 {
return MessagesCheckChatInviteRequestTypeID
}
func (*MessagesCheckChatInviteRequest ) TypeName () string {
return "messages.checkChatInvite"
}
func (c *MessagesCheckChatInviteRequest ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "messages.checkChatInvite" ,
ID : MessagesCheckChatInviteRequestTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Hash" ,
SchemaName : "hash" ,
},
}
return typ
}
func (c *MessagesCheckChatInviteRequest ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.checkChatInvite#3eadb1bb as nil" )
}
b .PutID (MessagesCheckChatInviteRequestTypeID )
return c .EncodeBare (b )
}
func (c *MessagesCheckChatInviteRequest ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode messages.checkChatInvite#3eadb1bb as nil" )
}
b .PutString (c .Hash )
return nil
}
func (c *MessagesCheckChatInviteRequest ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.checkChatInvite#3eadb1bb to nil" )
}
if err := b .ConsumeID (MessagesCheckChatInviteRequestTypeID ); err != nil {
return fmt .Errorf ("unable to decode messages.checkChatInvite#3eadb1bb: %w" , err )
}
return c .DecodeBare (b )
}
func (c *MessagesCheckChatInviteRequest ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode messages.checkChatInvite#3eadb1bb to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode messages.checkChatInvite#3eadb1bb: field hash: %w" , err )
}
c .Hash = value
}
return nil
}
func (c *MessagesCheckChatInviteRequest ) GetHash () (value string ) {
if c == nil {
return
}
return c .Hash
}
func (c *Client ) MessagesCheckChatInvite (ctx context .Context , hash string ) (ChatInviteClass , error ) {
var result ChatInviteBox
request := &MessagesCheckChatInviteRequest {
Hash : hash ,
}
if err := c .rpc .Invoke (ctx , request , &result ); err != nil {
return nil , err
}
return result .ChatInvite , 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 .