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