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: session.go
    path of file: ./repos/benthos/internal/impl/discord
    
    the code of the file until where you have to start completion: package discord

import (
	"sync"
	"sync/atomic"

	"github.com/bwmarrin/discordgo"

	"github.com/benthosdev/benthos/v4/internal/cli"
)

type refCountedSession struct {
	count int64
	sess  *discordgo.Session
}

type refCountedSessions struct {
	mut      sync.Mutex
	sessions map[string]*refCountedSession
}

func (r *refCountedSessions) done(botToken string) {
	r.mut.Lock()
	defer r.mut.Unlock()

	c, exists := r.sessions[botToken]
	if !exists {
		return
	}

	count := atomic.AddInt64(&c.count, -1)
	if count > 
    
func (r *refCountedSessions) Get(botToken string) (sess *discordgo.Session, done func(), err error) {
	done = func() {
		r.done(botToken)
	}

	r.mut.Lock()
	defer r.mut.Unlock()

	c, exists := globalSessions.sessions[botToken]
	if exists {
		atomic.AddInt64(&c.count, 1)
		sess = c.sess
		return
	}

	if sess, err = discordgo.New("Bot " + botToken); err != nil {
		return
	}
	sess.UserAgent = "Benthos " + cli.Version
	sess.Identify.Intents |= discordgo.IntentMessageContent
	if err = sess.Open(); err != nil {
		return
	}

	globalSessions.sessions[botToken] = &refCountedSession{
		count: 1,
		sess:  sess,
	}
	return
}