package bot_net_conn

import (
	"net/http"
	"net/http/cookiejar"
	"time"

	"wartank/pkg/types"
	"wartank/server/serv_bots/warbot/warbot_net/bot_cookie"
)

type BotNetConn struct {
	client *http.Client
	cookie *bot_cookie.BotCookie
}

func NewBotNetConn() *BotNetConn {
	sf := &BotNetConn{
		client: &http.Client{
			Transport: nil,
			Jar:       nil,
			Timeout:   time.Second * 10,
		},
		cookie: bot_cookie.NewBotCookie(),
	}
	sf.client.Jar, _ = cookiejar.New(nil)
	return sf
}

// Client -- возвращает клиента
func (sf *BotNetConn) Client() *http.Client {
	return sf.client
}

// Cookie -- возвращает куки клиента
func (sf *BotNetConn) Cookie() types.IBotCookie {
	return sf.cookie
}
