func (bot *Bot) GetChat(chatId int64) (*Chat, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	r, err := bot.Get("getChat", v)
	if err != nil {
		return nil, err
	}
	var c Chat
	return &c, json.Unmarshal(r, &c)
}
GetChat Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
- chat_id (type int64): Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
https://core.telegram.org/bots/api#getchat
package gotgbot
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	urlLib "net/url"  
	"strconv"
)
type AddStickerToSetOpts struct {
	PngSticker InputFile
	TgsSticker InputFile
	MaskPosition MaskPosition
}
func (bot *Bot) AddStickerToSet(userId int64, name string, emojis string, opts *AddStickerToSetOpts) (bool, error) {
	v := urlLib.Values{}
	data := map[string]NamedReader{}
	if userId != 0 {
		v.Add("user_id", strconv.FormatInt(userId, 10))
	}
	v.Add("name", name)
	v.Add("emojis", emojis)
	if opts != nil {
		if opts.PngSticker != nil {
			switch m := opts.PngSticker.(type) {
			case string:
				v.Add("png_sticker", m)
			case NamedReader:
				v.Add("png_sticker", "attach://png_sticker")
				data["png_sticker"] = m
			case io.Reader:
				v.Add("png_sticker", "attach://png_sticker")
				data["png_sticker"] = NamedFile{File: m}
			case []byte:
				v.Add("png_sticker", "attach://png_sticker")
				data["png_sticker"] = NamedFile{File: bytes.NewReader(m)}
			default:
				return false, fmt.Errorf("unknown type for InputFile: %T", opts.PngSticker)
			}
		}
		if opts.TgsSticker != nil {
			switch m := opts.TgsSticker.(type) {
			case NamedReader:
				v.Add("tgs_sticker", "attach://tgs_sticker")
				data["tgs_sticker"] = m
			case io.Reader:
				v.Add("tgs_sticker", "attach://tgs_sticker")
				data["tgs_sticker"] = NamedFile{File: m}
			case []byte:
				v.Add("tgs_sticker", "attach://tgs_sticker")
				data["tgs_sticker"] = NamedFile{File: bytes.NewReader(m)}
			default:
				return false, fmt.Errorf("unknown type for InputFile: %T", opts.TgsSticker)
			}
		}
		bs, err := json.Marshal(opts.MaskPosition)
		if err != nil {
			return false, fmt.Errorf("failed to marshal field mask_position: %w", err)
		}
		v.Add("mask_position", string(bs))
	}
	r, err := bot.Post("addStickerToSet", v, data)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type AnswerCallbackQueryOpts struct {
	Text string
	ShowAlert bool
	Url string
	CacheTime int64
}
func (bot *Bot) AnswerCallbackQuery(callbackQueryId string, opts *AnswerCallbackQueryOpts) (bool, error) {
	v := urlLib.Values{}
	v.Add("callback_query_id", callbackQueryId)
	if opts != nil {
		v.Add("text", opts.Text)
		v.Add("show_alert", strconv.FormatBool(opts.ShowAlert))
		v.Add("url", opts.Url)
		if opts.CacheTime != 0 {
			v.Add("cache_time", strconv.FormatInt(opts.CacheTime, 10))
		}
	}
	r, err := bot.Get("answerCallbackQuery", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type AnswerInlineQueryOpts struct {
	CacheTime int64
	IsPersonal bool
	NextOffset string
	SwitchPmText string
	SwitchPmParameter string
}
func (bot *Bot) AnswerInlineQuery(inlineQueryId string, results []InlineQueryResult, opts *AnswerInlineQueryOpts) (bool, error) {
	v := urlLib.Values{}
	v.Add("inline_query_id", inlineQueryId)
	if results != nil {
		bs, err := json.Marshal(results)
		if err != nil {
			return false, fmt.Errorf("failed to marshal field results: %w", err)
		}
		v.Add("results", string(bs))
	}
	if opts != nil {
		if opts.CacheTime != 0 {
			v.Add("cache_time", strconv.FormatInt(opts.CacheTime, 10))
		}
		v.Add("is_personal", strconv.FormatBool(opts.IsPersonal))
		v.Add("next_offset", opts.NextOffset)
		v.Add("switch_pm_text", opts.SwitchPmText)
		v.Add("switch_pm_parameter", opts.SwitchPmParameter)
	}
	r, err := bot.Get("answerInlineQuery", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type AnswerPreCheckoutQueryOpts struct {
	ErrorMessage string
}
func (bot *Bot) AnswerPreCheckoutQuery(preCheckoutQueryId string, ok bool, opts *AnswerPreCheckoutQueryOpts) (bool, error) {
	v := urlLib.Values{}
	v.Add("pre_checkout_query_id", preCheckoutQueryId)
	v.Add("ok", strconv.FormatBool(ok))
	if opts != nil {
		v.Add("error_message", opts.ErrorMessage)
	}
	r, err := bot.Get("answerPreCheckoutQuery", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type AnswerShippingQueryOpts struct {
	ShippingOptions []ShippingOption
	ErrorMessage string
}
func (bot *Bot) AnswerShippingQuery(shippingQueryId string, ok bool, opts *AnswerShippingQueryOpts) (bool, error) {
	v := urlLib.Values{}
	v.Add("shipping_query_id", shippingQueryId)
	v.Add("ok", strconv.FormatBool(ok))
	if opts != nil {
		if opts.ShippingOptions != nil {
			bs, err := json.Marshal(opts.ShippingOptions)
			if err != nil {
				return false, fmt.Errorf("failed to marshal field shipping_options: %w", err)
			}
			v.Add("shipping_options", string(bs))
		}
		v.Add("error_message", opts.ErrorMessage)
	}
	r, err := bot.Get("answerShippingQuery", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type BanChatMemberOpts struct {
	UntilDate int64
	RevokeMessages bool
}
func (bot *Bot) BanChatMember(chatId int64, userId int64, opts *BanChatMemberOpts) (bool, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	if userId != 0 {
		v.Add("user_id", strconv.FormatInt(userId, 10))
	}
	if opts != nil {
		if opts.UntilDate != 0 {
			v.Add("until_date", strconv.FormatInt(opts.UntilDate, 10))
		}
		v.Add("revoke_messages", strconv.FormatBool(opts.RevokeMessages))
	}
	r, err := bot.Get("banChatMember", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
func (bot *Bot) Close() (bool, error) {
	v := urlLib.Values{}
	r, err := bot.Get("close", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type CopyMessageOpts struct {
	Caption string
	ParseMode string
	CaptionEntities []MessageEntity
	DisableNotification bool
	ReplyToMessageId int64
	AllowSendingWithoutReply bool
	ReplyMarkup ReplyMarkup
}
func (bot *Bot) CopyMessage(chatId int64, fromChatId int64, messageId int64, opts *CopyMessageOpts) (*MessageId, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	if fromChatId != 0 {
		v.Add("from_chat_id", strconv.FormatInt(fromChatId, 10))
	}
	if messageId != 0 {
		v.Add("message_id", strconv.FormatInt(messageId, 10))
	}
	if opts != nil {
		v.Add("caption", opts.Caption)
		v.Add("parse_mode", opts.ParseMode)
		if opts.CaptionEntities != nil {
			bs, err := json.Marshal(opts.CaptionEntities)
			if err != nil {
				return nil, fmt.Errorf("failed to marshal field caption_entities: %w", err)
			}
			v.Add("caption_entities", string(bs))
		}
		v.Add("disable_notification", strconv.FormatBool(opts.DisableNotification))
		if opts.ReplyToMessageId != 0 {
			v.Add("reply_to_message_id", strconv.FormatInt(opts.ReplyToMessageId, 10))
		}
		v.Add("allow_sending_without_reply", strconv.FormatBool(opts.AllowSendingWithoutReply))
		if opts.ReplyMarkup != nil {
			bs, err := json.Marshal(opts.ReplyMarkup)
			if err != nil {
				return nil, fmt.Errorf("failed to marshal field reply_markup: %w", err)
			}
			v.Add("reply_markup", string(bs))
		}
	}
	r, err := bot.Get("copyMessage", v)
	if err != nil {
		return nil, err
	}
	var m MessageId
	return &m, json.Unmarshal(r, &m)
}
type CreateChatInviteLinkOpts struct {
	ExpireDate int64
	MemberLimit int64
}
func (bot *Bot) CreateChatInviteLink(chatId int64, opts *CreateChatInviteLinkOpts) (*ChatInviteLink, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	if opts != nil {
		if opts.ExpireDate != 0 {
			v.Add("expire_date", strconv.FormatInt(opts.ExpireDate, 10))
		}
		if opts.MemberLimit != 0 {
			v.Add("member_limit", strconv.FormatInt(opts.MemberLimit, 10))
		}
	}
	r, err := bot.Get("createChatInviteLink", v)
	if err != nil {
		return nil, err
	}
	var c ChatInviteLink
	return &c, json.Unmarshal(r, &c)
}
type CreateNewStickerSetOpts struct {
	PngSticker InputFile
	TgsSticker InputFile
	ContainsMasks bool
	MaskPosition MaskPosition
}
func (bot *Bot) CreateNewStickerSet(userId int64, name string, title string, emojis string, opts *CreateNewStickerSetOpts) (bool, error) {
	v := urlLib.Values{}
	data := map[string]NamedReader{}
	if userId != 0 {
		v.Add("user_id", strconv.FormatInt(userId, 10))
	}
	v.Add("name", name)
	v.Add("title", title)
	v.Add("emojis", emojis)
	if opts != nil {
		if opts.PngSticker != nil {
			switch m := opts.PngSticker.(type) {
			case string:
				v.Add("png_sticker", m)
			case NamedReader:
				v.Add("png_sticker", "attach://png_sticker")
				data["png_sticker"] = m
			case io.Reader:
				v.Add("png_sticker", "attach://png_sticker")
				data["png_sticker"] = NamedFile{File: m}
			case []byte:
				v.Add("png_sticker", "attach://png_sticker")
				data["png_sticker"] = NamedFile{File: bytes.NewReader(m)}
			default:
				return false, fmt.Errorf("unknown type for InputFile: %T", opts.PngSticker)
			}
		}
		if opts.TgsSticker != nil {
			switch m := opts.TgsSticker.(type) {
			case NamedReader:
				v.Add("tgs_sticker", "attach://tgs_sticker")
				data["tgs_sticker"] = m
			case io.Reader:
				v.Add("tgs_sticker", "attach://tgs_sticker")
				data["tgs_sticker"] = NamedFile{File: m}
			case []byte:
				v.Add("tgs_sticker", "attach://tgs_sticker")
				data["tgs_sticker"] = NamedFile{File: bytes.NewReader(m)}
			default:
				return false, fmt.Errorf("unknown type for InputFile: %T", opts.TgsSticker)
			}
		}
		v.Add("contains_masks", strconv.FormatBool(opts.ContainsMasks))
		bs, err := json.Marshal(opts.MaskPosition)
		if err != nil {
			return false, fmt.Errorf("failed to marshal field mask_position: %w", err)
		}
		v.Add("mask_position", string(bs))
	}
	r, err := bot.Post("createNewStickerSet", v, data)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
func (bot *Bot) DeleteChatPhoto(chatId int64) (bool, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	r, err := bot.Get("deleteChatPhoto", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
func (bot *Bot) DeleteChatStickerSet(chatId int64) (bool, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	r, err := bot.Get("deleteChatStickerSet", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
func (bot *Bot) DeleteMessage(chatId int64, messageId int64) (bool, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	if messageId != 0 {
		v.Add("message_id", strconv.FormatInt(messageId, 10))
	}
	r, err := bot.Get("deleteMessage", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type DeleteMyCommandsOpts struct {
	Scope BotCommandScope
	LanguageCode string
}
func (bot *Bot) DeleteMyCommands(opts *DeleteMyCommandsOpts) (bool, error) {
	v := urlLib.Values{}
	if opts != nil {
		bs, err := json.Marshal(opts.Scope)
		if err != nil {
			return false, fmt.Errorf("failed to marshal field scope: %w", err)
		}
		v.Add("scope", string(bs))
		v.Add("language_code", opts.LanguageCode)
	}
	r, err := bot.Get("deleteMyCommands", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
func (bot *Bot) DeleteStickerFromSet(sticker string) (bool, error) {
	v := urlLib.Values{}
	v.Add("sticker", sticker)
	r, err := bot.Get("deleteStickerFromSet", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type DeleteWebhookOpts struct {
	DropPendingUpdates bool
}
func (bot *Bot) DeleteWebhook(opts *DeleteWebhookOpts) (bool, error) {
	v := urlLib.Values{}
	if opts != nil {
		v.Add("drop_pending_updates", strconv.FormatBool(opts.DropPendingUpdates))
	}
	r, err := bot.Get("deleteWebhook", v)
	if err != nil {
		return false, err
	}
	var b bool
	return b, json.Unmarshal(r, &b)
}
type EditChatInviteLinkOpts struct {
	ExpireDate int64
	MemberLimit int64
}
func (bot *Bot) EditChatInviteLink(chatId int64, inviteLink string, opts *EditChatInviteLinkOpts) (*ChatInviteLink, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	v.Add("invite_link", inviteLink)
	if opts != nil {
		if opts.ExpireDate != 0 {
			v.Add("expire_date", strconv.FormatInt(opts.ExpireDate, 10))
		}
		if opts.MemberLimit != 0 {
			v.Add("member_limit", strconv.FormatInt(opts.MemberLimit, 10))
		}
	}
	r, err := bot.Get("editChatInviteLink", v)
	if err != nil {
		return nil, err
	}
	var c ChatInviteLink
	return &c, json.Unmarshal(r, &c)
}
type EditMessageCaptionOpts struct {
	ChatId int64
	MessageId int64
	InlineMessageId string
	Caption string
	ParseMode string
	CaptionEntities []MessageEntity
	ReplyMarkup InlineKeyboardMarkup
}
func (bot *Bot) EditMessageCaption(opts *EditMessageCaptionOpts) (*Message, error) {
	v := urlLib.Values{}
	if opts != nil {
		if opts.ChatId != 0 {
			v.Add("chat_id", strconv.FormatInt(opts.ChatId, 10))
		}
		if opts.MessageId != 0 {
			v.Add("message_id", strconv.FormatInt(opts.MessageId, 10))
		}
		v.Add("inline_message_id", opts.InlineMessageId)
		v.Add("caption", opts.Caption)
		v.Add("parse_mode", opts.ParseMode)
		if opts.CaptionEntities != nil {
			bs, err := json.Marshal(opts.CaptionEntities)
			if err != nil {
				return nil, fmt.Errorf("failed to marshal field caption_entities: %w", err)
			}
			v.Add("caption_entities", string(bs))
		}
		bs, err := json.Marshal(opts.ReplyMarkup)
		if err != nil {
			return nil, fmt.Errorf("failed to marshal field reply_markup: %w", err)
		}
		v.Add("reply_markup", string(bs))
	}
	r, err := bot.Get("editMessageCaption", v)
	if err != nil {
		return nil, err
	}
	var m Message
	return &m, json.Unmarshal(r, &m)
}
type EditMessageLiveLocationOpts struct {
	ChatId int64
	MessageId int64
	InlineMessageId string
	HorizontalAccuracy float64
	Heading int64
	ProximityAlertRadius int64
	ReplyMarkup InlineKeyboardMarkup
}
func (bot *Bot) EditMessageLiveLocation(latitude float64, longitude float64, opts *EditMessageLiveLocationOpts) (*Message, error) {
	v := urlLib.Values{}
	if latitude != 0.0 {
		v.Add("latitude", strconv.FormatFloat(latitude, 'f', -1, 64))
	}
	if longitude != 0.0 {
		v.Add("longitude", strconv.FormatFloat(longitude, 'f', -1, 64))
	}
	if opts != nil {
		if opts.ChatId != 0 {
			v.Add("chat_id", strconv.FormatInt(opts.ChatId, 10))
		}
		if opts.MessageId != 0 {
			v.Add("message_id", strconv.FormatInt(opts.MessageId, 10))
		}
		v.Add("inline_message_id", opts.InlineMessageId)
		if opts.HorizontalAccuracy != 0.0 {
			v.Add("horizontal_accuracy", strconv.FormatFloat(opts.HorizontalAccuracy, 'f', -1, 64))
		}
		if opts.Heading != 0 {
			v.Add("heading", strconv.FormatInt(opts.Heading, 10))
		}
		if opts.ProximityAlertRadius != 0 {
			v.Add("proximity_alert_radius", strconv.FormatInt(opts.ProximityAlertRadius, 10))
		}
		bs, err := json.Marshal(opts.ReplyMarkup)
		if err != nil {
			return nil, fmt.Errorf("failed to marshal field reply_markup: %w", err)
		}
		v.Add("reply_markup", string(bs))
	}
	r, err := bot.Get("editMessageLiveLocation", v)
	if err != nil {
		return nil, err
	}
	var m Message
	return &m, json.Unmarshal(r, &m)
}
type EditMessageMediaOpts struct {
	ChatId int64
	MessageId int64
	InlineMessageId string
	ReplyMarkup InlineKeyboardMarkup
}
func (bot *Bot) EditMessageMedia(media InputMedia, opts *EditMessageMediaOpts) (*Message, error) {
	v := urlLib.Values{}
	data := map[string]NamedReader{}
	inputMediaBs, err := media.InputMediaParams("media", data)
	if err != nil {
		return nil, fmt.Errorf("failed to marshal field media: %w", err)
	}
	v.Add("media", string(inputMediaBs))
	if opts != nil {
		if opts.ChatId != 0 {
			v.Add("chat_id", strconv.FormatInt(opts.ChatId, 10))
		}
		if opts.MessageId != 0 {
			v.Add("message_id", strconv.FormatInt(opts.MessageId, 10))
		}
		v.Add("inline_message_id", opts.InlineMessageId)
		bs, err := json.Marshal(opts.ReplyMarkup)
		if err != nil {
			return nil, fmt.Errorf("failed to marshal field reply_markup: %w", err)
		}
		v.Add("reply_markup", string(bs))
	}
	r, err := bot.Post("editMessageMedia", v, data)
	if err != nil {
		return nil, err
	}
	var m Message
	return &m, json.Unmarshal(r, &m)
}
type EditMessageReplyMarkupOpts struct {
	ChatId int64
	MessageId int64
	InlineMessageId string
	ReplyMarkup InlineKeyboardMarkup
}
func (bot *Bot) EditMessageReplyMarkup(opts *EditMessageReplyMarkupOpts) (*Message, error) {
	v := urlLib.Values{}
	if opts != nil {
		if opts.ChatId != 0 {
			v.Add("chat_id", strconv.FormatInt(opts.ChatId, 10))
		}
		if opts.MessageId != 0 {
			v.Add("message_id", strconv.FormatInt(opts.MessageId, 10))
		}
		v.Add("inline_message_id", opts.InlineMessageId)
		bs, err := json.Marshal(opts.ReplyMarkup)
		if err != nil {
			return nil, fmt.Errorf("failed to marshal field reply_markup: %w", err)
		}
		v.Add("reply_markup", string(bs))
	}
	r, err := bot.Get("editMessageReplyMarkup", v)
	if err != nil {
		return nil, err
	}
	var m Message
	return &m, json.Unmarshal(r, &m)
}
type EditMessageTextOpts struct {
	ChatId int64
	MessageId int64
	InlineMessageId string
	ParseMode string
	Entities []MessageEntity
	DisableWebPagePreview bool
	ReplyMarkup InlineKeyboardMarkup
}
func (bot *Bot) EditMessageText(text string, opts *EditMessageTextOpts) (*Message, error) {
	v := urlLib.Values{}
	v.Add("text", text)
	if opts != nil {
		if opts.ChatId != 0 {
			v.Add("chat_id", strconv.FormatInt(opts.ChatId, 10))
		}
		if opts.MessageId != 0 {
			v.Add("message_id", strconv.FormatInt(opts.MessageId, 10))
		}
		v.Add("inline_message_id", opts.InlineMessageId)
		v.Add("parse_mode", opts.ParseMode)
		if opts.Entities != nil {
			bs, err := json.Marshal(opts.Entities)
			if err != nil {
				return nil, fmt.Errorf("failed to marshal field entities: %w", err)
			}
			v.Add("entities", string(bs))
		}
		v.Add("disable_web_page_preview", strconv.FormatBool(opts.DisableWebPagePreview))
		bs, err := json.Marshal(opts.ReplyMarkup)
		if err != nil {
			return nil, fmt.Errorf("failed to marshal field reply_markup: %w", err)
		}
		v.Add("reply_markup", string(bs))
	}
	r, err := bot.Get("editMessageText", v)
	if err != nil {
		return nil, err
	}
	var m Message
	return &m, json.Unmarshal(r, &m)
}
func (bot *Bot) ExportChatInviteLink(chatId int64) (string, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	r, err := bot.Get("exportChatInviteLink", v)
	if err != nil {
		return "", err
	}
	var s string
	return s, json.Unmarshal(r, &s)
}
type ForwardMessageOpts struct {
	DisableNotification bool
}
func (bot *Bot) ForwardMessage(chatId int64, fromChatId int64, messageId int64, opts *ForwardMessageOpts) (*Message, error) {
	v := urlLib.Values{}
	if chatId != 0 {
		v.Add("chat_id", strconv.FormatInt(chatId, 10))
	}
	if fromChatId != 0 {
		v.Add("from_chat_id", strconv.FormatInt(fromChatId, 10))
	}
	if messageId != 0 {
		v.Add("message_id", strconv.FormatInt(messageId, 10))
	}
	if opts != nil {
		v.Add("disable_notification", strconv.FormatBool(opts.DisableNotification))
	}
	r, err := bot.Get("forwardMessage", v)
	if err != nil {
		return nil, err
	}
	var m Message
	return &m, json.Unmarshal(r, &m)
}