func (b Bot) IsReplyMentionsMe(m Message) bool {
	return m.IsReply() && b.IsMessageMentionsMe(*m.ReplyToMessage)
}
IsReplyMentionsMe checks that the input message mentions the current b.
package telegram
import (
	"bytes"
	"io"
	"log"
	"mime/multipart"
	"net"
	"path"
	"path/filepath"
	"strings"
	"time"
	json "github.com/json-iterator/go"
	"github.com/kirillDanshin/dlog"
	http "github.com/valyala/fasthttp"
)
type Bot struct {
	*User
	AccessToken string
	Updates     UpdatesChannel
	client   *http.Client
	marshler json.API
}
func New(accessToken string) (b *Bot, err error) {
	b = new(Bot)
	b.marshler = json.ConfigFastest
	b.SetClient(&http.Client{})
	b.AccessToken = accessToken
	b.User, err = b.GetMe()
	return b, err
}
func (b *Bot) SetClient(newClient *http.Client) {
	if b == nil {
		b = new(Bot)
	}
	b.client = newClient
}
func (b Bot) Do(method string, payload interface{}) ([]byte, error) {
	u := http.AcquireURI()
	defer http.ReleaseURI(u)
	u.SetScheme("https")
	u.SetHost("api.telegram.org")
	u.SetPath(path.Join("bot"+b.AccessToken, method))
	var buf bytes.Buffer
	if err := b.marshler.NewEncoder(&buf).Encode(payload); err != nil {
		return nil, err
	}
	req := http.AcquireRequest()
	defer http.ReleaseRequest(req)
	req.Header.SetUserAgent("toby3d/telegram")
	req.Header.SetMethod(http.MethodPost)
	req.Header.SetContentType("application/json")
	req.SetHostBytes(u.Host())
	req.SetRequestURI(u.String())
	req.SetBody(buf.Bytes())
	resp := http.AcquireResponse()
	defer http.ReleaseResponse(resp)
	if err := b.client.Do(req, resp); err != nil {
		return nil, err
	}
	return resp.Body(), nil
}
func (b Bot) Upload(method string, payload map[string]string, files ...*InputFile) ([]byte, error) {
	if len(files) == 0 {
		return b.Do(method, payload)
	}
	body := new(bytes.Buffer)
	w := multipart.NewWriter(body)
	for i := range files {
		_, fileName := filepath.Split(files[i].Attachment.Name())
		part, err := w.CreateFormFile(fileName, fileName)
		if err != nil {
			return nil, err
		}
		if _, err = io.Copy(part, files[i].Attachment); err != nil {
			return nil, err
		}
	}
	for key, val := range payload {
		if err := w.WriteField(key, val); err != nil {
			return nil, err
		}
	}
	if err := w.Close(); err != nil {
		return nil, err
	}
	u := http.AcquireURI()
	defer http.ReleaseURI(u)
	u.SetScheme("https")
	u.SetHost("api.telegram.org")
	u.SetPath(path.Join("bot"+b.AccessToken, method))
	req := http.AcquireRequest()
	defer http.ReleaseRequest(req)
	req.Header.SetMethod(http.MethodPost)
	req.SetRequestURIBytes(u.RequestURI())
	req.Header.SetContentType(w.FormDataContentType())
	req.Header.SetMultipartFormBoundary(w.Boundary())
	if _, err := body.WriteTo(req.BodyWriter()); err != nil {
		return nil, err
	}
	resp := http.AcquireResponse()
	defer http.ReleaseResponse(resp)
	if err := b.client.Do(req, resp); err != nil {
		return nil, err
	}
	return resp.Body(), nil
}
func (b Bot) IsMessageFromMe(m Message) bool {
	return b.User != nil && m.From != nil && m.From.ID == b.ID
}
func (b Bot) IsForwardFromMe(m Message) bool {
	return b.User != nil && m.IsForward() && m.ForwardFrom.ID == b.ID
}
func (b Bot) IsReplyToMe(m Message) bool {
	return m.Chat.IsPrivate() || (m.IsReply() && b.IsMessageFromMe(*m.ReplyToMessage))
}
func (b Bot) IsCommandToMe(m Message) bool {
	if !m.IsCommand() {
		return false
	}
	if m.Chat.IsPrivate() {
		return true
	}
	parts := strings.Split(m.RawCommand(), "@")
	if len(parts) <= 1 {
		return false
	}
	return strings.EqualFold(parts[1], b.User.Username)
}
func (b Bot) IsMessageMentionsMe(m Message) bool {
	if b.User == nil {
		return false
	}
	if b.IsCommandToMe(m) {
		return true
	}
	var entities []*MessageEntity
	switch {
	case m.HasMentions():
		entities = m.Entities
	case m.HasCaptionMentions():
		entities = m.CaptionEntities
	}
	for _, entity := range entities {
		if entity.IsMention() && entity.User.ID == b.ID {
			return true
		}
	}
	return false
}
func (b Bot) IsForwardMentionsMe(m Message) bool { return m.IsForward() && b.IsMessageMentionsMe(m) }