func NewRecordLocal(file string) *cqcode.Record {
	return &cqcode.Record{
		FileID: NewFileLocal(file),
	}
}
NewRecordLocal formats a record with the file path,
this requires CQ HTTP runs in the same host with your bot.

This method is deprecated and will get removed, see #11.
Please use NewRecordWeb instead.
package qqbotapi
import (
	"encoding/base64"
	"errors"
	"fmt"
	"github.com/catsworld/qq-bot-api/cqcode"
	"io"
	"io/ioutil"
	"net/url"
	"reflect"
)
func NewMessage(chatID int64, chatType string, message interface{}) MessageConfig {
	mc := MessageConfig{
		BaseChat: BaseChat{
			ChatID:   chatID,
			ChatType: chatType,
		},
	}
	if !reflect.ValueOf(message).IsValid() {
		return mc
	}
	r := reflect.Indirect(reflect.New(reflect.TypeOf(message)))
	r.Set(reflect.ValueOf(message))
	var sp interface{}
	if r.Kind() == reflect.Ptr {
		sp = r.Interface()
	} else {
		sp = r.Addr().Interface()
	}
	switch v := sp.(type) {
	case *Message:
		mc.Text = v.CQString()
	case *cqcode.Message:
		mc.Text = v.CQString()
	case cqcode.Media:
		mc.Text = cqcode.FormatCQCode(v)
	case *string:
		mc.Text = *v
	default:
		mc.Text = fmt.Sprint(message)
	}
	return mc
}
func NewUpdate(offset int) UpdateConfig {
	return UpdateConfig{
		BaseUpdateConfig: BaseUpdateConfig{
			PreloadUserInfo: false,
		},
		Offset:  offset,
		Limit:   0,
		Timeout: 0,
	}
}
func NewWebhook(pattern string) WebhookConfig {
	return WebhookConfig{
		BaseUpdateConfig: BaseUpdateConfig{
			PreloadUserInfo: false,
		},
		Pattern: pattern,
	}
}
const (
	cacheEnabled  = 1
	cacheDisabled = 0
)
type NetResource struct {
	Cache int `cq:"cache"`
}
func (r *NetResource) EnableCache() {
	r.Cache = cacheEnabled
}
func (r *NetResource) DisableCache() {
	r.Cache = cacheDisabled
}
type NetImage struct {
	*cqcode.Image
	*NetResource
}
type NetRecord struct {
	*cqcode.Record
	*NetResource
}
func NewImageBase64(file interface{}) (*cqcode.Image, error) {
	fileid, err := NewFileBase64(file)
	if err != nil {
		return &cqcode.Image{}, err
	}
	return &cqcode.Image{
		FileID: fileid,
	}, nil
}
func NewRecordBase64(file interface{}) (*cqcode.Record, error) {
	fileid, err := NewFileBase64(file)
	if err != nil {
		return &cqcode.Record{}, err
	}
	return &cqcode.Record{
		FileID: fileid,
	}, nil
}
func NewFileBase64(file interface{}) (string, error) {
	switch f := file.(type) {
	case string:
		data, err := ioutil.ReadFile(f)
		if err != nil {
			return "", err
		}
		encodeString := base64.StdEncoding.EncodeToString(data)
		return "base64://" + encodeString, nil
	case []byte:
		encodeString := base64.StdEncoding.EncodeToString(f)
		return "base64://" + encodeString, nil
	case io.Reader:
		data, err := ioutil.ReadAll(f)
		if err != nil {
			return "", err
		}
		encodeString := base64.StdEncoding.EncodeToString(data)
		return "base64://" + encodeString, nil
	default:
		return "", errors.New("bad file type")
	}
}
func NewImageLocal(file string) *cqcode.Image {
	return &cqcode.Image{
		FileID: NewFileLocal(file),
	}
}