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_server_gen.go
    path of file: ./repos/td/gen/example
    
    the code of the file until where you have to start completion: // Code generated by gotdgen, DO NOT EDIT.

package td

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{}
	_ = 
    
func (s *ServerDispatcher) OnPing(f func(ctx context.Context, id int32) error) {
	handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) {
		var request PingRequest
		if err := request.Decode(b); err != nil {
			return nil, err
		}

		if err := f(ctx, request.ID); err != nil {
			return nil, err
		}

		return &Ok{}, nil
	}

	s.handlers[PingRequestTypeID] = handler
}