You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: tl_messages_peer_settings_gen.go
    path of file: ./repos/td/tg
    
    the code of the file until where you have to start completion: // Code generated by gotdgen, DO NOT EDIT.

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"
)

// 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{}
)

// MessagesPeerSettings represents TL type `messages.peerSettings#6880b94d`.
// Peer settings
//
// See https://core.telegram.org/constructor/messages.peerSettings for reference.
type MessagesPeerSettings struct {
	// Peer settings
	Settings PeerSettings
	// Mentioned chats
	Chats []ChatClass
	// Mentioned users
	Users []UserClass
}

// MessagesPeerSettingsTypeID is TL type id of MessagesPeerSettings.
const MessagesPeerSettingsTypeID = 0x6880b94d

// Ensuring interfaces in compile-time for MessagesPeerSettings.
var (
	_ bin.Encoder     = &MessagesPeerSettings{}
	_ bin.Decoder     = &MessagesPeerSettings{}
	_ bin.BareEncode
    
func (p *MessagesPeerSettings) DecodeBare(b *bin.Buffer) error {
	if p == nil {
		return fmt.Errorf("can't decode messages.peerSettings#6880b94d to nil")
	}
	{
		if err := p.Settings.Decode(b); err != nil {
			return fmt.Errorf("unable to decode messages.peerSettings#6880b94d: field settings: %w", err)
		}
	}
	{
		headerLen, err := b.VectorHeader()
		if err != nil {
			return fmt.Errorf("unable to decode messages.peerSettings#6880b94d: field chats: %w", err)
		}

		if headerLen > 0 {
			p.Chats = make([]ChatClass, 0, headerLen%bin.PreallocateLimit)
		}
		for idx := 0; idx < headerLen; idx++ {
			value, err := DecodeChat(b)
			if err != nil {
				return fmt.Errorf("unable to decode messages.peerSettings#6880b94d: field chats: %w", err)
			}
			p.Chats = append(p.Chats, value)
		}
	}
	{
		headerLen, err := b.VectorHeader()
		if err != nil {
			return fmt.Errorf("unable to decode messages.peerSettings#6880b94d: field users: %w", err)
		}

		if headerLen > 0 {
			p.Users = make([]UserClass, 0, headerLen%bin.PreallocateLimit)
		}
		for idx := 0; idx < headerLen; idx++ {
			value, err := DecodeUser(b)
			if err != nil {
				return fmt.Errorf("unable to decode messages.peerSettings#6880b94d: field users: %w", err)
			}
			p.Users = append(p.Users, value)
		}
	}
	return nil
}