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: direct_messages.go
    path of file: ./repos/discord-mass-DM-GO/instance
    
    the code of the file until where you have to start completion: // Copyright (C) 2021 github.com/V4NSH4J
//
// This source code has been released under the GNU Affero General Public
// License v3.0. A copy of this license is available at
// https://www.gnu.org/licenses/agpl-3.0.en.html

package instance

import (
	"bytes"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"math"
	"math/rand"
	"strings"
	"time"

    
func (in *Instance) typing(channelID, cookie string) error {
	reqURL := fmt.Sprintf(`https://discord.com/api/v9/channels/%s/typing`, channelID)
	req, err := http.NewRequest("POST", reqURL, nil)
	if err != nil {
		return err
	}
	req = in.TypingHeaders(req, cookie, channelID)
	resp, err := in.Client.Do(req)
	if err != nil {
		return err
	}
	if resp.StatusCode != 204 {
		return fmt.Errorf(`invalid status code while sending dm%v`, resp.StatusCode)
	}
	return nil
}