Files
mautrix-telegram/pkg/gotd/tg/e2e/tl_send_message_action_gen.go
T
2025-06-27 20:03:37 -07:00

1427 lines
42 KiB
Go
Generated

// Code generated by gotdgen, DO NOT EDIT.
package e2e
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"go.mau.fi/mautrix-telegram/pkg/gotd/bin"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdjson"
"go.mau.fi/mautrix-telegram/pkg/gotd/tdp"
"go.mau.fi/mautrix-telegram/pkg/gotd/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt.Stringer(nil)
_ = strings.Builder{}
_ = errors.Is
_ = multierr.AppendInto
_ = sort.Ints
_ = tdp.Format
_ = tgerr.Error{}
_ = tdjson.Encoder{}
)
// SendMessageTypingAction represents TL type `sendMessageTypingAction#16bf744e`.
// User is typing.
//
// See https://core.telegram.org/constructor/sendMessageTypingAction for reference.
type SendMessageTypingAction struct {
}
// SendMessageTypingActionTypeID is TL type id of SendMessageTypingAction.
const SendMessageTypingActionTypeID = 0x16bf744e
// construct implements constructor of SendMessageActionClass.
func (s SendMessageTypingAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageTypingAction.
var (
_ bin.Encoder = &SendMessageTypingAction{}
_ bin.Decoder = &SendMessageTypingAction{}
_ bin.BareEncoder = &SendMessageTypingAction{}
_ bin.BareDecoder = &SendMessageTypingAction{}
_ SendMessageActionClass = &SendMessageTypingAction{}
)
func (s *SendMessageTypingAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageTypingAction) String() string {
if s == nil {
return "SendMessageTypingAction(nil)"
}
type Alias SendMessageTypingAction
return fmt.Sprintf("SendMessageTypingAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageTypingAction) TypeID() uint32 {
return SendMessageTypingActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageTypingAction) TypeName() string {
return "sendMessageTypingAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageTypingAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageTypingAction",
ID: SendMessageTypingActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageTypingAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageTypingAction#16bf744e as nil")
}
b.PutID(SendMessageTypingActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageTypingAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageTypingAction#16bf744e as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageTypingAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageTypingAction#16bf744e to nil")
}
if err := b.ConsumeID(SendMessageTypingActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageTypingAction#16bf744e: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageTypingAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageTypingAction#16bf744e to nil")
}
return nil
}
// SendMessageCancelAction represents TL type `sendMessageCancelAction#fd5ec8f5`.
// Invalidate all previous action updates. E.g. when user deletes entered text or aborts
// a video upload.
//
// See https://core.telegram.org/constructor/sendMessageCancelAction for reference.
type SendMessageCancelAction struct {
}
// SendMessageCancelActionTypeID is TL type id of SendMessageCancelAction.
const SendMessageCancelActionTypeID = 0xfd5ec8f5
// construct implements constructor of SendMessageActionClass.
func (s SendMessageCancelAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageCancelAction.
var (
_ bin.Encoder = &SendMessageCancelAction{}
_ bin.Decoder = &SendMessageCancelAction{}
_ bin.BareEncoder = &SendMessageCancelAction{}
_ bin.BareDecoder = &SendMessageCancelAction{}
_ SendMessageActionClass = &SendMessageCancelAction{}
)
func (s *SendMessageCancelAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageCancelAction) String() string {
if s == nil {
return "SendMessageCancelAction(nil)"
}
type Alias SendMessageCancelAction
return fmt.Sprintf("SendMessageCancelAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageCancelAction) TypeID() uint32 {
return SendMessageCancelActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageCancelAction) TypeName() string {
return "sendMessageCancelAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageCancelAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageCancelAction",
ID: SendMessageCancelActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageCancelAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageCancelAction#fd5ec8f5 as nil")
}
b.PutID(SendMessageCancelActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageCancelAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageCancelAction#fd5ec8f5 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageCancelAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageCancelAction#fd5ec8f5 to nil")
}
if err := b.ConsumeID(SendMessageCancelActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageCancelAction#fd5ec8f5: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageCancelAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageCancelAction#fd5ec8f5 to nil")
}
return nil
}
// SendMessageRecordVideoAction represents TL type `sendMessageRecordVideoAction#a187d66f`.
// User is recording a video.
//
// See https://core.telegram.org/constructor/sendMessageRecordVideoAction for reference.
type SendMessageRecordVideoAction struct {
}
// SendMessageRecordVideoActionTypeID is TL type id of SendMessageRecordVideoAction.
const SendMessageRecordVideoActionTypeID = 0xa187d66f
// construct implements constructor of SendMessageActionClass.
func (s SendMessageRecordVideoAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageRecordVideoAction.
var (
_ bin.Encoder = &SendMessageRecordVideoAction{}
_ bin.Decoder = &SendMessageRecordVideoAction{}
_ bin.BareEncoder = &SendMessageRecordVideoAction{}
_ bin.BareDecoder = &SendMessageRecordVideoAction{}
_ SendMessageActionClass = &SendMessageRecordVideoAction{}
)
func (s *SendMessageRecordVideoAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageRecordVideoAction) String() string {
if s == nil {
return "SendMessageRecordVideoAction(nil)"
}
type Alias SendMessageRecordVideoAction
return fmt.Sprintf("SendMessageRecordVideoAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageRecordVideoAction) TypeID() uint32 {
return SendMessageRecordVideoActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageRecordVideoAction) TypeName() string {
return "sendMessageRecordVideoAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageRecordVideoAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageRecordVideoAction",
ID: SendMessageRecordVideoActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageRecordVideoAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageRecordVideoAction#a187d66f as nil")
}
b.PutID(SendMessageRecordVideoActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageRecordVideoAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageRecordVideoAction#a187d66f as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageRecordVideoAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageRecordVideoAction#a187d66f to nil")
}
if err := b.ConsumeID(SendMessageRecordVideoActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageRecordVideoAction#a187d66f: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageRecordVideoAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageRecordVideoAction#a187d66f to nil")
}
return nil
}
// SendMessageUploadVideoAction represents TL type `sendMessageUploadVideoAction#92042ff7`.
// User is uploading a video.
//
// See https://core.telegram.org/constructor/sendMessageUploadVideoAction for reference.
type SendMessageUploadVideoAction struct {
}
// SendMessageUploadVideoActionTypeID is TL type id of SendMessageUploadVideoAction.
const SendMessageUploadVideoActionTypeID = 0x92042ff7
// construct implements constructor of SendMessageActionClass.
func (s SendMessageUploadVideoAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageUploadVideoAction.
var (
_ bin.Encoder = &SendMessageUploadVideoAction{}
_ bin.Decoder = &SendMessageUploadVideoAction{}
_ bin.BareEncoder = &SendMessageUploadVideoAction{}
_ bin.BareDecoder = &SendMessageUploadVideoAction{}
_ SendMessageActionClass = &SendMessageUploadVideoAction{}
)
func (s *SendMessageUploadVideoAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageUploadVideoAction) String() string {
if s == nil {
return "SendMessageUploadVideoAction(nil)"
}
type Alias SendMessageUploadVideoAction
return fmt.Sprintf("SendMessageUploadVideoAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageUploadVideoAction) TypeID() uint32 {
return SendMessageUploadVideoActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageUploadVideoAction) TypeName() string {
return "sendMessageUploadVideoAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageUploadVideoAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageUploadVideoAction",
ID: SendMessageUploadVideoActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageUploadVideoAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadVideoAction#92042ff7 as nil")
}
b.PutID(SendMessageUploadVideoActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageUploadVideoAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadVideoAction#92042ff7 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageUploadVideoAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadVideoAction#92042ff7 to nil")
}
if err := b.ConsumeID(SendMessageUploadVideoActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageUploadVideoAction#92042ff7: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageUploadVideoAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadVideoAction#92042ff7 to nil")
}
return nil
}
// SendMessageRecordAudioAction represents TL type `sendMessageRecordAudioAction#d52f73f7`.
// User is recording a voice message.
//
// See https://core.telegram.org/constructor/sendMessageRecordAudioAction for reference.
type SendMessageRecordAudioAction struct {
}
// SendMessageRecordAudioActionTypeID is TL type id of SendMessageRecordAudioAction.
const SendMessageRecordAudioActionTypeID = 0xd52f73f7
// construct implements constructor of SendMessageActionClass.
func (s SendMessageRecordAudioAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageRecordAudioAction.
var (
_ bin.Encoder = &SendMessageRecordAudioAction{}
_ bin.Decoder = &SendMessageRecordAudioAction{}
_ bin.BareEncoder = &SendMessageRecordAudioAction{}
_ bin.BareDecoder = &SendMessageRecordAudioAction{}
_ SendMessageActionClass = &SendMessageRecordAudioAction{}
)
func (s *SendMessageRecordAudioAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageRecordAudioAction) String() string {
if s == nil {
return "SendMessageRecordAudioAction(nil)"
}
type Alias SendMessageRecordAudioAction
return fmt.Sprintf("SendMessageRecordAudioAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageRecordAudioAction) TypeID() uint32 {
return SendMessageRecordAudioActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageRecordAudioAction) TypeName() string {
return "sendMessageRecordAudioAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageRecordAudioAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageRecordAudioAction",
ID: SendMessageRecordAudioActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageRecordAudioAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageRecordAudioAction#d52f73f7 as nil")
}
b.PutID(SendMessageRecordAudioActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageRecordAudioAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageRecordAudioAction#d52f73f7 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageRecordAudioAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageRecordAudioAction#d52f73f7 to nil")
}
if err := b.ConsumeID(SendMessageRecordAudioActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageRecordAudioAction#d52f73f7: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageRecordAudioAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageRecordAudioAction#d52f73f7 to nil")
}
return nil
}
// SendMessageUploadAudioAction represents TL type `sendMessageUploadAudioAction#e6ac8a6f`.
// User is uploading a voice message.
//
// See https://core.telegram.org/constructor/sendMessageUploadAudioAction for reference.
type SendMessageUploadAudioAction struct {
}
// SendMessageUploadAudioActionTypeID is TL type id of SendMessageUploadAudioAction.
const SendMessageUploadAudioActionTypeID = 0xe6ac8a6f
// construct implements constructor of SendMessageActionClass.
func (s SendMessageUploadAudioAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageUploadAudioAction.
var (
_ bin.Encoder = &SendMessageUploadAudioAction{}
_ bin.Decoder = &SendMessageUploadAudioAction{}
_ bin.BareEncoder = &SendMessageUploadAudioAction{}
_ bin.BareDecoder = &SendMessageUploadAudioAction{}
_ SendMessageActionClass = &SendMessageUploadAudioAction{}
)
func (s *SendMessageUploadAudioAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageUploadAudioAction) String() string {
if s == nil {
return "SendMessageUploadAudioAction(nil)"
}
type Alias SendMessageUploadAudioAction
return fmt.Sprintf("SendMessageUploadAudioAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageUploadAudioAction) TypeID() uint32 {
return SendMessageUploadAudioActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageUploadAudioAction) TypeName() string {
return "sendMessageUploadAudioAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageUploadAudioAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageUploadAudioAction",
ID: SendMessageUploadAudioActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageUploadAudioAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadAudioAction#e6ac8a6f as nil")
}
b.PutID(SendMessageUploadAudioActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageUploadAudioAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadAudioAction#e6ac8a6f as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageUploadAudioAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadAudioAction#e6ac8a6f to nil")
}
if err := b.ConsumeID(SendMessageUploadAudioActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageUploadAudioAction#e6ac8a6f: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageUploadAudioAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadAudioAction#e6ac8a6f to nil")
}
return nil
}
// SendMessageUploadPhotoAction represents TL type `sendMessageUploadPhotoAction#990a3c1a`.
// User is uploading a photo.
//
// See https://core.telegram.org/constructor/sendMessageUploadPhotoAction for reference.
type SendMessageUploadPhotoAction struct {
}
// SendMessageUploadPhotoActionTypeID is TL type id of SendMessageUploadPhotoAction.
const SendMessageUploadPhotoActionTypeID = 0x990a3c1a
// construct implements constructor of SendMessageActionClass.
func (s SendMessageUploadPhotoAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageUploadPhotoAction.
var (
_ bin.Encoder = &SendMessageUploadPhotoAction{}
_ bin.Decoder = &SendMessageUploadPhotoAction{}
_ bin.BareEncoder = &SendMessageUploadPhotoAction{}
_ bin.BareDecoder = &SendMessageUploadPhotoAction{}
_ SendMessageActionClass = &SendMessageUploadPhotoAction{}
)
func (s *SendMessageUploadPhotoAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageUploadPhotoAction) String() string {
if s == nil {
return "SendMessageUploadPhotoAction(nil)"
}
type Alias SendMessageUploadPhotoAction
return fmt.Sprintf("SendMessageUploadPhotoAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageUploadPhotoAction) TypeID() uint32 {
return SendMessageUploadPhotoActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageUploadPhotoAction) TypeName() string {
return "sendMessageUploadPhotoAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageUploadPhotoAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageUploadPhotoAction",
ID: SendMessageUploadPhotoActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageUploadPhotoAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadPhotoAction#990a3c1a as nil")
}
b.PutID(SendMessageUploadPhotoActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageUploadPhotoAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadPhotoAction#990a3c1a as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageUploadPhotoAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadPhotoAction#990a3c1a to nil")
}
if err := b.ConsumeID(SendMessageUploadPhotoActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageUploadPhotoAction#990a3c1a: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageUploadPhotoAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadPhotoAction#990a3c1a to nil")
}
return nil
}
// SendMessageUploadDocumentAction represents TL type `sendMessageUploadDocumentAction#8faee98e`.
// User is uploading a file.
//
// See https://core.telegram.org/constructor/sendMessageUploadDocumentAction for reference.
type SendMessageUploadDocumentAction struct {
}
// SendMessageUploadDocumentActionTypeID is TL type id of SendMessageUploadDocumentAction.
const SendMessageUploadDocumentActionTypeID = 0x8faee98e
// construct implements constructor of SendMessageActionClass.
func (s SendMessageUploadDocumentAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageUploadDocumentAction.
var (
_ bin.Encoder = &SendMessageUploadDocumentAction{}
_ bin.Decoder = &SendMessageUploadDocumentAction{}
_ bin.BareEncoder = &SendMessageUploadDocumentAction{}
_ bin.BareDecoder = &SendMessageUploadDocumentAction{}
_ SendMessageActionClass = &SendMessageUploadDocumentAction{}
)
func (s *SendMessageUploadDocumentAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageUploadDocumentAction) String() string {
if s == nil {
return "SendMessageUploadDocumentAction(nil)"
}
type Alias SendMessageUploadDocumentAction
return fmt.Sprintf("SendMessageUploadDocumentAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageUploadDocumentAction) TypeID() uint32 {
return SendMessageUploadDocumentActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageUploadDocumentAction) TypeName() string {
return "sendMessageUploadDocumentAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageUploadDocumentAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageUploadDocumentAction",
ID: SendMessageUploadDocumentActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageUploadDocumentAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadDocumentAction#8faee98e as nil")
}
b.PutID(SendMessageUploadDocumentActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageUploadDocumentAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadDocumentAction#8faee98e as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageUploadDocumentAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadDocumentAction#8faee98e to nil")
}
if err := b.ConsumeID(SendMessageUploadDocumentActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageUploadDocumentAction#8faee98e: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageUploadDocumentAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadDocumentAction#8faee98e to nil")
}
return nil
}
// SendMessageGeoLocationAction represents TL type `sendMessageGeoLocationAction#176f8ba1`.
// User is selecting a location to share.
//
// See https://core.telegram.org/constructor/sendMessageGeoLocationAction for reference.
type SendMessageGeoLocationAction struct {
}
// SendMessageGeoLocationActionTypeID is TL type id of SendMessageGeoLocationAction.
const SendMessageGeoLocationActionTypeID = 0x176f8ba1
// construct implements constructor of SendMessageActionClass.
func (s SendMessageGeoLocationAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageGeoLocationAction.
var (
_ bin.Encoder = &SendMessageGeoLocationAction{}
_ bin.Decoder = &SendMessageGeoLocationAction{}
_ bin.BareEncoder = &SendMessageGeoLocationAction{}
_ bin.BareDecoder = &SendMessageGeoLocationAction{}
_ SendMessageActionClass = &SendMessageGeoLocationAction{}
)
func (s *SendMessageGeoLocationAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageGeoLocationAction) String() string {
if s == nil {
return "SendMessageGeoLocationAction(nil)"
}
type Alias SendMessageGeoLocationAction
return fmt.Sprintf("SendMessageGeoLocationAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageGeoLocationAction) TypeID() uint32 {
return SendMessageGeoLocationActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageGeoLocationAction) TypeName() string {
return "sendMessageGeoLocationAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageGeoLocationAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageGeoLocationAction",
ID: SendMessageGeoLocationActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageGeoLocationAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageGeoLocationAction#176f8ba1 as nil")
}
b.PutID(SendMessageGeoLocationActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageGeoLocationAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageGeoLocationAction#176f8ba1 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageGeoLocationAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageGeoLocationAction#176f8ba1 to nil")
}
if err := b.ConsumeID(SendMessageGeoLocationActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageGeoLocationAction#176f8ba1: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageGeoLocationAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageGeoLocationAction#176f8ba1 to nil")
}
return nil
}
// SendMessageChooseContactAction represents TL type `sendMessageChooseContactAction#628cbc6f`.
// User is selecting a contact to share.
//
// See https://core.telegram.org/constructor/sendMessageChooseContactAction for reference.
type SendMessageChooseContactAction struct {
}
// SendMessageChooseContactActionTypeID is TL type id of SendMessageChooseContactAction.
const SendMessageChooseContactActionTypeID = 0x628cbc6f
// construct implements constructor of SendMessageActionClass.
func (s SendMessageChooseContactAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageChooseContactAction.
var (
_ bin.Encoder = &SendMessageChooseContactAction{}
_ bin.Decoder = &SendMessageChooseContactAction{}
_ bin.BareEncoder = &SendMessageChooseContactAction{}
_ bin.BareDecoder = &SendMessageChooseContactAction{}
_ SendMessageActionClass = &SendMessageChooseContactAction{}
)
func (s *SendMessageChooseContactAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageChooseContactAction) String() string {
if s == nil {
return "SendMessageChooseContactAction(nil)"
}
type Alias SendMessageChooseContactAction
return fmt.Sprintf("SendMessageChooseContactAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageChooseContactAction) TypeID() uint32 {
return SendMessageChooseContactActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageChooseContactAction) TypeName() string {
return "sendMessageChooseContactAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageChooseContactAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageChooseContactAction",
ID: SendMessageChooseContactActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageChooseContactAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageChooseContactAction#628cbc6f as nil")
}
b.PutID(SendMessageChooseContactActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageChooseContactAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageChooseContactAction#628cbc6f as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageChooseContactAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageChooseContactAction#628cbc6f to nil")
}
if err := b.ConsumeID(SendMessageChooseContactActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageChooseContactAction#628cbc6f: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageChooseContactAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageChooseContactAction#628cbc6f to nil")
}
return nil
}
// SendMessageRecordRoundAction represents TL type `sendMessageRecordRoundAction#88f27fbc`.
// User is recording a round video to share
//
// See https://core.telegram.org/constructor/sendMessageRecordRoundAction for reference.
type SendMessageRecordRoundAction struct {
}
// SendMessageRecordRoundActionTypeID is TL type id of SendMessageRecordRoundAction.
const SendMessageRecordRoundActionTypeID = 0x88f27fbc
// construct implements constructor of SendMessageActionClass.
func (s SendMessageRecordRoundAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageRecordRoundAction.
var (
_ bin.Encoder = &SendMessageRecordRoundAction{}
_ bin.Decoder = &SendMessageRecordRoundAction{}
_ bin.BareEncoder = &SendMessageRecordRoundAction{}
_ bin.BareDecoder = &SendMessageRecordRoundAction{}
_ SendMessageActionClass = &SendMessageRecordRoundAction{}
)
func (s *SendMessageRecordRoundAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageRecordRoundAction) String() string {
if s == nil {
return "SendMessageRecordRoundAction(nil)"
}
type Alias SendMessageRecordRoundAction
return fmt.Sprintf("SendMessageRecordRoundAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageRecordRoundAction) TypeID() uint32 {
return SendMessageRecordRoundActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageRecordRoundAction) TypeName() string {
return "sendMessageRecordRoundAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageRecordRoundAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageRecordRoundAction",
ID: SendMessageRecordRoundActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageRecordRoundAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageRecordRoundAction#88f27fbc as nil")
}
b.PutID(SendMessageRecordRoundActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageRecordRoundAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageRecordRoundAction#88f27fbc as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageRecordRoundAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageRecordRoundAction#88f27fbc to nil")
}
if err := b.ConsumeID(SendMessageRecordRoundActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageRecordRoundAction#88f27fbc: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageRecordRoundAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageRecordRoundAction#88f27fbc to nil")
}
return nil
}
// SendMessageUploadRoundAction represents TL type `sendMessageUploadRoundAction#bb718624`.
// User is uploading a round video
//
// See https://core.telegram.org/constructor/sendMessageUploadRoundAction for reference.
type SendMessageUploadRoundAction struct {
}
// SendMessageUploadRoundActionTypeID is TL type id of SendMessageUploadRoundAction.
const SendMessageUploadRoundActionTypeID = 0xbb718624
// construct implements constructor of SendMessageActionClass.
func (s SendMessageUploadRoundAction) construct() SendMessageActionClass { return &s }
// Ensuring interfaces in compile-time for SendMessageUploadRoundAction.
var (
_ bin.Encoder = &SendMessageUploadRoundAction{}
_ bin.Decoder = &SendMessageUploadRoundAction{}
_ bin.BareEncoder = &SendMessageUploadRoundAction{}
_ bin.BareDecoder = &SendMessageUploadRoundAction{}
_ SendMessageActionClass = &SendMessageUploadRoundAction{}
)
func (s *SendMessageUploadRoundAction) Zero() bool {
if s == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func (s *SendMessageUploadRoundAction) String() string {
if s == nil {
return "SendMessageUploadRoundAction(nil)"
}
type Alias SendMessageUploadRoundAction
return fmt.Sprintf("SendMessageUploadRoundAction%+v", Alias(*s))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*SendMessageUploadRoundAction) TypeID() uint32 {
return SendMessageUploadRoundActionTypeID
}
// TypeName returns name of type in TL schema.
func (*SendMessageUploadRoundAction) TypeName() string {
return "sendMessageUploadRoundAction"
}
// TypeInfo returns info about TL type.
func (s *SendMessageUploadRoundAction) TypeInfo() tdp.Type {
typ := tdp.Type{
Name: "sendMessageUploadRoundAction",
ID: SendMessageUploadRoundActionTypeID,
}
if s == nil {
typ.Null = true
return typ
}
typ.Fields = []tdp.Field{}
return typ
}
// Encode implements bin.Encoder.
func (s *SendMessageUploadRoundAction) Encode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadRoundAction#bb718624 as nil")
}
b.PutID(SendMessageUploadRoundActionTypeID)
return s.EncodeBare(b)
}
// EncodeBare implements bin.BareEncoder.
func (s *SendMessageUploadRoundAction) EncodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't encode sendMessageUploadRoundAction#bb718624 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func (s *SendMessageUploadRoundAction) Decode(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadRoundAction#bb718624 to nil")
}
if err := b.ConsumeID(SendMessageUploadRoundActionTypeID); err != nil {
return fmt.Errorf("unable to decode sendMessageUploadRoundAction#bb718624: %w", err)
}
return s.DecodeBare(b)
}
// DecodeBare implements bin.BareDecoder.
func (s *SendMessageUploadRoundAction) DecodeBare(b *bin.Buffer) error {
if s == nil {
return fmt.Errorf("can't decode sendMessageUploadRoundAction#bb718624 to nil")
}
return nil
}
// SendMessageActionClassName is schema name of SendMessageActionClass.
const SendMessageActionClassName = "SendMessageAction"
// SendMessageActionClass represents SendMessageAction generic type.
//
// See https://core.telegram.org/type/SendMessageAction for reference.
//
// Example:
//
// g, err := e2e.DecodeSendMessageAction(buf)
// if err != nil {
// panic(err)
// }
// switch v := g.(type) {
// case *e2e.SendMessageTypingAction: // sendMessageTypingAction#16bf744e
// case *e2e.SendMessageCancelAction: // sendMessageCancelAction#fd5ec8f5
// case *e2e.SendMessageRecordVideoAction: // sendMessageRecordVideoAction#a187d66f
// case *e2e.SendMessageUploadVideoAction: // sendMessageUploadVideoAction#92042ff7
// case *e2e.SendMessageRecordAudioAction: // sendMessageRecordAudioAction#d52f73f7
// case *e2e.SendMessageUploadAudioAction: // sendMessageUploadAudioAction#e6ac8a6f
// case *e2e.SendMessageUploadPhotoAction: // sendMessageUploadPhotoAction#990a3c1a
// case *e2e.SendMessageUploadDocumentAction: // sendMessageUploadDocumentAction#8faee98e
// case *e2e.SendMessageGeoLocationAction: // sendMessageGeoLocationAction#176f8ba1
// case *e2e.SendMessageChooseContactAction: // sendMessageChooseContactAction#628cbc6f
// case *e2e.SendMessageRecordRoundAction: // sendMessageRecordRoundAction#88f27fbc
// case *e2e.SendMessageUploadRoundAction: // sendMessageUploadRoundAction#bb718624
// default: panic(v)
// }
type SendMessageActionClass interface {
bin.Encoder
bin.Decoder
bin.BareEncoder
bin.BareDecoder
construct() SendMessageActionClass
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
TypeID() uint32
// TypeName returns name of type in TL schema.
TypeName() string
// String implements fmt.Stringer.
String() string
// Zero returns true if current object has a zero value.
Zero() bool
}
// DecodeSendMessageAction implements binary de-serialization for SendMessageActionClass.
func DecodeSendMessageAction(buf *bin.Buffer) (SendMessageActionClass, error) {
id, err := buf.PeekID()
if err != nil {
return nil, err
}
switch id {
case SendMessageTypingActionTypeID:
// Decoding sendMessageTypingAction#16bf744e.
v := SendMessageTypingAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageCancelActionTypeID:
// Decoding sendMessageCancelAction#fd5ec8f5.
v := SendMessageCancelAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageRecordVideoActionTypeID:
// Decoding sendMessageRecordVideoAction#a187d66f.
v := SendMessageRecordVideoAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageUploadVideoActionTypeID:
// Decoding sendMessageUploadVideoAction#92042ff7.
v := SendMessageUploadVideoAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageRecordAudioActionTypeID:
// Decoding sendMessageRecordAudioAction#d52f73f7.
v := SendMessageRecordAudioAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageUploadAudioActionTypeID:
// Decoding sendMessageUploadAudioAction#e6ac8a6f.
v := SendMessageUploadAudioAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageUploadPhotoActionTypeID:
// Decoding sendMessageUploadPhotoAction#990a3c1a.
v := SendMessageUploadPhotoAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageUploadDocumentActionTypeID:
// Decoding sendMessageUploadDocumentAction#8faee98e.
v := SendMessageUploadDocumentAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageGeoLocationActionTypeID:
// Decoding sendMessageGeoLocationAction#176f8ba1.
v := SendMessageGeoLocationAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageChooseContactActionTypeID:
// Decoding sendMessageChooseContactAction#628cbc6f.
v := SendMessageChooseContactAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageRecordRoundActionTypeID:
// Decoding sendMessageRecordRoundAction#88f27fbc.
v := SendMessageRecordRoundAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
case SendMessageUploadRoundActionTypeID:
// Decoding sendMessageUploadRoundAction#bb718624.
v := SendMessageUploadRoundAction{}
if err := v.Decode(buf); err != nil {
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", err)
}
return &v, nil
default:
return nil, fmt.Errorf("unable to decode SendMessageActionClass: %w", bin.NewUnexpectedID(id))
}
}
// SendMessageAction boxes the SendMessageActionClass providing a helper.
type SendMessageActionBox struct {
SendMessageAction SendMessageActionClass
}
// Decode implements bin.Decoder for SendMessageActionBox.
func (b *SendMessageActionBox) Decode(buf *bin.Buffer) error {
if b == nil {
return fmt.Errorf("unable to decode SendMessageActionBox to nil")
}
v, err := DecodeSendMessageAction(buf)
if err != nil {
return fmt.Errorf("unable to decode boxed value: %w", err)
}
b.SendMessageAction = v
return nil
}
// Encode implements bin.Encode for SendMessageActionBox.
func (b *SendMessageActionBox) Encode(buf *bin.Buffer) error {
if b == nil || b.SendMessageAction == nil {
return fmt.Errorf("unable to encode SendMessageActionClass as nil")
}
return b.SendMessageAction.Encode(buf)
}