tg

package module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 24 Imported by: 7

README ¶

go-tg

Go Reference go.mod GitHub release (latest by date) Telegram Bot API CI codecov Go Report Card beta

go-tg is a Go client library for accessing Telegram Bot API, with batteries for building complex bots included.

Features

  • Code for Bot API types and methods is generated with embedded official documentation.
  • Support context.Context.
  • API Client and bot framework are strictly separated, you can use them independently.
  • No runtime reflection overhead.
  • Supports Webhook and Polling natively;
  • Handlers, filters, and middleware are supported.
  • WebApps and Login Widget helpers.

Install

go get -u github.com/mr-linch/go-tg

Quick Example

package main

import (
	"context"
	"fmt"
	"os"
	"os/signal"
	"regexp"
	"syscall"
	"time"

	"github.com/mr-linch/go-tg"
	"github.com/mr-linch/go-tg/tgb"
)

func main() {
	ctx := context.Background()

	ctx, cancel := signal.NotifyContext(ctx, os.Interrupt, os.Kill, syscall.SIGTERM)
	defer cancel()

	if err := run(ctx); err != nil {
		fmt.Println(err)
		defer os.Exit(1)
	}
}

func run(ctx context.Context) error {
	client := tg.New(os.Getenv("BOT_TOKEN"))

	router := tgb.NewRouter().
		// handles /start and /help
		Message(func(ctx context.Context, msg *tgb.MessageUpdate) error {
			return msg.Answer(
				tg.HTML.Text(
					tg.HTML.Bold("đź‘‹ Hi, I'm echo bot!"),
					"",
					tg.HTML.Italic("🚀 Powered by", tg.HTML.Spoiler(tg.HTML.Link("go-tg", "github.com/mr-linch/go-tg"))),
				),
			).ParseMode(tg.HTML).DoVoid(ctx)
		}, tgb.Command("start", tgb.WithCommandAlias("help"))).
		// handles gopher image
		Message(func(ctx context.Context, msg *tgb.MessageUpdate) error {
			if err := msg.Update.Respond(ctx, msg.AnswerChatAction(tg.ChatActionUploadPhoto)); err != nil {
				return fmt.Errorf("answer chat action: %w", err)
			}

			// emulate thinking :)
			time.Sleep(time.Second)

			return msg.AnswerPhoto(tg.FileArg{
				URL: "https://go.dev/blog/go-brand/Go-Logo/PNG/Go-Logo_Blue.png",
			}).DoVoid(ctx)

		}, tgb.Regexp(regexp.MustCompile(`(?mi)(go|golang|gopher)[$\s+]?`))).
		// handle other messages
		Message(func(ctx context.Context, msg *tgb.MessageUpdate) error {
			return msg.Copy(msg.Chat).DoVoid(ctx)
		})

	return tgb.NewPoller(
		router,
		client,
	).Run(ctx)
}

More examples can be found in examples.

API Client

Creating

The simplest way for create client it's call tg.New with token. That constructor use http.DefaultClient as default client and api.telegram.org as server URL:

client := tg.New("<TOKEN>") // from @BotFather

With custom http.Client:

proxyURL, err := url.Parse("http://user:pass@ip:port")
if err != nil {
  return err
}

httpClient := &http.Client{
  Transport: &http.Transport{
    Proxy: http.ProxyURL(proxyURL),
  },
}

client := tg.New("<TOKEN>",
 tg.WithClientDoer(httpClient),
)

With self hosted Bot API server:

client := tg.New("<TOKEN>",
 tg.WithClientServerURL("http://localhost:8080"),
)
Bot API methods

All API methods are supported with embedded official documentation. It's provided via Client methods.

e.g. getMe call:

me, err := client.GetMe().Do(ctx)
if err != nil {
 return err
}

log.Printf("authorized as @%s", me.Username)

sendMessage call with required and optional arguments:

peer := tg.Username("MrLinch")

msg, err := client.SendMessage(peer, "<b>Hello, world!</b>").
  ParseMode(tg.HTML). // optional passed like this
  Do(ctx)

if err != nil {
  return err
}

log.Printf("sended message id %d", msg.ID)

Some Bot API methods do not return the object and just say True. So, you should use the DoVoid method to execute calls like that.

All calls with the returned object also have the DoVoid method. Use it when you do not care about the result, just ensure it's not an error (unmarshaling also be skipped).

peer := tg.Username("MrLinch")

if err := client.SendChatAction(
  peer,
  tg.ChatActionTyping
).DoVoid(ctx); err != nil {
  return err
}
Low-level Bot API methods call

Client has method Do for low-level requests execution:

req := tg.NewRequest("sendChatAction").
  PeerID("chat_id", tg.Username("@MrLinch")).
  String("action", "typing")

if err := client.Do(ctx, req, nil); err != nil {
  return err
}
Helper methods

Method Client.Me() fetches authorized bot info via Client.GetMe() and cache it between calls.

me, err := client.Me(ctx)
if err != nil {
  return err
}
Working with Files 🚧

Updates

Everything related to receiving and processing updates is in the tgb package.

Handlers

You can create an update handler in three ways:

  1. Declare the structure that implements the interface tgb.Handler:
type MyHandler struct {}

func (h *MyHandler) Handle(ctx context.Context, update *tgb.Update) error {
  if update.Message != nil {
    return nil
  }

 log.Printf("update id: %d, message id: %d", update.ID, update.Message.ID)

 return nil
}
  1. Wrap the function to the type tgb.HandlerFunc:
var handler tgb.Handler = tgb.HandlerFunc(func(ctx context.Context, update *tgb.Update) error {
 // skip updates of other types
 if update.Message == nil {
  return nil
 }

 log.Printf("update id: %d, message id: %d", update.ID, update.Message.ID)

 return nil
})
  1. Wrap the function to the type tgb.*Handler for creating typed handlers with null pointer check:
// that handler will be called only for messages
// other updates will be ignored
var handler tgb.Handler = tgb.MessageHandler(func(ctx context.Context, mu *tgb.MessageUpdate) error {
  log.Printf("update id: %d, message id: %d", mu.Update.ID, mu.ID)
  return nil
})
Typed Handlers

For each subtype (field) of tg.Update you can create a typed handler.

Typed handlers it's not about routing updates but about handling them. These handlers will only be called for updates of a certain type, the rest will be skipped. Also, they implement the tgb.Handler interface.

List of typed handlers:

tgb.*Updates has many useful methods for "answer" the update, please checkout godoc by links above.

Receive updates via Polling

Use tgb.NewPoller to create a poller with specified tg.Client and tgb.Handler. Also accepts tgb.PollerOption for customizing the poller.

handler := tgb.HandlerFunc(func(ctx context.Context, update *tgb.Update) error {
  // ...
})

poller := tgb.NewPoller(handler, client,
  // recieve max 100 updates in a batch
  tgb.WithPollerLimit(100),
)

// polling will be stopped on context cancel
if err := poller.Run(ctx); err != nil {
  return err
}

Receive updates via Webhook

Webhook handler and server can be created by tgb.NewWebhook. That function has following arguments:

  • handler - tgb.Handler for handling updates;
  • client - tg.Client for making setup requests;
  • url - full url of the webhook server
  • optional options - tgb.WebhookOption for customizing the webhook.

Webhook has several security checks that are enabled by default:

  • Check if the IP of the sender is in the allowed ranges.
  • Check if the request has a valid security token header. By default, the token is the SHA256 hash of the Telegram Bot API token.

ℹ️ That checks can be disabled by passing tgb.WithWebhookSecurityToken(""), tgb.WithWebhookSecuritySubnets() when creating the webhook.

⚠️ At the moment, the webhook does not integrate custom certificate. So, you should handle HTTPS requests on load balancer.

handler := tgb.HandlerFunc(func(ctx context.Context, update *tgb.Update) error {
   // ...
})


webhook := tgb.NewWebhook(handler, client, "https://bot.com/webhook",
  tgb.WithDropPendingUpdates(true),
)

// configure telegram webhook and start HTTP server.
// the server will be stopped on context cancel.
if err := webhook.Run(ctx, ":8080"); err != nil {
  return err
}

Webhook is a regular http.Handler that can be used in any HTTP-compatible router. But you should call Webhook.Setup before starting the server to configure the webhook on the Telegram side.

e.g. integration with chi router

handler := tgb.HandlerFunc(func(ctx context.Context, update *tgb.Update) error {
  // ...
})

webhook := tgb.NewWebhook(handler, client, "https://bot.com/webhook",
  tgb.WithDropPendingUpdates(true),
)

// get current webhook configuration and sync it if needed.
if err := webhook.Setup(ctx); err != nil {
  return err
}

r := chi.NewRouter()

r.Get("/webhook", webhook)

http.ListenAndServe(":8080", r)

Routing updates 🚧

Parse Mode 🚧

Thanks 🚧

Documentation ¶

Overview ¶

Package tg contains a low level API to interact with Telegram Bot API.

Index ¶

Constants ¶

This section is empty.

Variables ¶

This section is empty.

Functions ¶

func NewButtonColumn ¶ added in v0.0.2

func NewButtonColumn[T Button](buttons ...T) [][]T

NewButtonColumn returns keyboard from a single column of Button.

func NewButtonRow ¶ added in v0.0.2

func NewButtonRow[T Button](buttons ...T) []T

NewButtonRow it's generic helper for create keyboards in functional way.

Types ¶

type AddStickerToSetCall ¶

type AddStickerToSetCall struct {
	CallNoResult
}

AddStickerToSetCall reprenesents a call to the addStickerToSet method. Use this method to add a new sticker to a set created by the bot You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker Animated stickers can be added to animated sticker sets and only to them Animated sticker sets can have up to 50 stickers Static sticker sets can have up to 120 stickers

func NewAddStickerToSetCall ¶

func NewAddStickerToSetCall(userID UserID, name string, emojis string) *AddStickerToSetCall

NewAddStickerToSetCall constructs a new AddStickerToSetCall with required parameters. userID - User identifier of sticker set owner name - Sticker set name emojis - One or more emoji corresponding to the sticker

func (*AddStickerToSetCall) Emojis ¶

func (call *AddStickerToSetCall) Emojis(emojis string) *AddStickerToSetCall

Emojis One or more emoji corresponding to the sticker

func (*AddStickerToSetCall) MaskPosition ¶

func (call *AddStickerToSetCall) MaskPosition(maskPosition MaskPosition) *AddStickerToSetCall

MaskPosition A JSON-serialized object for position where the mask should be placed on faces

func (*AddStickerToSetCall) Name ¶

Name Sticker set name

func (*AddStickerToSetCall) PNGSticker ¶ added in v0.0.5

func (call *AddStickerToSetCall) PNGSticker(pngSticker FileArg) *AddStickerToSetCall

PNGSticker PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*AddStickerToSetCall) TGSSticker ¶ added in v0.0.5

func (call *AddStickerToSetCall) TGSSticker(tgsSticker InputFile) *AddStickerToSetCall

TGSSticker TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements

func (*AddStickerToSetCall) UserID ¶ added in v0.0.5

func (call *AddStickerToSetCall) UserID(userID UserID) *AddStickerToSetCall

UserID User identifier of sticker set owner

func (*AddStickerToSetCall) WEBMSticker ¶ added in v0.0.5

func (call *AddStickerToSetCall) WEBMSticker(webmSticker InputFile) *AddStickerToSetCall

WEBMSticker WEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements

type Animation ¶

type Animation struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Video width as defined by sender
	Width int `json:"width"`

	// Video height as defined by sender
	Height int `json:"height"`

	// Duration of the video in seconds as defined by sender
	Duration int `json:"duration"`

	// Optional. Animation thumbnail as defined by sender
	Thumb *PhotoSize `json:"thumb,omitempty"`

	// Optional. Original animation filename as defined by sender
	FileName string `json:"file_name,omitempty"`

	// Optional. MIME type of the file as defined by sender
	MIMEType string `json:"mime_type,omitempty"`

	// Optional. File size in bytes.
	FileSize int64 `json:"file_size,omitempty"`
}

Animation this object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

type AnswerCallbackQueryCall ¶

type AnswerCallbackQueryCall struct {
	CallNoResult
}

AnswerCallbackQueryCall reprenesents a call to the answerCallbackQuery method. Use this method to send answers to callback queries sent from inline keyboards The answer will be displayed to the user as a notification at the top of the chat screen or as an alert On success, True is returned. Alternatively, the user can be redirected to the specified Game URL For this option to work, you must first create a game for your bot via @BotFather and accept the terms Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

func NewAnswerCallbackQueryCall ¶

func NewAnswerCallbackQueryCall(callbackQueryID string) *AnswerCallbackQueryCall

NewAnswerCallbackQueryCall constructs a new AnswerCallbackQueryCall with required parameters. callbackQueryID - Unique identifier for the query to be answered

func (*AnswerCallbackQueryCall) CacheTime ¶

func (call *AnswerCallbackQueryCall) CacheTime(cacheTime int) *AnswerCallbackQueryCall

CacheTime The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.

func (*AnswerCallbackQueryCall) CallbackQueryID ¶ added in v0.0.5

func (call *AnswerCallbackQueryCall) CallbackQueryID(callbackQueryID string) *AnswerCallbackQueryCall

CallbackQueryID Unique identifier for the query to be answered

func (*AnswerCallbackQueryCall) ShowAlert ¶

func (call *AnswerCallbackQueryCall) ShowAlert(showAlert bool) *AnswerCallbackQueryCall

ShowAlert If True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.

func (*AnswerCallbackQueryCall) Text ¶

Text Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters

func (*AnswerCallbackQueryCall) URL ¶ added in v0.0.5

URL URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button.Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

type AnswerInlineQueryCall ¶

type AnswerInlineQueryCall struct {
	CallNoResult
}

AnswerInlineQueryCall reprenesents a call to the answerInlineQuery method. Use this method to send answers to an inline query On success, True is returned.No more than 50 results per query are allowed.

func NewAnswerInlineQueryCall ¶

func NewAnswerInlineQueryCall(inlineQueryID string, results []InlineQueryResult) *AnswerInlineQueryCall

NewAnswerInlineQueryCall constructs a new AnswerInlineQueryCall with required parameters. inlineQueryID - Unique identifier for the answered query results - A JSON-serialized array of results for the inline query

func (*AnswerInlineQueryCall) CacheTime ¶

func (call *AnswerInlineQueryCall) CacheTime(cacheTime int) *AnswerInlineQueryCall

CacheTime The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.

func (*AnswerInlineQueryCall) InlineQueryID ¶ added in v0.0.5

func (call *AnswerInlineQueryCall) InlineQueryID(inlineQueryID string) *AnswerInlineQueryCall

InlineQueryID Unique identifier for the answered query

func (*AnswerInlineQueryCall) IsPersonal ¶

func (call *AnswerInlineQueryCall) IsPersonal(isPersonal bool) *AnswerInlineQueryCall

IsPersonal Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query

func (*AnswerInlineQueryCall) NextOffset ¶

func (call *AnswerInlineQueryCall) NextOffset(nextOffset string) *AnswerInlineQueryCall

NextOffset Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.

func (*AnswerInlineQueryCall) Results ¶

Results A JSON-serialized array of results for the inline query

func (*AnswerInlineQueryCall) SwitchPmParameter ¶

func (call *AnswerInlineQueryCall) SwitchPmParameter(switchPmParameter string) *AnswerInlineQueryCall

SwitchPmParameter Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.

func (*AnswerInlineQueryCall) SwitchPmText ¶

func (call *AnswerInlineQueryCall) SwitchPmText(switchPmText string) *AnswerInlineQueryCall

SwitchPmText If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter

type AnswerPreCheckoutQueryCall ¶

type AnswerPreCheckoutQueryCall struct {
	CallNoResult
}

AnswerPreCheckoutQueryCall reprenesents a call to the answerPreCheckoutQuery method. Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query Use this method to respond to such pre-checkout queries On success, True is returned Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

func NewAnswerPreCheckoutQueryCall ¶

func NewAnswerPreCheckoutQueryCall(preCheckoutQueryID string, ok bool) *AnswerPreCheckoutQueryCall

NewAnswerPreCheckoutQueryCall constructs a new AnswerPreCheckoutQueryCall with required parameters. preCheckoutQueryID - Unique identifier for the query to be answered ok - Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.

func (*AnswerPreCheckoutQueryCall) ErrorMessage ¶

func (call *AnswerPreCheckoutQueryCall) ErrorMessage(errorMessage string) *AnswerPreCheckoutQueryCall

ErrorMessage Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.

func (*AnswerPreCheckoutQueryCall) Ok ¶

Ok Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.

func (*AnswerPreCheckoutQueryCall) PreCheckoutQueryID ¶ added in v0.0.5

func (call *AnswerPreCheckoutQueryCall) PreCheckoutQueryID(preCheckoutQueryID string) *AnswerPreCheckoutQueryCall

PreCheckoutQueryID Unique identifier for the query to be answered

type AnswerShippingQueryCall ¶

type AnswerShippingQueryCall struct {
	CallNoResult
}

AnswerShippingQueryCall reprenesents a call to the answerShippingQuery method. If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot Use this method to reply to shipping queries On success, True is returned.

func NewAnswerShippingQueryCall ¶

func NewAnswerShippingQueryCall(shippingQueryID string, ok bool) *AnswerShippingQueryCall

NewAnswerShippingQueryCall constructs a new AnswerShippingQueryCall with required parameters. shippingQueryID - Unique identifier for the query to be answered ok - Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)

func (*AnswerShippingQueryCall) ErrorMessage ¶

func (call *AnswerShippingQueryCall) ErrorMessage(errorMessage string) *AnswerShippingQueryCall

ErrorMessage Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.

func (*AnswerShippingQueryCall) Ok ¶

Ok Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)

func (*AnswerShippingQueryCall) ShippingOptions ¶

func (call *AnswerShippingQueryCall) ShippingOptions(shippingOptions []ShippingOption) *AnswerShippingQueryCall

ShippingOptions Required if ok is True. A JSON-serialized array of available shipping options.

func (*AnswerShippingQueryCall) ShippingQueryID ¶ added in v0.0.5

func (call *AnswerShippingQueryCall) ShippingQueryID(shippingQueryID string) *AnswerShippingQueryCall

ShippingQueryID Unique identifier for the query to be answered

type AnswerWebAppQueryCall ¶

type AnswerWebAppQueryCall struct {
	Call[SentWebAppMessage]
}

AnswerWebAppQueryCall reprenesents a call to the answerWebAppQuery method. Use this method to set the result of an interaction with a Web App and send a corresponding message on behalf of the user to the chat from which the query originated On success, a SentWebAppMessage object is returned.

func NewAnswerWebAppQueryCall ¶

func NewAnswerWebAppQueryCall(webAppQueryID string, result InlineQueryResult) *AnswerWebAppQueryCall

NewAnswerWebAppQueryCall constructs a new AnswerWebAppQueryCall with required parameters. webAppQueryID - Unique identifier for the query to be answered result - A JSON-serialized object describing the message to be sent

func (*AnswerWebAppQueryCall) Result ¶

Result A JSON-serialized object describing the message to be sent

func (*AnswerWebAppQueryCall) WebAppQueryID ¶ added in v0.0.5

func (call *AnswerWebAppQueryCall) WebAppQueryID(webAppQueryID string) *AnswerWebAppQueryCall

WebAppQueryID Unique identifier for the query to be answered

type ApproveChatJoinRequestCall ¶

type ApproveChatJoinRequestCall struct {
	CallNoResult
}

ApproveChatJoinRequestCall reprenesents a call to the approveChatJoinRequest method. Use this method to approve a chat join request The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right

func NewApproveChatJoinRequestCall ¶

func NewApproveChatJoinRequestCall(chatID PeerID, userID UserID) *ApproveChatJoinRequestCall

NewApproveChatJoinRequestCall constructs a new ApproveChatJoinRequestCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) userID - Unique identifier of the target user

func (*ApproveChatJoinRequestCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*ApproveChatJoinRequestCall) UserID ¶ added in v0.0.5

UserID Unique identifier of the target user

type Audio ¶

type Audio struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Duration of the audio in seconds as defined by sender
	Duration int `json:"duration"`

	// Optional. Performer of the audio as defined by sender or by audio tags
	Performer string `json:"performer,omitempty"`

	// Optional. Title of the audio as defined by sender or by audio tags
	Title string `json:"title,omitempty"`

	// Optional. Original filename as defined by sender
	FileName string `json:"file_name,omitempty"`

	// Optional. MIME type of the file as defined by sender
	MIMEType string `json:"mime_type,omitempty"`

	// Optional. File size in bytes.
	FileSize int64 `json:"file_size,omitempty"`

	// Optional. Thumbnail of the album cover to which the music file belongs
	Thumb *PhotoSize `json:"thumb,omitempty"`
}

Audio this object represents an audio file to be treated as music by the Telegram clients.

type AuthWidget ¶ added in v0.0.5

type AuthWidget struct {
	ID        UserID `json:"id"`
	FirstName string `json:"first_name"`
	LastName  string `json:"last_name,omitempty"`
	Username  string `json:"username,omitempty"`
	PhotoURL  string `json:"photo_url,omitempty"`
	AuthDate  int64  `json:"auth_date"`
	Hash      string `json:"hash"`
}

AuthWidget represents Telegram Login Widget data.

See https://core.telegram.org/widgets/login#receiving-authorization-data for more information.

func ParseAuthWidgetQuery ¶ added in v0.0.5

func ParseAuthWidgetQuery(vs url.Values) (*AuthWidget, error)

ParseAuthWidgetQuery parses a query string and returns an AuthWidget.

func (AuthWidget) AuthDateTime ¶ added in v0.0.5

func (w AuthWidget) AuthDateTime() time.Time

AuthDateTime returns the AuthDate as a time.Time.

func (AuthWidget) Query ¶ added in v0.0.5

func (w AuthWidget) Query() url.Values

Query returns a query values for the widget.

func (AuthWidget) Signature ¶ added in v0.0.5

func (w AuthWidget) Signature(token string) string

Signature returns the signature of the widget data.

func (AuthWidget) Valid ¶ added in v0.0.5

func (w AuthWidget) Valid(token string) bool

Valid returns true if the signature is valid.

type BanChatMemberCall ¶

type BanChatMemberCall struct {
	CallNoResult
}

BanChatMemberCall reprenesents a call to the banChatMember method. Use this method to ban a user in a group, a supergroup or a channel In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights

func NewBanChatMemberCall ¶

func NewBanChatMemberCall(chatID PeerID, userID UserID) *BanChatMemberCall

NewBanChatMemberCall constructs a new BanChatMemberCall with required parameters. chatID - Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) userID - Unique identifier of the target user

func (*BanChatMemberCall) ChatID ¶ added in v0.0.5

func (call *BanChatMemberCall) ChatID(chatID PeerID) *BanChatMemberCall

ChatID Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)

func (*BanChatMemberCall) RevokeMessages ¶

func (call *BanChatMemberCall) RevokeMessages(revokeMessages bool) *BanChatMemberCall

RevokeMessages Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.

func (*BanChatMemberCall) UntilDate ¶

func (call *BanChatMemberCall) UntilDate(untilDate int) *BanChatMemberCall

UntilDate Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.

func (*BanChatMemberCall) UserID ¶ added in v0.0.5

func (call *BanChatMemberCall) UserID(userID UserID) *BanChatMemberCall

UserID Unique identifier of the target user

type BanChatSenderChatCall ¶

type BanChatSenderChatCall struct {
	CallNoResult
}

BanChatSenderChatCall reprenesents a call to the banChatSenderChat method. Use this method to ban a channel chat in a supergroup or a channel Until the chat is unbanned, the owner of the banned chat won't be able to send messages on behalf of any of their channels The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights

func NewBanChatSenderChatCall ¶

func NewBanChatSenderChatCall(chatID PeerID, senderChatID int) *BanChatSenderChatCall

NewBanChatSenderChatCall constructs a new BanChatSenderChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) senderChatID - Unique identifier of the target sender chat

func (*BanChatSenderChatCall) ChatID ¶ added in v0.0.5

func (call *BanChatSenderChatCall) ChatID(chatID PeerID) *BanChatSenderChatCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*BanChatSenderChatCall) SenderChatID ¶ added in v0.0.5

func (call *BanChatSenderChatCall) SenderChatID(senderChatID int) *BanChatSenderChatCall

SenderChatID Unique identifier of the target sender chat

type BotCommand ¶

type BotCommand struct {
	// Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.
	Command string `json:"command"`

	// Description of the command; 1-256 characters.
	Description string `json:"description"`
}

BotCommand this object represents a bot command.

type BotCommandScope ¶

type BotCommandScope interface {
	json.Marshaler
	// contains filtered or unexported methods
}

type BotCommandScopeAllChatAdministrators ¶

type BotCommandScopeAllChatAdministrators struct {
	// Scope type, must be all_chat_administrators
	Type string `json:"type"`
}

BotCommandScopeAllChatAdministrators represents the scope of bot commands, covering all group and supergroup chat administrators.

func (BotCommandScopeAllChatAdministrators) MarshalJSON ¶ added in v0.0.5

func (scope BotCommandScopeAllChatAdministrators) MarshalJSON() ([]byte, error)

type BotCommandScopeAllGroupChats ¶

type BotCommandScopeAllGroupChats struct {
	// Scope type, must be all_group_chats
	Type string `json:"type"`
}

BotCommandScopeAllGroupChats represents the scope of bot commands, covering all group and supergroup chats.

func (BotCommandScopeAllGroupChats) MarshalJSON ¶ added in v0.0.5

func (scope BotCommandScopeAllGroupChats) MarshalJSON() ([]byte, error)

type BotCommandScopeAllPrivateChats ¶

type BotCommandScopeAllPrivateChats struct {
	// Scope type, must be all_private_chats
	Type string `json:"type"`
}

BotCommandScopeAllPrivateChats represents the scope of bot commands, covering all private chats.

func (BotCommandScopeAllPrivateChats) MarshalJSON ¶ added in v0.0.5

func (scope BotCommandScopeAllPrivateChats) MarshalJSON() ([]byte, error)

type BotCommandScopeChat ¶

type BotCommandScopeChat struct {
	// Scope type, must be chat
	Type string `json:"type"`

	// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
	ChatID ChatID `json:"chat_id"`
}

BotCommandScopeChat represents the scope of bot commands, covering a specific chat.

func (BotCommandScopeChat) MarshalJSON ¶ added in v0.0.5

func (scope BotCommandScopeChat) MarshalJSON() ([]byte, error)

type BotCommandScopeChatAdministrators ¶

type BotCommandScopeChatAdministrators struct {
	// Scope type, must be chat_administrators
	Type string `json:"type"`

	// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
	ChatID ChatID `json:"chat_id"`
}

BotCommandScopeChatAdministrators represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.

func (BotCommandScopeChatAdministrators) MarshalJSON ¶ added in v0.0.5

func (scope BotCommandScopeChatAdministrators) MarshalJSON() ([]byte, error)

type BotCommandScopeChatMember ¶

type BotCommandScopeChatMember struct {
	// Scope type, must be chat_member
	Type string `json:"type"`

	// Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
	ChatID ChatID `json:"chat_id"`

	// Unique identifier of the target user
	UserID int `json:"user_id"`
}

BotCommandScopeChatMember represents the scope of bot commands, covering a specific member of a group or supergroup chat.

func (BotCommandScopeChatMember) MarshalJSON ¶ added in v0.0.5

func (scope BotCommandScopeChatMember) MarshalJSON() ([]byte, error)

type BotCommandScopeDefault ¶

type BotCommandScopeDefault struct {
	// Scope type, must be default
	Type string `json:"type"`
}

BotCommandScopeDefault represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.

func (BotCommandScopeDefault) MarshalJSON ¶ added in v0.0.5

func (scope BotCommandScopeDefault) MarshalJSON() ([]byte, error)

type Button ¶ added in v0.0.2

type Button interface {
	InlineKeyboardButton | KeyboardButton
}

Button define generic button interface

type ButtonLayout ¶ added in v0.0.2

type ButtonLayout[T Button] struct {
	// contains filtered or unexported fields
}

ButtonLayout it's build for fixed width keyboards.

func NewButtonLayout ¶ added in v0.0.2

func NewButtonLayout[T Button](rowWidth int, buttons ...T) *ButtonLayout[T]

NewButtonLayout creates layout with specified width. Buttons will be added via Insert method.

func (*ButtonLayout[T]) Add ¶ added in v0.0.2

func (layout *ButtonLayout[T]) Add(buttons ...T) *ButtonLayout[T]

Add accepts any number of buttons, always starts adding from a new row and adds a row when it reaches the set width.

func (*ButtonLayout[T]) Insert ¶ added in v0.0.2

func (layout *ButtonLayout[T]) Insert(buttons ...T) *ButtonLayout[T]

Insert buttons to last row if possible, or create new and insert.

func (*ButtonLayout[T]) Keyboard ¶ added in v0.0.2

func (layout *ButtonLayout[T]) Keyboard() [][]T

Keyboard returns result of building.

func (*ButtonLayout[T]) Row ¶ added in v0.0.2

func (layout *ButtonLayout[T]) Row(buttons ...T) *ButtonLayout[T]

Row add new row with no respect for row width

type Call ¶

type Call[T any] struct {
	// contains filtered or unexported fields
}

func (*Call[T]) Bind ¶

func (call *Call[T]) Bind(client *Client)

func (*Call[T]) Do ¶

func (call *Call[T]) Do(ctx context.Context) (result T, err error)

func (*Call[T]) DoVoid ¶ added in v0.0.3

func (call *Call[T]) DoVoid(ctx context.Context) (err error)

func (*Call[T]) MarshalJSON ¶

func (call *Call[T]) MarshalJSON() ([]byte, error)

func (*Call[T]) Request ¶ added in v0.0.3

func (call *Call[T]) Request() *Request

type CallNoResult ¶

type CallNoResult struct {
	// contains filtered or unexported fields
}

func (*CallNoResult) Bind ¶

func (call *CallNoResult) Bind(client *Client)

func (*CallNoResult) DoVoid ¶ added in v0.0.3

func (call *CallNoResult) DoVoid(ctx context.Context) (err error)

func (*CallNoResult) MarshalJSON ¶

func (call *CallNoResult) MarshalJSON() ([]byte, error)

func (*CallNoResult) Request ¶ added in v0.0.3

func (call *CallNoResult) Request() *Request

type CallbackGame ¶

type CallbackGame struct{}

type CallbackQuery ¶

type CallbackQuery struct {
	// Unique identifier for this query
	ID string `json:"id"`

	// Sender
	From User `json:"from"`

	// Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old
	Message *Message `json:"message,omitempty"`

	// Optional. Identifier of the message sent via the bot in inline mode, that originated the query.
	InlineMessageID string `json:"inline_message_id,omitempty"`

	// Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
	ChatInstance string `json:"chat_instance"`

	// Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data.
	Data string `json:"data,omitempty"`

	// Optional. Short name of a Game to be returned, serves as the unique identifier for the game
	GameShortName string `json:"game_short_name,omitempty"`
}

CallbackQuery this object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

type Chat ¶

type Chat struct {
	// Unique identifier for this chat.
	ID ChatID `json:"id"`

	// Type of chat, can be either “private”, “group”, “supergroup” or “channel”
	Type ChatType `json:"type"`

	// Optional. Title, for supergroups, channels and group chats
	Title string `json:"title,omitempty"`

	// Optional. Username, for private chats, supergroups and channels if available
	Username Username `json:"username,omitempty"`

	// Optional. First name of the other party in a private chat
	FirstName string `json:"first_name,omitempty"`

	// Optional. Last name of the other party in a private chat
	LastName string `json:"last_name,omitempty"`

	// Optional. Chat photo. Returned only in getChat.
	Photo *ChatPhoto `json:"photo,omitempty"`

	// Optional. Bio of the other party in a private chat. Returned only in getChat.
	Bio string `json:"bio,omitempty"`

	// Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
	HasPrivateForwards bool `json:"has_private_forwards,omitempty"`

	// Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.
	JoinToSendMessages bool `json:"join_to_send_messages,omitempty"`

	// Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.
	JoinByRequest bool `json:"join_by_request,omitempty"`

	// Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.
	Description string `json:"description,omitempty"`

	// Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.
	InviteLink string `json:"invite_link,omitempty"`

	// Optional. The most recent pinned message (by sending date). Returned only in getChat.
	PinnedMessage *Message `json:"pinned_message,omitempty"`

	// Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
	Permissions *ChatPermissions `json:"permissions,omitempty"`

	// Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat.
	SlowModeDelay int `json:"slow_mode_delay,omitempty"`

	// Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
	MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"`

	// Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
	HasProtectedContent bool `json:"has_protected_content,omitempty"`

	// Optional. For supergroups, name of group sticker set. Returned only in getChat.
	StickerSetName string `json:"sticker_set_name,omitempty"`

	// Optional. True, if the bot can change the group sticker set. Returned only in getChat.
	CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"`

	// Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats.  Returned only in getChat.
	LinkedChatID int64 `json:"linked_chat_id,omitempty"`

	// Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
	Location *ChatLocation `json:"location,omitempty"`
}

Chat this object represents a chat.

func (Chat) PeerID ¶

func (chat Chat) PeerID() string

type ChatAction ¶ added in v0.0.4

type ChatAction int8

ChatAction type of action to broadcast via sendChatAction.

const (
	ChatActionTyping ChatAction = iota + 1
	ChatActionUploadPhoto
	ChatActionRecordVideo
	ChatActionUploadVideo
	ChatActionRecordVoice
	ChatActionUploadVoice
	ChatActionUploadDocument
	ChatActionChooseSticker
	ChatActionFindLocation
	ChatActionRecordVideoNote
	ChatActionUploadVideoNote
)

func (ChatAction) String ¶ added in v0.0.4

func (action ChatAction) String() string

type ChatAdministratorRights ¶

type ChatAdministratorRights struct {
	// True, if the user's presence in the chat is hidden
	IsAnonymous bool `json:"is_anonymous"`

	// True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
	CanManageChat bool `json:"can_manage_chat"`

	// True, if the administrator can delete messages of other users
	CanDeleteMessages bool `json:"can_delete_messages"`

	// True, if the administrator can manage video chats
	CanManageVideoChats bool `json:"can_manage_video_chats"`

	// True, if the administrator can restrict, ban or unban chat members
	CanRestrictMembers bool `json:"can_restrict_members"`

	// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
	CanPromoteMembers bool `json:"can_promote_members"`

	// True, if the user is allowed to change the chat title, photo and other settings
	CanChangeInfo bool `json:"can_change_info"`

	// True, if the user is allowed to invite new users to the chat
	CanInviteUsers bool `json:"can_invite_users"`

	// Optional. True, if the administrator can post in the channel; channels only
	CanPostMessages bool `json:"can_post_messages,omitempty"`

	// Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
	CanEditMessages bool `json:"can_edit_messages,omitempty"`

	// Optional. True, if the user is allowed to pin messages; groups and supergroups only
	CanPinMessages bool `json:"can_pin_messages,omitempty"`
}

ChatAdministratorRights represents the rights of an administrator in a chat.

type ChatID ¶

type ChatID int64

func (ChatID) PeerID ¶

func (id ChatID) PeerID() string
type ChatInviteLink struct {
	// The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
	InviteLink string `json:"invite_link"`

	// Creator of the link
	Creator User `json:"creator"`

	// True, if users joining the chat via the link need to be approved by chat administrators
	CreatesJoinRequest bool `json:"creates_join_request"`

	// True, if the link is primary
	IsPrimary bool `json:"is_primary"`

	// True, if the link is revoked
	IsRevoked bool `json:"is_revoked"`

	// Optional. Invite link name
	Name string `json:"name,omitempty"`

	// Optional. Point in time (Unix timestamp) when the link will expire or has been expired
	ExpireDate int `json:"expire_date,omitempty"`

	// Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
	MemberLimit int `json:"member_limit,omitempty"`

	// Optional. Number of pending join requests created using this link
	PendingJoinRequestCount int `json:"pending_join_request_count,omitempty"`
}

ChatInviteLink represents an invite link for a chat.

type ChatJoinRequest ¶

type ChatJoinRequest struct {
	// Chat to which the request was sent
	Chat Chat `json:"chat"`

	// User that sent the join request
	From User `json:"from"`

	// Date the request was sent in Unix time
	Date int `json:"date"`

	// Optional. Bio of the user.
	Bio string `json:"bio,omitempty"`

	// Optional. Chat invite link that was used by the user to send the join request
	InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
}

ChatJoinRequest represents a join request sent to a chat.

type ChatLocation ¶

type ChatLocation struct {
	// The location to which the supergroup is connected. Can't be a live location.
	Location Location `json:"location"`

	// Location address; 1-64 characters, as defined by the chat owner
	Address string `json:"address"`
}

ChatLocation represents a location to which a chat is connected.

type ChatMember ¶

type ChatMember struct {
	// The member's status in the chat, always “creator”
	Status string `json:"status"`

	// Information about the user
	User User `json:"user"`

	// True, if the user's presence in the chat is hidden
	IsAnonymous bool `json:"is_anonymous"`

	// Optional. Custom title for this user
	CustomTitle string `json:"custom_title,omitempty"`
}

ChatMember this object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

type ChatMemberAdministrator ¶

type ChatMemberAdministrator struct {
	// The member's status in the chat, always “administrator”
	Status string `json:"status"`

	// Information about the user
	User User `json:"user"`

	// True, if the bot is allowed to edit administrator privileges of that user
	CanBeEdited bool `json:"can_be_edited"`

	// True, if the user's presence in the chat is hidden
	IsAnonymous bool `json:"is_anonymous"`

	// True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege
	CanManageChat bool `json:"can_manage_chat"`

	// True, if the administrator can delete messages of other users
	CanDeleteMessages bool `json:"can_delete_messages"`

	// True, if the administrator can manage video chats
	CanManageVideoChats bool `json:"can_manage_video_chats"`

	// True, if the administrator can restrict, ban or unban chat members
	CanRestrictMembers bool `json:"can_restrict_members"`

	// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
	CanPromoteMembers bool `json:"can_promote_members"`

	// True, if the user is allowed to change the chat title, photo and other settings
	CanChangeInfo bool `json:"can_change_info"`

	// True, if the user is allowed to invite new users to the chat
	CanInviteUsers bool `json:"can_invite_users"`

	// Optional. True, if the administrator can post in the channel; channels only
	CanPostMessages bool `json:"can_post_messages,omitempty"`

	// Optional. True, if the administrator can edit messages of other users and can pin messages; channels only
	CanEditMessages bool `json:"can_edit_messages,omitempty"`

	// Optional. True, if the user is allowed to pin messages; groups and supergroups only
	CanPinMessages bool `json:"can_pin_messages,omitempty"`

	// Optional. Custom title for this user
	CustomTitle string `json:"custom_title,omitempty"`
}

ChatMemberAdministrator represents a chat member that has some additional privileges.

type ChatMemberBanned ¶

type ChatMemberBanned struct {
	// The member's status in the chat, always “kicked”
	Status string `json:"status"`

	// Information about the user
	User User `json:"user"`

	// Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever
	UntilDate int `json:"until_date"`
}

ChatMemberBanned represents a chat member that was banned in the chat and can't return to the chat or view chat messages.

type ChatMemberLeft ¶

type ChatMemberLeft struct {
	// The member's status in the chat, always “left”
	Status string `json:"status"`

	// Information about the user
	User User `json:"user"`
}

ChatMemberLeft represents a chat member that isn't currently a member of the chat, but may join it themselves.

type ChatMemberMember ¶

type ChatMemberMember struct {
	// The member's status in the chat, always “member”
	Status string `json:"status"`

	// Information about the user
	User User `json:"user"`
}

ChatMemberMember represents a chat member that has no additional privileges or restrictions.

type ChatMemberOwner ¶

type ChatMemberOwner struct {
	// The member's status in the chat, always “creator”
	Status string `json:"status"`

	// Information about the user
	User User `json:"user"`

	// True, if the user's presence in the chat is hidden
	IsAnonymous bool `json:"is_anonymous"`

	// Optional. Custom title for this user
	CustomTitle string `json:"custom_title,omitempty"`
}

ChatMemberOwner represents a chat member that owns the chat and has all administrator privileges.

type ChatMemberRestricted ¶

type ChatMemberRestricted struct {
	// The member's status in the chat, always “restricted”
	Status string `json:"status"`

	// Information about the user
	User User `json:"user"`

	// True, if the user is a member of the chat at the moment of the request
	IsMember bool `json:"is_member"`

	// True, if the user is allowed to change the chat title, photo and other settings
	CanChangeInfo bool `json:"can_change_info"`

	// True, if the user is allowed to invite new users to the chat
	CanInviteUsers bool `json:"can_invite_users"`

	// True, if the user is allowed to pin messages
	CanPinMessages bool `json:"can_pin_messages"`

	// True, if the user is allowed to send text messages, contacts, locations and venues
	CanSendMessages bool `json:"can_send_messages"`

	// True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes
	CanSendMediaMessages bool `json:"can_send_media_messages"`

	// True, if the user is allowed to send polls
	CanSendPolls bool `json:"can_send_polls"`

	// True, if the user is allowed to send animations, games, stickers and use inline bots
	CanSendOtherMessages bool `json:"can_send_other_messages"`

	// True, if the user is allowed to add web page previews to their messages
	CanAddWebPagePreviews bool `json:"can_add_web_page_previews"`

	// Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever
	UntilDate int `json:"until_date"`
}

ChatMemberRestricted represents a chat member that is under certain restrictions in the chat. Supergroups only.

type ChatMemberUpdated ¶

type ChatMemberUpdated struct {
	// Chat the user belongs to
	Chat Chat `json:"chat"`

	// Performer of the action, which resulted in the change
	From User `json:"from"`

	// Date the change was done in Unix time
	Date int `json:"date"`

	// Previous information about the chat member
	OldChatMember ChatMember `json:"old_chat_member"`

	// New information about the chat member
	NewChatMember ChatMember `json:"new_chat_member"`

	// Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
	InviteLink *ChatInviteLink `json:"invite_link,omitempty"`
}

ChatMemberUpdated this object represents changes in the status of a chat member.

type ChatPermissions ¶

type ChatPermissions struct {
	// Optional. True, if the user is allowed to send text messages, contacts, locations and venues
	CanSendMessages bool `json:"can_send_messages,omitempty"`

	// Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
	CanSendMediaMessages bool `json:"can_send_media_messages,omitempty"`

	// Optional. True, if the user is allowed to send polls, implies can_send_messages
	CanSendPolls bool `json:"can_send_polls,omitempty"`

	// Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
	CanSendOtherMessages bool `json:"can_send_other_messages,omitempty"`

	// Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
	CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty"`

	// Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
	CanChangeInfo bool `json:"can_change_info,omitempty"`

	// Optional. True, if the user is allowed to invite new users to the chat
	CanInviteUsers bool `json:"can_invite_users,omitempty"`

	// Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
	CanPinMessages bool `json:"can_pin_messages,omitempty"`
}

ChatPermissions describes actions that a non-administrator user is allowed to take in a chat.

type ChatPhoto ¶

type ChatPhoto struct {
	// File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
	SmallFileID FileID `json:"small_file_id"`

	// Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	SmallFileUniqueID string `json:"small_file_unique_id"`

	// File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.
	BigFileID FileID `json:"big_file_id"`

	// Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	BigFileUniqueID string `json:"big_file_unique_id"`
}

ChatPhoto this object represents a chat photo.

type ChatType ¶ added in v0.0.2

type ChatType int8

ChatType represents enum of possible chat types.

const (
	// ChatTypePrivate represents one-to-one chat.
	ChatTypePrivate ChatType = iota + 1
	// ChatTypeGroup represents group chats.
	ChatTypeGroup
	// ChatTypeSupergroup supergroup chats.
	ChatTypeSupergroup
	// ChatTypeChannel represents channels
	ChatTypeChannel
	// ChatTypeSender for a private chat with the inline query sender
	ChatTypeSender
)

func (ChatType) MarshalJSON ¶ added in v0.0.2

func (chatType ChatType) MarshalJSON() ([]byte, error)

func (ChatType) String ¶ added in v0.0.2

func (chatType ChatType) String() string

func (*ChatType) UnmarshalJSON ¶ added in v0.0.2

func (chatType *ChatType) UnmarshalJSON(b []byte) error

type ChosenInlineResult ¶

type ChosenInlineResult struct {
	// The unique identifier for the result that was chosen
	ResultID string `json:"result_id"`

	// The user that chose the result
	From User `json:"from"`

	// Optional. Sender location, only for bots that require user location
	Location *Location `json:"location,omitempty"`

	// Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.
	InlineMessageID string `json:"inline_message_id,omitempty"`

	// The query that was used to obtain the result
	Query string `json:"query"`
}

ChosenInlineResult represents a result of an inline query that was chosen by the user and sent to their chat partner.

type Client ¶

type Client struct {
	// contains filtered or unexported fields
}

Client is Telegram Bot API client structure. Create new client with NewClient function.

func New ¶

func New(token string, options ...ClientOption) *Client

New creates new Client with given token and options.

func (*Client) AddStickerToSet ¶

func (client *Client) AddStickerToSet(userID UserID, name string, emojis string) *AddStickerToSetCall

AddStickerToSetCall constructs a new AddStickerToSetCall with required parameters.

func (*Client) AnswerCallbackQuery ¶

func (client *Client) AnswerCallbackQuery(callbackQueryID string) *AnswerCallbackQueryCall

AnswerCallbackQueryCall constructs a new AnswerCallbackQueryCall with required parameters.

func (*Client) AnswerInlineQuery ¶

func (client *Client) AnswerInlineQuery(inlineQueryID string, results []InlineQueryResult) *AnswerInlineQueryCall

AnswerInlineQueryCall constructs a new AnswerInlineQueryCall with required parameters.

func (*Client) AnswerPreCheckoutQuery ¶

func (client *Client) AnswerPreCheckoutQuery(preCheckoutQueryID string, ok bool) *AnswerPreCheckoutQueryCall

AnswerPreCheckoutQueryCall constructs a new AnswerPreCheckoutQueryCall with required parameters.

func (*Client) AnswerShippingQuery ¶

func (client *Client) AnswerShippingQuery(shippingQueryID string, ok bool) *AnswerShippingQueryCall

AnswerShippingQueryCall constructs a new AnswerShippingQueryCall with required parameters.

func (*Client) AnswerWebAppQuery ¶

func (client *Client) AnswerWebAppQuery(webAppQueryID string, result InlineQueryResult) *AnswerWebAppQueryCall

AnswerWebAppQueryCall constructs a new AnswerWebAppQueryCall with required parameters.

func (*Client) ApproveChatJoinRequest ¶

func (client *Client) ApproveChatJoinRequest(chatID PeerID, userID UserID) *ApproveChatJoinRequestCall

ApproveChatJoinRequestCall constructs a new ApproveChatJoinRequestCall with required parameters.

func (*Client) BanChatMember ¶

func (client *Client) BanChatMember(chatID PeerID, userID UserID) *BanChatMemberCall

BanChatMemberCall constructs a new BanChatMemberCall with required parameters.

func (*Client) BanChatSenderChat ¶

func (client *Client) BanChatSenderChat(chatID PeerID, senderChatID int) *BanChatSenderChatCall

BanChatSenderChatCall constructs a new BanChatSenderChatCall with required parameters.

func (*Client) Close ¶

func (client *Client) Close() *CloseCall

CloseCall constructs a new CloseCall with required parameters.

func (*Client) CopyMessage ¶

func (client *Client) CopyMessage(chatID PeerID, fromChatID PeerID, messageID int) *CopyMessageCall

CopyMessageCall constructs a new CopyMessageCall with required parameters.

func (client *Client) CreateChatInviteLink(chatID PeerID) *CreateChatInviteLinkCall

CreateChatInviteLinkCall constructs a new CreateChatInviteLinkCall with required parameters.

func (client *Client) CreateInvoiceLink(title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *CreateInvoiceLinkCall

CreateInvoiceLinkCall constructs a new CreateInvoiceLinkCall with required parameters.

func (*Client) CreateNewStickerSet ¶

func (client *Client) CreateNewStickerSet(userID UserID, name string, title string, emojis string) *CreateNewStickerSetCall

CreateNewStickerSetCall constructs a new CreateNewStickerSetCall with required parameters.

func (*Client) DeclineChatJoinRequest ¶

func (client *Client) DeclineChatJoinRequest(chatID PeerID, userID UserID) *DeclineChatJoinRequestCall

DeclineChatJoinRequestCall constructs a new DeclineChatJoinRequestCall with required parameters.

func (*Client) DeleteChatPhoto ¶

func (client *Client) DeleteChatPhoto(chatID PeerID) *DeleteChatPhotoCall

DeleteChatPhotoCall constructs a new DeleteChatPhotoCall with required parameters.

func (*Client) DeleteChatStickerSet ¶

func (client *Client) DeleteChatStickerSet(chatID PeerID) *DeleteChatStickerSetCall

DeleteChatStickerSetCall constructs a new DeleteChatStickerSetCall with required parameters.

func (*Client) DeleteMessage ¶

func (client *Client) DeleteMessage(chatID PeerID, messageID int) *DeleteMessageCall

DeleteMessageCall constructs a new DeleteMessageCall with required parameters.

func (*Client) DeleteMyCommands ¶

func (client *Client) DeleteMyCommands() *DeleteMyCommandsCall

DeleteMyCommandsCall constructs a new DeleteMyCommandsCall with required parameters.

func (*Client) DeleteStickerFromSet ¶

func (client *Client) DeleteStickerFromSet(sticker string) *DeleteStickerFromSetCall

DeleteStickerFromSetCall constructs a new DeleteStickerFromSetCall with required parameters.

func (*Client) DeleteWebhook ¶

func (client *Client) DeleteWebhook() *DeleteWebhookCall

DeleteWebhookCall constructs a new DeleteWebhookCall with required parameters.

func (*Client) Do ¶ added in v0.0.6

func (client *Client) Do(ctx context.Context, req *Request, dst interface{}) error
func (client *Client) EditChatInviteLink(chatID PeerID, inviteLink string) *EditChatInviteLinkCall

EditChatInviteLinkCall constructs a new EditChatInviteLinkCall with required parameters.

func (*Client) EditMessageCaption ¶

func (client *Client) EditMessageCaption(chatID PeerID, messageID int, caption string) *EditMessageCaptionCall

EditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters.

func (*Client) EditMessageCaptionInline ¶ added in v0.0.3

func (client *Client) EditMessageCaptionInline(inlineMessageID string, caption string) *EditMessageCaptionCall

EditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters.

func (*Client) EditMessageLiveLocation ¶

func (client *Client) EditMessageLiveLocation(chatID PeerID, messageID int) *EditMessageLiveLocationCall

EditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters.

func (*Client) EditMessageLiveLocationInline ¶

func (client *Client) EditMessageLiveLocationInline(inlineMessageID string) *EditMessageLiveLocationCall

EditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters.

func (*Client) EditMessageMedia ¶

func (client *Client) EditMessageMedia(media InputMedia) *EditMessageMediaCall

EditMessageMediaCall constructs a new EditMessageMediaCall with required parameters.

func (*Client) EditMessageReplyMarkup ¶

func (client *Client) EditMessageReplyMarkup(chatID PeerID, messageID int) *EditMessageReplyMarkupCall

EditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters.

func (*Client) EditMessageReplyMarkupInline ¶ added in v0.0.3

func (client *Client) EditMessageReplyMarkupInline(inlineMessageID string) *EditMessageReplyMarkupCall

EditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters.

func (*Client) EditMessageText ¶

func (client *Client) EditMessageText(chatID PeerID, messageID int, text string) *EditMessageTextCall

EditMessageTextCall constructs a new EditMessageTextCall with required parameters.

func (*Client) EditMessageTextInline ¶ added in v0.0.3

func (client *Client) EditMessageTextInline(inlineMessageID string, text string) *EditMessageTextCall

EditMessageTextCall constructs a new EditMessageTextCall with required parameters.

func (client *Client) ExportChatInviteLink(chatID PeerID) *ExportChatInviteLinkCall

ExportChatInviteLinkCall constructs a new ExportChatInviteLinkCall with required parameters.

func (*Client) ForwardMessage ¶

func (client *Client) ForwardMessage(chatID PeerID, fromChatID PeerID, messageID int) *ForwardMessageCall

ForwardMessageCall constructs a new ForwardMessageCall with required parameters.

func (*Client) GetChat ¶

func (client *Client) GetChat(chatID PeerID) *GetChatCall

GetChatCall constructs a new GetChatCall with required parameters.

func (*Client) GetChatAdministrators ¶

func (client *Client) GetChatAdministrators(chatID PeerID) *GetChatAdministratorsCall

GetChatAdministratorsCall constructs a new GetChatAdministratorsCall with required parameters.

func (*Client) GetChatMember ¶

func (client *Client) GetChatMember(chatID PeerID, userID UserID) *GetChatMemberCall

GetChatMemberCall constructs a new GetChatMemberCall with required parameters.

func (*Client) GetChatMemberCount ¶

func (client *Client) GetChatMemberCount(chatID PeerID) *GetChatMemberCountCall

GetChatMemberCountCall constructs a new GetChatMemberCountCall with required parameters.

func (*Client) GetChatMenuButton ¶

func (client *Client) GetChatMenuButton() *GetChatMenuButtonCall

GetChatMenuButtonCall constructs a new GetChatMenuButtonCall with required parameters.

func (*Client) GetFile ¶

func (client *Client) GetFile(fileID string) *GetFileCall

GetFileCall constructs a new GetFileCall with required parameters.

func (*Client) GetGameHighScores ¶

func (client *Client) GetGameHighScores(userID UserID) *GetGameHighScoresCall

GetGameHighScoresCall constructs a new GetGameHighScoresCall with required parameters.

func (*Client) GetMe ¶

func (client *Client) GetMe() *GetMeCall

GetMeCall constructs a new GetMeCall with required parameters.

func (*Client) GetMyCommands ¶

func (client *Client) GetMyCommands() *GetMyCommandsCall

GetMyCommandsCall constructs a new GetMyCommandsCall with required parameters.

func (*Client) GetMyDefaultAdministratorRights ¶

func (client *Client) GetMyDefaultAdministratorRights() *GetMyDefaultAdministratorRightsCall

GetMyDefaultAdministratorRightsCall constructs a new GetMyDefaultAdministratorRightsCall with required parameters.

func (*Client) GetStickerSet ¶

func (client *Client) GetStickerSet(name string) *GetStickerSetCall

GetStickerSetCall constructs a new GetStickerSetCall with required parameters.

func (*Client) GetUpdates ¶

func (client *Client) GetUpdates() *GetUpdatesCall

GetUpdatesCall constructs a new GetUpdatesCall with required parameters.

func (*Client) GetUserProfilePhotos ¶

func (client *Client) GetUserProfilePhotos(userID UserID) *GetUserProfilePhotosCall

GetUserProfilePhotosCall constructs a new GetUserProfilePhotosCall with required parameters.

func (*Client) GetWebhookInfo ¶

func (client *Client) GetWebhookInfo() *GetWebhookInfoCall

GetWebhookInfoCall constructs a new GetWebhookInfoCall with required parameters.

func (*Client) LeaveChat ¶

func (client *Client) LeaveChat(chatID PeerID) *LeaveChatCall

LeaveChatCall constructs a new LeaveChatCall with required parameters.

func (*Client) LogOut ¶

func (client *Client) LogOut() *LogOutCall

LogOutCall constructs a new LogOutCall with required parameters.

func (*Client) Me ¶

func (client *Client) Me(ctx context.Context) (User, error)

Me returns cached current bot info.

func (*Client) PinChatMessage ¶

func (client *Client) PinChatMessage(chatID PeerID, messageID int) *PinChatMessageCall

PinChatMessageCall constructs a new PinChatMessageCall with required parameters.

func (*Client) PromoteChatMember ¶

func (client *Client) PromoteChatMember(chatID PeerID, userID UserID) *PromoteChatMemberCall

PromoteChatMemberCall constructs a new PromoteChatMemberCall with required parameters.

func (*Client) RestrictChatMember ¶

func (client *Client) RestrictChatMember(chatID PeerID, userID UserID, permissions ChatPermissions) *RestrictChatMemberCall

RestrictChatMemberCall constructs a new RestrictChatMemberCall with required parameters.

func (client *Client) RevokeChatInviteLink(chatID PeerID, inviteLink string) *RevokeChatInviteLinkCall

RevokeChatInviteLinkCall constructs a new RevokeChatInviteLinkCall with required parameters.

func (*Client) SendAnimation ¶

func (client *Client) SendAnimation(chatID PeerID, animation FileArg) *SendAnimationCall

SendAnimationCall constructs a new SendAnimationCall with required parameters.

func (*Client) SendAudio ¶

func (client *Client) SendAudio(chatID PeerID, audio FileArg) *SendAudioCall

SendAudioCall constructs a new SendAudioCall with required parameters.

func (*Client) SendChatAction ¶

func (client *Client) SendChatAction(chatID PeerID, action ChatAction) *SendChatActionCall

SendChatActionCall constructs a new SendChatActionCall with required parameters.

func (*Client) SendContact ¶

func (client *Client) SendContact(chatID PeerID, phoneNumber string, firstName string) *SendContactCall

SendContactCall constructs a new SendContactCall with required parameters.

func (*Client) SendDice ¶

func (client *Client) SendDice(chatID PeerID) *SendDiceCall

SendDiceCall constructs a new SendDiceCall with required parameters.

func (*Client) SendDocument ¶

func (client *Client) SendDocument(chatID PeerID, document FileArg) *SendDocumentCall

SendDocumentCall constructs a new SendDocumentCall with required parameters.

func (*Client) SendGame ¶

func (client *Client) SendGame(chatID ChatID, gameShortName string) *SendGameCall

SendGameCall constructs a new SendGameCall with required parameters.

func (*Client) SendInvoice ¶

func (client *Client) SendInvoice(chatID PeerID, title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *SendInvoiceCall

SendInvoiceCall constructs a new SendInvoiceCall with required parameters.

func (*Client) SendLocation ¶

func (client *Client) SendLocation(chatID PeerID, latitude float64, longitude float64) *SendLocationCall

SendLocationCall constructs a new SendLocationCall with required parameters.

func (*Client) SendMediaGroup ¶ added in v0.0.5

func (client *Client) SendMediaGroup(chatID PeerID, media []InputMedia) *SendMediaGroupCall

SendMediaGroupCall constructs a new SendMediaGroupCall with required parameters.

func (*Client) SendMessage ¶

func (client *Client) SendMessage(chatID PeerID, text string) *SendMessageCall

SendMessageCall constructs a new SendMessageCall with required parameters.

func (*Client) SendPhoto ¶

func (client *Client) SendPhoto(chatID PeerID, photo FileArg) *SendPhotoCall

SendPhotoCall constructs a new SendPhotoCall with required parameters.

func (*Client) SendPoll ¶

func (client *Client) SendPoll(chatID PeerID, question string, options []string) *SendPollCall

SendPollCall constructs a new SendPollCall with required parameters.

func (*Client) SendSticker ¶

func (client *Client) SendSticker(chatID PeerID, sticker FileArg) *SendStickerCall

SendStickerCall constructs a new SendStickerCall with required parameters.

func (*Client) SendVenue ¶

func (client *Client) SendVenue(chatID PeerID, latitude float64, longitude float64, title string, address string) *SendVenueCall

SendVenueCall constructs a new SendVenueCall with required parameters.

func (*Client) SendVideo ¶

func (client *Client) SendVideo(chatID PeerID, video FileArg) *SendVideoCall

SendVideoCall constructs a new SendVideoCall with required parameters.

func (*Client) SendVideoNote ¶

func (client *Client) SendVideoNote(chatID PeerID, videoNote FileArg) *SendVideoNoteCall

SendVideoNoteCall constructs a new SendVideoNoteCall with required parameters.

func (*Client) SendVoice ¶

func (client *Client) SendVoice(chatID PeerID, voice FileArg) *SendVoiceCall

SendVoiceCall constructs a new SendVoiceCall with required parameters.

func (*Client) SetChatAdministratorCustomTitle ¶

func (client *Client) SetChatAdministratorCustomTitle(chatID PeerID, userID UserID, customTitle string) *SetChatAdministratorCustomTitleCall

SetChatAdministratorCustomTitleCall constructs a new SetChatAdministratorCustomTitleCall with required parameters.

func (*Client) SetChatDescription ¶

func (client *Client) SetChatDescription(chatID PeerID) *SetChatDescriptionCall

SetChatDescriptionCall constructs a new SetChatDescriptionCall with required parameters.

func (*Client) SetChatMenuButton ¶

func (client *Client) SetChatMenuButton() *SetChatMenuButtonCall

SetChatMenuButtonCall constructs a new SetChatMenuButtonCall with required parameters.

func (*Client) SetChatPermissions ¶

func (client *Client) SetChatPermissions(chatID PeerID, permissions ChatPermissions) *SetChatPermissionsCall

SetChatPermissionsCall constructs a new SetChatPermissionsCall with required parameters.

func (*Client) SetChatPhoto ¶

func (client *Client) SetChatPhoto(chatID PeerID, photo InputFile) *SetChatPhotoCall

SetChatPhotoCall constructs a new SetChatPhotoCall with required parameters.

func (*Client) SetChatStickerSet ¶

func (client *Client) SetChatStickerSet(chatID PeerID, stickerSetName string) *SetChatStickerSetCall

SetChatStickerSetCall constructs a new SetChatStickerSetCall with required parameters.

func (*Client) SetChatTitle ¶

func (client *Client) SetChatTitle(chatID PeerID, title string) *SetChatTitleCall

SetChatTitleCall constructs a new SetChatTitleCall with required parameters.

func (*Client) SetGameScore ¶

func (client *Client) SetGameScore(userID UserID, score int) *SetGameScoreCall

SetGameScoreCall constructs a new SetGameScoreCall with required parameters.

func (*Client) SetMyCommands ¶

func (client *Client) SetMyCommands(commands []BotCommand) *SetMyCommandsCall

SetMyCommandsCall constructs a new SetMyCommandsCall with required parameters.

func (*Client) SetMyDefaultAdministratorRights ¶

func (client *Client) SetMyDefaultAdministratorRights() *SetMyDefaultAdministratorRightsCall

SetMyDefaultAdministratorRightsCall constructs a new SetMyDefaultAdministratorRightsCall with required parameters.

func (*Client) SetPassportDataErrors ¶

func (client *Client) SetPassportDataErrors(userID UserID, errors []PassportElementError) *SetPassportDataErrorsCall

SetPassportDataErrorsCall constructs a new SetPassportDataErrorsCall with required parameters.

func (*Client) SetStickerPositionInSet ¶

func (client *Client) SetStickerPositionInSet(sticker string, position int) *SetStickerPositionInSetCall

SetStickerPositionInSetCall constructs a new SetStickerPositionInSetCall with required parameters.

func (*Client) SetStickerSetThumb ¶

func (client *Client) SetStickerSetThumb(name string, userID UserID) *SetStickerSetThumbCall

SetStickerSetThumbCall constructs a new SetStickerSetThumbCall with required parameters.

func (*Client) SetWebhook ¶

func (client *Client) SetWebhook(url string) *SetWebhookCall

SetWebhookCall constructs a new SetWebhookCall with required parameters.

func (*Client) StopMessageLiveLocation ¶

func (client *Client) StopMessageLiveLocation(chatID PeerID, messageID int) *StopMessageLiveLocationCall

StopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters.

func (*Client) StopMessageLiveLocationInline ¶

func (client *Client) StopMessageLiveLocationInline(inlineMessageID string) *StopMessageLiveLocationCall

StopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters.

func (*Client) StopPoll ¶

func (client *Client) StopPoll(chatID PeerID, messageID int) *StopPollCall

StopPollCall constructs a new StopPollCall with required parameters.

func (*Client) Token ¶

func (client *Client) Token() string

func (*Client) UnbanChatMember ¶

func (client *Client) UnbanChatMember(chatID PeerID, userID UserID) *UnbanChatMemberCall

UnbanChatMemberCall constructs a new UnbanChatMemberCall with required parameters.

func (*Client) UnbanChatSenderChat ¶

func (client *Client) UnbanChatSenderChat(chatID PeerID, senderChatID int) *UnbanChatSenderChatCall

UnbanChatSenderChatCall constructs a new UnbanChatSenderChatCall with required parameters.

func (*Client) UnpinAllChatMessages ¶

func (client *Client) UnpinAllChatMessages(chatID PeerID) *UnpinAllChatMessagesCall

UnpinAllChatMessagesCall constructs a new UnpinAllChatMessagesCall with required parameters.

func (*Client) UnpinChatMessage ¶

func (client *Client) UnpinChatMessage(chatID PeerID) *UnpinChatMessageCall

UnpinChatMessageCall constructs a new UnpinChatMessageCall with required parameters.

func (*Client) UploadStickerFile ¶

func (client *Client) UploadStickerFile(userID UserID, pngSticker InputFile) *UploadStickerFileCall

UploadStickerFileCall constructs a new UploadStickerFileCall with required parameters.

type ClientOption ¶

type ClientOption func(*Client)

ClientOption is a function that sets some option for Client.

func WithClientDoer ¶ added in v0.0.5

func WithClientDoer(doer *http.Client) ClientOption

WithClientDoer sets custom http client for Client.

func WithClientServerURL ¶ added in v0.0.6

func WithClientServerURL(server string) ClientOption

WithClientServerURL sets custom server url for Client.

type CloseCall ¶

type CloseCall struct {
	CallNoResult
}

CloseCall reprenesents a call to the close method. Use this method to close the bot instance before moving it from one local server to another You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart The method will return error 429 in the first 10 minutes after the bot is launched Requires no parameters.

func NewCloseCall ¶

func NewCloseCall() *CloseCall

NewCloseCall constructs a new CloseCall with required parameters.

type Contact ¶

type Contact struct {
	// Contact's phone number
	PhoneNumber string `json:"phone_number"`

	// Contact's first name
	FirstName string `json:"first_name"`

	// Optional. Contact's last name
	LastName string `json:"last_name,omitempty"`

	// Optional. Contact's user identifier in Telegram.
	UserID int64 `json:"user_id,omitempty"`

	// Optional. Additional data about the contact in the form of a vCard
	VCard string `json:"vcard,omitempty"`
}

Contact this object represents a phone contact.

type CopyMessageCall ¶

type CopyMessageCall struct {
	Call[MessageID]
}

CopyMessageCall reprenesents a call to the copyMessage method. Use this method to copy messages of any kind Service messages and invoice messages can't be copied The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message Returns the MessageId of the sent message on success.

func NewCopyMessageCall ¶

func NewCopyMessageCall(chatID PeerID, fromChatID PeerID, messageID int) *CopyMessageCall

NewCopyMessageCall constructs a new CopyMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) fromChatID - Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) messageID - Message identifier in the chat specified in from_chat_id

func (*CopyMessageCall) AllowSendingWithoutReply ¶

func (call *CopyMessageCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *CopyMessageCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*CopyMessageCall) Caption ¶

func (call *CopyMessageCall) Caption(caption string) *CopyMessageCall

Caption New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept

func (*CopyMessageCall) CaptionEntities ¶

func (call *CopyMessageCall) CaptionEntities(captionEntities []MessageEntity) *CopyMessageCall

CaptionEntities A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode

func (*CopyMessageCall) ChatID ¶ added in v0.0.5

func (call *CopyMessageCall) ChatID(chatID PeerID) *CopyMessageCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*CopyMessageCall) DisableNotification ¶

func (call *CopyMessageCall) DisableNotification(disableNotification bool) *CopyMessageCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*CopyMessageCall) FromChatID ¶ added in v0.0.5

func (call *CopyMessageCall) FromChatID(fromChatID PeerID) *CopyMessageCall

FromChatID Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

func (*CopyMessageCall) MessageID ¶ added in v0.0.5

func (call *CopyMessageCall) MessageID(messageID int) *CopyMessageCall

MessageID Message identifier in the chat specified in from_chat_id

func (*CopyMessageCall) ParseMode ¶

func (call *CopyMessageCall) ParseMode(parseMode ParseMode) *CopyMessageCall

ParseMode Mode for parsing entities in the new caption. See formatting options for more details.

func (*CopyMessageCall) ProtectContent ¶

func (call *CopyMessageCall) ProtectContent(protectContent bool) *CopyMessageCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*CopyMessageCall) ReplyMarkup ¶

func (call *CopyMessageCall) ReplyMarkup(replyMarkup ReplyMarkup) *CopyMessageCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*CopyMessageCall) ReplyToMessageID ¶ added in v0.0.5

func (call *CopyMessageCall) ReplyToMessageID(replyToMessageID int) *CopyMessageCall

ReplyToMessageID If the message is a reply, ID of the original message

type CreateChatInviteLinkCall ¶

type CreateChatInviteLinkCall struct {
	Call[ChatInviteLink]
}

CreateChatInviteLinkCall reprenesents a call to the createChatInviteLink method. Use this method to create an additional invite link for a chat The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights The link can be revoked using the method revokeChatInviteLink Returns the new invite link as ChatInviteLink object.

func NewCreateChatInviteLinkCall ¶

func NewCreateChatInviteLinkCall(chatID PeerID) *CreateChatInviteLinkCall

NewCreateChatInviteLinkCall constructs a new CreateChatInviteLinkCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*CreateChatInviteLinkCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*CreateChatInviteLinkCall) CreatesJoinRequest ¶

func (call *CreateChatInviteLinkCall) CreatesJoinRequest(createsJoinRequest bool) *CreateChatInviteLinkCall

CreatesJoinRequest True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified

func (*CreateChatInviteLinkCall) ExpireDate ¶

func (call *CreateChatInviteLinkCall) ExpireDate(expireDate int) *CreateChatInviteLinkCall

ExpireDate Point in time (Unix timestamp) when the link will expire

func (*CreateChatInviteLinkCall) MemberLimit ¶

func (call *CreateChatInviteLinkCall) MemberLimit(memberLimit int) *CreateChatInviteLinkCall

MemberLimit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999

func (*CreateChatInviteLinkCall) Name ¶

Name Invite link name; 0-32 characters

type CreateInvoiceLinkCall ¶

type CreateInvoiceLinkCall struct {
	Call[string]
}

CreateInvoiceLinkCall reprenesents a call to the createInvoiceLink method. Use this method to create a link for an invoice Returns the created invoice link as String on success.

func NewCreateInvoiceLinkCall ¶

func NewCreateInvoiceLinkCall(title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *CreateInvoiceLinkCall

NewCreateInvoiceLinkCall constructs a new CreateInvoiceLinkCall with required parameters. title - Product name, 1-32 characters description - Product description, 1-255 characters payload - Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. providerToken - Payment provider token, obtained via BotFather currency - Three-letter ISO 4217 currency code, see more on currencies prices - Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

func (*CreateInvoiceLinkCall) Currency ¶

func (call *CreateInvoiceLinkCall) Currency(currency string) *CreateInvoiceLinkCall

Currency Three-letter ISO 4217 currency code, see more on currencies

func (*CreateInvoiceLinkCall) Description ¶

func (call *CreateInvoiceLinkCall) Description(description string) *CreateInvoiceLinkCall

Description Product description, 1-255 characters

func (*CreateInvoiceLinkCall) IsFlexible ¶

func (call *CreateInvoiceLinkCall) IsFlexible(isFlexible bool) *CreateInvoiceLinkCall

IsFlexible Pass True, if the final price depends on the shipping method

func (*CreateInvoiceLinkCall) MaxTipAmount ¶

func (call *CreateInvoiceLinkCall) MaxTipAmount(maxTipAmount int) *CreateInvoiceLinkCall

MaxTipAmount The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

func (*CreateInvoiceLinkCall) NeedEmail ¶

func (call *CreateInvoiceLinkCall) NeedEmail(needEmail bool) *CreateInvoiceLinkCall

NeedEmail Pass True, if you require the user's email address to complete the order

func (*CreateInvoiceLinkCall) NeedName ¶

func (call *CreateInvoiceLinkCall) NeedName(needName bool) *CreateInvoiceLinkCall

NeedName Pass True, if you require the user's full name to complete the order

func (*CreateInvoiceLinkCall) NeedPhoneNumber ¶

func (call *CreateInvoiceLinkCall) NeedPhoneNumber(needPhoneNumber bool) *CreateInvoiceLinkCall

NeedPhoneNumber Pass True, if you require the user's phone number to complete the order

func (*CreateInvoiceLinkCall) NeedShippingAddress ¶

func (call *CreateInvoiceLinkCall) NeedShippingAddress(needShippingAddress bool) *CreateInvoiceLinkCall

NeedShippingAddress Pass True, if you require the user's shipping address to complete the order

func (*CreateInvoiceLinkCall) Payload ¶

func (call *CreateInvoiceLinkCall) Payload(payload string) *CreateInvoiceLinkCall

Payload Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

func (*CreateInvoiceLinkCall) PhotoHeight ¶

func (call *CreateInvoiceLinkCall) PhotoHeight(photoHeight int) *CreateInvoiceLinkCall

PhotoHeight Photo height

func (*CreateInvoiceLinkCall) PhotoSize ¶

func (call *CreateInvoiceLinkCall) PhotoSize(photoSize int) *CreateInvoiceLinkCall

PhotoSize Photo size in bytes

func (*CreateInvoiceLinkCall) PhotoURL ¶ added in v0.0.5

func (call *CreateInvoiceLinkCall) PhotoURL(photoURL string) *CreateInvoiceLinkCall

PhotoURL URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.

func (*CreateInvoiceLinkCall) PhotoWidth ¶

func (call *CreateInvoiceLinkCall) PhotoWidth(photoWidth int) *CreateInvoiceLinkCall

PhotoWidth Photo width

func (*CreateInvoiceLinkCall) Prices ¶

Prices Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

func (*CreateInvoiceLinkCall) ProviderData ¶

func (call *CreateInvoiceLinkCall) ProviderData(providerData string) *CreateInvoiceLinkCall

ProviderData JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

func (*CreateInvoiceLinkCall) ProviderToken ¶

func (call *CreateInvoiceLinkCall) ProviderToken(providerToken string) *CreateInvoiceLinkCall

ProviderToken Payment provider token, obtained via BotFather

func (*CreateInvoiceLinkCall) SendEmailToProvider ¶

func (call *CreateInvoiceLinkCall) SendEmailToProvider(sendEmailToProvider bool) *CreateInvoiceLinkCall

SendEmailToProvider Pass True, if the user's email address should be sent to the provider

func (*CreateInvoiceLinkCall) SendPhoneNumberToProvider ¶

func (call *CreateInvoiceLinkCall) SendPhoneNumberToProvider(sendPhoneNumberToProvider bool) *CreateInvoiceLinkCall

SendPhoneNumberToProvider Pass True, if the user's phone number should be sent to the provider

func (*CreateInvoiceLinkCall) SuggestedTipAmounts ¶

func (call *CreateInvoiceLinkCall) SuggestedTipAmounts(suggestedTipAmounts []int) *CreateInvoiceLinkCall

SuggestedTipAmounts A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

func (*CreateInvoiceLinkCall) Title ¶

Title Product name, 1-32 characters

type CreateNewStickerSetCall ¶

type CreateNewStickerSetCall struct {
	CallNoResult
}

CreateNewStickerSetCall reprenesents a call to the createNewStickerSet method. Use this method to create a new sticker set owned by a user The bot will be able to edit the sticker set thus created You must use exactly one of the fields png_sticker, tgs_sticker, or webm_sticker

func NewCreateNewStickerSetCall ¶

func NewCreateNewStickerSetCall(userID UserID, name string, title string, emojis string) *CreateNewStickerSetCall

NewCreateNewStickerSetCall constructs a new CreateNewStickerSetCall with required parameters. userID - User identifier of created sticker set owner name - Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters. title - Sticker set title, 1-64 characters emojis - One or more emoji corresponding to the sticker

func (*CreateNewStickerSetCall) ContainsMasks ¶

func (call *CreateNewStickerSetCall) ContainsMasks(containsMasks bool) *CreateNewStickerSetCall

ContainsMasks Pass True, if a set of mask stickers should be created

func (*CreateNewStickerSetCall) Emojis ¶

Emojis One or more emoji corresponding to the sticker

func (*CreateNewStickerSetCall) MaskPosition ¶

func (call *CreateNewStickerSetCall) MaskPosition(maskPosition MaskPosition) *CreateNewStickerSetCall

MaskPosition A JSON-serialized object for position where the mask should be placed on faces

func (*CreateNewStickerSetCall) Name ¶

Name Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only English letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in "_by_<bot_username>". <bot_username> is case insensitive. 1-64 characters.

func (*CreateNewStickerSetCall) PNGSticker ¶ added in v0.0.5

func (call *CreateNewStickerSetCall) PNGSticker(pngSticker FileArg) *CreateNewStickerSetCall

PNGSticker PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*CreateNewStickerSetCall) TGSSticker ¶ added in v0.0.5

func (call *CreateNewStickerSetCall) TGSSticker(tgsSticker InputFile) *CreateNewStickerSetCall

TGSSticker TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#animated-sticker-requirements for technical requirements

func (*CreateNewStickerSetCall) Title ¶

Title Sticker set title, 1-64 characters

func (*CreateNewStickerSetCall) UserID ¶ added in v0.0.5

UserID User identifier of created sticker set owner

func (*CreateNewStickerSetCall) WEBMSticker ¶ added in v0.0.5

func (call *CreateNewStickerSetCall) WEBMSticker(webmSticker InputFile) *CreateNewStickerSetCall

WEBMSticker WEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements

type DeclineChatJoinRequestCall ¶

type DeclineChatJoinRequestCall struct {
	CallNoResult
}

DeclineChatJoinRequestCall reprenesents a call to the declineChatJoinRequest method. Use this method to decline a chat join request The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right

func NewDeclineChatJoinRequestCall ¶

func NewDeclineChatJoinRequestCall(chatID PeerID, userID UserID) *DeclineChatJoinRequestCall

NewDeclineChatJoinRequestCall constructs a new DeclineChatJoinRequestCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) userID - Unique identifier of the target user

func (*DeclineChatJoinRequestCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*DeclineChatJoinRequestCall) UserID ¶ added in v0.0.5

UserID Unique identifier of the target user

type DeleteChatPhotoCall ¶

type DeleteChatPhotoCall struct {
	CallNoResult
}

DeleteChatPhotoCall reprenesents a call to the deleteChatPhoto method. Use this method to delete a chat photo Photos can't be changed for private chats The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights

func NewDeleteChatPhotoCall ¶

func NewDeleteChatPhotoCall(chatID PeerID) *DeleteChatPhotoCall

NewDeleteChatPhotoCall constructs a new DeleteChatPhotoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*DeleteChatPhotoCall) ChatID ¶ added in v0.0.5

func (call *DeleteChatPhotoCall) ChatID(chatID PeerID) *DeleteChatPhotoCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

type DeleteChatStickerSetCall ¶

type DeleteChatStickerSetCall struct {
	CallNoResult
}

DeleteChatStickerSetCall reprenesents a call to the deleteChatStickerSet method. Use this method to delete a group sticker set from a supergroup The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method

func NewDeleteChatStickerSetCall ¶

func NewDeleteChatStickerSetCall(chatID PeerID) *DeleteChatStickerSetCall

NewDeleteChatStickerSetCall constructs a new DeleteChatStickerSetCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

func (*DeleteChatStickerSetCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

type DeleteMessageCall ¶

type DeleteMessageCall struct {
	CallNoResult
}

DeleteMessageCall reprenesents a call to the deleteMessage method.

func NewDeleteMessageCall ¶

func NewDeleteMessageCall(chatID PeerID, messageID int) *DeleteMessageCall

NewDeleteMessageCall constructs a new DeleteMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Identifier of the message to delete

func (*DeleteMessageCall) ChatID ¶ added in v0.0.5

func (call *DeleteMessageCall) ChatID(chatID PeerID) *DeleteMessageCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*DeleteMessageCall) MessageID ¶ added in v0.0.5

func (call *DeleteMessageCall) MessageID(messageID int) *DeleteMessageCall

MessageID Identifier of the message to delete

type DeleteMyCommandsCall ¶

type DeleteMyCommandsCall struct {
	CallNoResult
}

DeleteMyCommandsCall reprenesents a call to the deleteMyCommands method. Use this method to delete the list of the bot's commands for the given scope and user language After deletion, higher level commands will be shown to affected users

func NewDeleteMyCommandsCall ¶

func NewDeleteMyCommandsCall() *DeleteMyCommandsCall

NewDeleteMyCommandsCall constructs a new DeleteMyCommandsCall with required parameters.

func (*DeleteMyCommandsCall) LanguageCode ¶

func (call *DeleteMyCommandsCall) LanguageCode(languageCode string) *DeleteMyCommandsCall

LanguageCode A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands

func (*DeleteMyCommandsCall) Scope ¶

Scope A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.

type DeleteStickerFromSetCall ¶

type DeleteStickerFromSetCall struct {
	CallNoResult
}

DeleteStickerFromSetCall reprenesents a call to the deleteStickerFromSet method. Use this method to delete a sticker from a set created by the bot

func NewDeleteStickerFromSetCall ¶

func NewDeleteStickerFromSetCall(sticker string) *DeleteStickerFromSetCall

NewDeleteStickerFromSetCall constructs a new DeleteStickerFromSetCall with required parameters. sticker - File identifier of the sticker

func (*DeleteStickerFromSetCall) Sticker ¶

Sticker File identifier of the sticker

type DeleteWebhookCall ¶

type DeleteWebhookCall struct {
	CallNoResult
}

DeleteWebhookCall reprenesents a call to the deleteWebhook method. Use this method to remove webhook integration if you decide to switch back to getUpdates

func NewDeleteWebhookCall ¶

func NewDeleteWebhookCall() *DeleteWebhookCall

NewDeleteWebhookCall constructs a new DeleteWebhookCall with required parameters.

func (*DeleteWebhookCall) DropPendingUpdates ¶

func (call *DeleteWebhookCall) DropPendingUpdates(dropPendingUpdates bool) *DeleteWebhookCall

DropPendingUpdates Pass True to drop all pending updates

type Dice ¶

type Dice struct {
	// Emoji on which the dice throw animation is based
	Emoji string `json:"emoji"`

	// Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base emoji, 1-64 for “” base emoji
	Value int `json:"value"`
}

Dice this object represents an animated emoji that displays a random value.

type Document ¶

type Document struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Optional. Document thumbnail as defined by sender
	Thumb *PhotoSize `json:"thumb,omitempty"`

	// Optional. Original filename as defined by sender
	FileName string `json:"file_name,omitempty"`

	// Optional. MIME type of the file as defined by sender
	MIMEType string `json:"mime_type,omitempty"`

	// Optional. File size in bytes.
	FileSize int64 `json:"file_size,omitempty"`
}

Document this object represents a general file (as opposed to photos, voice messages and audio files).

type EditChatInviteLinkCall ¶

type EditChatInviteLinkCall struct {
	Call[ChatInviteLink]
}

EditChatInviteLinkCall reprenesents a call to the editChatInviteLink method. Use this method to edit a non-primary invite link created by the bot The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Returns the edited invite link as a ChatInviteLink object.

func NewEditChatInviteLinkCall ¶

func NewEditChatInviteLinkCall(chatID PeerID, inviteLink string) *EditChatInviteLinkCall

NewEditChatInviteLinkCall constructs a new EditChatInviteLinkCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) inviteLink - The invite link to edit

func (*EditChatInviteLinkCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*EditChatInviteLinkCall) CreatesJoinRequest ¶

func (call *EditChatInviteLinkCall) CreatesJoinRequest(createsJoinRequest bool) *EditChatInviteLinkCall

CreatesJoinRequest True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified

func (*EditChatInviteLinkCall) ExpireDate ¶

func (call *EditChatInviteLinkCall) ExpireDate(expireDate int) *EditChatInviteLinkCall

ExpireDate Point in time (Unix timestamp) when the link will expire

func (call *EditChatInviteLinkCall) InviteLink(inviteLink string) *EditChatInviteLinkCall

InviteLink The invite link to edit

func (*EditChatInviteLinkCall) MemberLimit ¶

func (call *EditChatInviteLinkCall) MemberLimit(memberLimit int) *EditChatInviteLinkCall

MemberLimit The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999

func (*EditChatInviteLinkCall) Name ¶

Name Invite link name; 0-32 characters

type EditMessageCaptionCall ¶

type EditMessageCaptionCall struct {
	Call[Message]
}

EditMessageCaptionCall reprenesents a call to the editMessageCaption method. Use this method to edit captions of messages On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

func NewEditMessageCaptionCall ¶

func NewEditMessageCaptionCall(chatID PeerID, messageID int, caption string) *EditMessageCaptionCall

NewEditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit caption - New caption of the message, 0-1024 characters after entities parsing

func NewEditMessageCaptionInlineCall ¶ added in v0.0.3

func NewEditMessageCaptionInlineCall(inlineMessageID string, caption string) *EditMessageCaptionCall

NewEditMessageCaptionCall constructs a new EditMessageCaptionCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message caption - New caption of the message, 0-1024 characters after entities parsing

func (*EditMessageCaptionCall) Caption ¶

func (call *EditMessageCaptionCall) Caption(caption string) *EditMessageCaptionCall

Caption New caption of the message, 0-1024 characters after entities parsing

func (*EditMessageCaptionCall) CaptionEntities ¶

func (call *EditMessageCaptionCall) CaptionEntities(captionEntities []MessageEntity) *EditMessageCaptionCall

CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

func (*EditMessageCaptionCall) ChatID ¶ added in v0.0.5

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*EditMessageCaptionCall) InlineMessageID ¶ added in v0.0.5

func (call *EditMessageCaptionCall) InlineMessageID(inlineMessageID string) *EditMessageCaptionCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*EditMessageCaptionCall) MessageID ¶ added in v0.0.5

func (call *EditMessageCaptionCall) MessageID(messageID int) *EditMessageCaptionCall

MessageID Required if inline_message_id is not specified. Identifier of the message to edit

func (*EditMessageCaptionCall) ParseMode ¶

func (call *EditMessageCaptionCall) ParseMode(parseMode ParseMode) *EditMessageCaptionCall

ParseMode Mode for parsing entities in the message caption. See formatting options for more details.

func (*EditMessageCaptionCall) ReplyMarkup ¶

func (call *EditMessageCaptionCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageCaptionCall

ReplyMarkup A JSON-serialized object for an inline keyboard.

type EditMessageLiveLocationCall ¶

type EditMessageLiveLocationCall struct {
	Call[Message]
}

EditMessageLiveLocationCall reprenesents a call to the editMessageLiveLocation method. Use this method to edit live location messages A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

func NewEditMessageLiveLocationCall ¶

func NewEditMessageLiveLocationCall(chatID PeerID, messageID int) *EditMessageLiveLocationCall

NewEditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit

func NewEditMessageLiveLocationInlineCall ¶

func NewEditMessageLiveLocationInlineCall(inlineMessageID string) *EditMessageLiveLocationCall

NewEditMessageLiveLocationCall constructs a new EditMessageLiveLocationCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message

func (*EditMessageLiveLocationCall) ChatID ¶ added in v0.0.5

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*EditMessageLiveLocationCall) Heading ¶

Heading Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

func (*EditMessageLiveLocationCall) HorizontalAccuracy ¶

func (call *EditMessageLiveLocationCall) HorizontalAccuracy(horizontalAccuracy float64) *EditMessageLiveLocationCall

HorizontalAccuracy The radius of uncertainty for the location, measured in meters; 0-1500

func (*EditMessageLiveLocationCall) InlineMessageID ¶ added in v0.0.5

func (call *EditMessageLiveLocationCall) InlineMessageID(inlineMessageID string) *EditMessageLiveLocationCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*EditMessageLiveLocationCall) Latitude ¶

Latitude Latitude of new location

func (*EditMessageLiveLocationCall) Longitude ¶

Longitude Longitude of new location

func (*EditMessageLiveLocationCall) MessageID ¶ added in v0.0.5

func (call *EditMessageLiveLocationCall) MessageID(messageID int) *EditMessageLiveLocationCall

MessageID Required if inline_message_id is not specified. Identifier of the message to edit

func (*EditMessageLiveLocationCall) ProximityAlertRadius ¶

func (call *EditMessageLiveLocationCall) ProximityAlertRadius(proximityAlertRadius int) *EditMessageLiveLocationCall

ProximityAlertRadius The maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

func (*EditMessageLiveLocationCall) ReplyMarkup ¶

ReplyMarkup A JSON-serialized object for a new inline keyboard.

type EditMessageMediaCall ¶

type EditMessageMediaCall struct {
	Call[Message]
}

EditMessageMediaCall reprenesents a call to the editMessageMedia method. Use this method to edit animation, audio, document, photo, or video messages If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

func NewEditMessageMediaCall ¶

func NewEditMessageMediaCall(media InputMedia) *EditMessageMediaCall

NewEditMessageMediaCall constructs a new EditMessageMediaCall with required parameters. media - A JSON-serialized object for a new media content of the message

func (*EditMessageMediaCall) ChatID ¶ added in v0.0.5

func (call *EditMessageMediaCall) ChatID(chatID PeerID) *EditMessageMediaCall

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*EditMessageMediaCall) InlineMessageID ¶ added in v0.0.5

func (call *EditMessageMediaCall) InlineMessageID(inlineMessageID string) *EditMessageMediaCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*EditMessageMediaCall) Media ¶

Media A JSON-serialized object for a new media content of the message

func (*EditMessageMediaCall) MessageID ¶ added in v0.0.5

func (call *EditMessageMediaCall) MessageID(messageID int) *EditMessageMediaCall

MessageID Required if inline_message_id is not specified. Identifier of the message to edit

func (*EditMessageMediaCall) ReplyMarkup ¶

func (call *EditMessageMediaCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageMediaCall

ReplyMarkup A JSON-serialized object for a new inline keyboard.

type EditMessageReplyMarkupCall ¶

type EditMessageReplyMarkupCall struct {
	Call[Message]
}

EditMessageReplyMarkupCall reprenesents a call to the editMessageReplyMarkup method. Use this method to edit only the reply markup of messages On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

func NewEditMessageReplyMarkupCall ¶

func NewEditMessageReplyMarkupCall(chatID PeerID, messageID int) *EditMessageReplyMarkupCall

NewEditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit

func NewEditMessageReplyMarkupInlineCall ¶ added in v0.0.3

func NewEditMessageReplyMarkupInlineCall(inlineMessageID string) *EditMessageReplyMarkupCall

NewEditMessageReplyMarkupCall constructs a new EditMessageReplyMarkupCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message

func (*EditMessageReplyMarkupCall) ChatID ¶ added in v0.0.5

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*EditMessageReplyMarkupCall) InlineMessageID ¶ added in v0.0.5

func (call *EditMessageReplyMarkupCall) InlineMessageID(inlineMessageID string) *EditMessageReplyMarkupCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*EditMessageReplyMarkupCall) MessageID ¶ added in v0.0.5

func (call *EditMessageReplyMarkupCall) MessageID(messageID int) *EditMessageReplyMarkupCall

MessageID Required if inline_message_id is not specified. Identifier of the message to edit

func (*EditMessageReplyMarkupCall) ReplyMarkup ¶

ReplyMarkup A JSON-serialized object for an inline keyboard.

type EditMessageTextCall ¶

type EditMessageTextCall struct {
	Call[Message]
}

EditMessageTextCall reprenesents a call to the editMessageText method. Use this method to edit text and game messages On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

func NewEditMessageTextCall ¶

func NewEditMessageTextCall(chatID PeerID, messageID int, text string) *EditMessageTextCall

NewEditMessageTextCall constructs a new EditMessageTextCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message to edit text - New text of the message, 1-4096 characters after entities parsing

func NewEditMessageTextInlineCall ¶ added in v0.0.3

func NewEditMessageTextInlineCall(inlineMessageID string, text string) *EditMessageTextCall

NewEditMessageTextCall constructs a new EditMessageTextCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message text - New text of the message, 1-4096 characters after entities parsing

func (*EditMessageTextCall) ChatID ¶ added in v0.0.5

func (call *EditMessageTextCall) ChatID(chatID PeerID) *EditMessageTextCall

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*EditMessageTextCall) DisableWebPagePreview ¶

func (call *EditMessageTextCall) DisableWebPagePreview(disableWebPagePreview bool) *EditMessageTextCall

DisableWebPagePreview Disables link previews for links in this message

func (*EditMessageTextCall) Entities ¶

func (call *EditMessageTextCall) Entities(entities []MessageEntity) *EditMessageTextCall

Entities A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode

func (*EditMessageTextCall) InlineMessageID ¶ added in v0.0.5

func (call *EditMessageTextCall) InlineMessageID(inlineMessageID string) *EditMessageTextCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*EditMessageTextCall) MessageID ¶ added in v0.0.5

func (call *EditMessageTextCall) MessageID(messageID int) *EditMessageTextCall

MessageID Required if inline_message_id is not specified. Identifier of the message to edit

func (*EditMessageTextCall) ParseMode ¶

func (call *EditMessageTextCall) ParseMode(parseMode ParseMode) *EditMessageTextCall

ParseMode Mode for parsing entities in the message text. See formatting options for more details.

func (*EditMessageTextCall) ReplyMarkup ¶

func (call *EditMessageTextCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *EditMessageTextCall

ReplyMarkup A JSON-serialized object for an inline keyboard.

func (*EditMessageTextCall) Text ¶

Text New text of the message, 1-4096 characters after entities parsing

type Encoder ¶

type Encoder interface {
	// Writes string argument k to encoder.
	WriteString(k string, v string) error

	// Write files argument k to encoder.
	WriteFile(k string, file InputFile) error
}

Encoder represents request encoder.

type EncryptedCredentials ¶

type EncryptedCredentials struct {
	// Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
	Data string `json:"data"`

	// Base64-encoded data hash for data authentication
	Hash string `json:"hash"`

	// Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
	Secret string `json:"secret"`
}

EncryptedCredentials describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.

type EncryptedPassportElement ¶

type EncryptedPassportElement struct {
	// Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
	Type string `json:"type"`

	// Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
	Data string `json:"data,omitempty"`

	// Optional. User's verified phone number, available only for “phone_number” type
	PhoneNumber string `json:"phone_number,omitempty"`

	// Optional. User's verified email address, available only for “email” type
	Email string `json:"email,omitempty"`

	// Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
	Files []PassportFile `json:"files,omitempty"`

	// Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
	FrontSide *PassportFile `json:"front_side,omitempty"`

	// Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
	ReverseSide *PassportFile `json:"reverse_side,omitempty"`

	// Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
	Selfie *PassportFile `json:"selfie,omitempty"`

	// Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
	Translation []PassportFile `json:"translation,omitempty"`

	// Base64-encoded element hash for using in PassportElementErrorUnspecified
	Hash string `json:"hash"`
}

EncryptedPassportElement describes documents or other Telegram Passport elements shared with the bot by the user.

type Error ¶ added in v0.0.5

type Error struct {
	Code       int                 `json:"code"`
	Message    string              `json:"message"`
	Parameters *ResponseParameters `json:"parameters"`
}

Error is Telegram Bot API error structure.

func (*Error) Contains ¶ added in v0.0.5

func (err *Error) Contains(v string) bool

func (*Error) Error ¶ added in v0.0.5

func (err *Error) Error() string

type ExportChatInviteLinkCall ¶

type ExportChatInviteLinkCall struct {
	Call[string]
}

ExportChatInviteLinkCall reprenesents a call to the exportChatInviteLink method. Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Returns the new invite link as String on success.

func NewExportChatInviteLinkCall ¶

func NewExportChatInviteLinkCall(chatID PeerID) *ExportChatInviteLinkCall

NewExportChatInviteLinkCall constructs a new ExportChatInviteLinkCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*ExportChatInviteLinkCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

type File ¶

type File struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Optional. File size in bytes.
	FileSize int64 `json:"file_size,omitempty"`

	// Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
	FilePath string `json:"file_path,omitempty"`
}

File this object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.

type FileArg ¶

type FileArg struct {
	FileID FileID
	URL    string
	Upload InputFile
	// contains filtered or unexported fields
}

func (FileArg) MarshalJSON ¶ added in v0.0.5

func (arg FileArg) MarshalJSON() ([]byte, error)

type FileID ¶

type FileID string

type ForceReply ¶

type ForceReply struct {
	// Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'
	ForceReply bool `json:"force_reply"`

	// Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
	InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`

	// Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.
	Selective bool `json:"selective,omitempty"`
}

ForceReply upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

func NewForceReply ¶ added in v0.0.2

func NewForceReply() *ForceReply

NewForceReply creates a new ForceReply.

func (*ForceReply) WithInputFieldPlaceholder ¶ added in v0.0.2

func (markup *ForceReply) WithInputFieldPlaceholder(placeholder string) *ForceReply

WithInputFieldPlaceholder sets the placeholder to be shown in the input field when the reply is active; 1-64 characters

func (*ForceReply) WithSelective ¶ added in v0.0.2

func (markup *ForceReply) WithSelective() *ForceReply

WithSelective set it if you want to force reply for specific users only.

type ForwardMessageCall ¶

type ForwardMessageCall struct {
	Call[Message]
}

ForwardMessageCall reprenesents a call to the forwardMessage method. Use this method to forward messages of any kind Service messages can't be forwarded On success, the sent Message is returned.

func NewForwardMessageCall ¶

func NewForwardMessageCall(chatID PeerID, fromChatID PeerID, messageID int) *ForwardMessageCall

NewForwardMessageCall constructs a new ForwardMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) fromChatID - Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) messageID - Message identifier in the chat specified in from_chat_id

func (*ForwardMessageCall) ChatID ¶ added in v0.0.5

func (call *ForwardMessageCall) ChatID(chatID PeerID) *ForwardMessageCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*ForwardMessageCall) DisableNotification ¶

func (call *ForwardMessageCall) DisableNotification(disableNotification bool) *ForwardMessageCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*ForwardMessageCall) FromChatID ¶ added in v0.0.5

func (call *ForwardMessageCall) FromChatID(fromChatID PeerID) *ForwardMessageCall

FromChatID Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername)

func (*ForwardMessageCall) MessageID ¶ added in v0.0.5

func (call *ForwardMessageCall) MessageID(messageID int) *ForwardMessageCall

MessageID Message identifier in the chat specified in from_chat_id

func (*ForwardMessageCall) ProtectContent ¶

func (call *ForwardMessageCall) ProtectContent(protectContent bool) *ForwardMessageCall

ProtectContent Protects the contents of the forwarded message from forwarding and saving

type Game ¶

type Game struct {
	// Title of the game
	Title string `json:"title"`

	// Description of the game
	Description string `json:"description"`

	// Photo that will be displayed in the game message in chats.
	Photo []PhotoSize `json:"photo"`

	// Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
	Text string `json:"text,omitempty"`

	// Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
	TextEntities []MessageEntity `json:"text_entities,omitempty"`

	// Optional. Animation that will be displayed in the game message in chats. Upload via BotFather
	Animation *Animation `json:"animation,omitempty"`
}

Game this object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

type GameHighScore ¶

type GameHighScore struct {
	// Position in high score table for the game
	Position int `json:"position"`

	// User
	User User `json:"user"`

	// Score
	Score int `json:"score"`
}

GameHighScore this object represents one row of the high scores table for a game.

type GetChatAdministratorsCall ¶

type GetChatAdministratorsCall struct {
	Call[[]ChatMember]
}

GetChatAdministratorsCall reprenesents a call to the getChatAdministrators method. Use this method to get a list of administrators in a chat On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

func NewGetChatAdministratorsCall ¶

func NewGetChatAdministratorsCall(chatID PeerID) *GetChatAdministratorsCall

NewGetChatAdministratorsCall constructs a new GetChatAdministratorsCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

func (*GetChatAdministratorsCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

type GetChatCall ¶

type GetChatCall struct {
	Call[Chat]
}

GetChatCall reprenesents a call to the getChat method. 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.

func NewGetChatCall ¶

func NewGetChatCall(chatID PeerID) *GetChatCall

NewGetChatCall constructs a new GetChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

func (*GetChatCall) ChatID ¶ added in v0.0.5

func (call *GetChatCall) ChatID(chatID PeerID) *GetChatCall

ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

type GetChatMemberCall ¶

type GetChatMemberCall struct {
	Call[ChatMember]
}

GetChatMemberCall reprenesents a call to the getChatMember method. Use this method to get information about a member of a chat Returns a ChatMember object on success.

func NewGetChatMemberCall ¶

func NewGetChatMemberCall(chatID PeerID, userID UserID) *GetChatMemberCall

NewGetChatMemberCall constructs a new GetChatMemberCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) userID - Unique identifier of the target user

func (*GetChatMemberCall) ChatID ¶ added in v0.0.5

func (call *GetChatMemberCall) ChatID(chatID PeerID) *GetChatMemberCall

ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

func (*GetChatMemberCall) UserID ¶ added in v0.0.5

func (call *GetChatMemberCall) UserID(userID UserID) *GetChatMemberCall

UserID Unique identifier of the target user

type GetChatMemberCountCall ¶

type GetChatMemberCountCall struct {
	Call[int]
}

GetChatMemberCountCall reprenesents a call to the getChatMemberCount method. Use this method to get the number of members in a chat Returns Int on success.

func NewGetChatMemberCountCall ¶

func NewGetChatMemberCountCall(chatID PeerID) *GetChatMemberCountCall

NewGetChatMemberCountCall constructs a new GetChatMemberCountCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

func (*GetChatMemberCountCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

type GetChatMenuButtonCall ¶

type GetChatMenuButtonCall struct {
	Call[MenuButton]
}

GetChatMenuButtonCall reprenesents a call to the getChatMenuButton method. Use this method to get the current value of the bot's menu button in a private chat, or the default menu button Returns MenuButton on success.

func NewGetChatMenuButtonCall ¶

func NewGetChatMenuButtonCall() *GetChatMenuButtonCall

NewGetChatMenuButtonCall constructs a new GetChatMenuButtonCall with required parameters.

func (*GetChatMenuButtonCall) ChatID ¶ added in v0.0.5

func (call *GetChatMenuButtonCall) ChatID(chatID ChatID) *GetChatMenuButtonCall

ChatID Unique identifier for the target private chat. If not specified, default bot's menu button will be returned

type GetFileCall ¶

type GetFileCall struct {
	Call[File]
}

GetFileCall reprenesents a call to the getFile method. Use this method to get basic information about a file and prepare it for downloading For the moment, bots can download files of up to 20MB in size On success, a File object is returned The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response It is guaranteed that the link will be valid for at least 1 hour When the link expires, a new one can be requested by calling getFile again.

func NewGetFileCall ¶

func NewGetFileCall(fileID string) *GetFileCall

NewGetFileCall constructs a new GetFileCall with required parameters. fileID - File identifier to get information about

func (*GetFileCall) FileID ¶ added in v0.0.5

func (call *GetFileCall) FileID(fileID string) *GetFileCall

FileID File identifier to get information about

type GetGameHighScoresCall ¶

type GetGameHighScoresCall struct {
	Call[GameHighScore]
}

GetGameHighScoresCall reprenesents a call to the getGameHighScores method. Use this method to get data for high score tables Will return the score of the specified user and several of their neighbors in a game On success, returns an Array of GameHighScore objects. This method will currently return scores for the target user, plus two of their closest neighbors on each side Will also return the top three users if the user and their neighbors are not among them Please note that this behavior is subject to change.

func NewGetGameHighScoresCall ¶

func NewGetGameHighScoresCall(userID UserID) *GetGameHighScoresCall

NewGetGameHighScoresCall constructs a new GetGameHighScoresCall with required parameters. userID - Target user id

func (*GetGameHighScoresCall) ChatID ¶ added in v0.0.5

func (call *GetGameHighScoresCall) ChatID(chatID ChatID) *GetGameHighScoresCall

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat

func (*GetGameHighScoresCall) InlineMessageID ¶ added in v0.0.5

func (call *GetGameHighScoresCall) InlineMessageID(inlineMessageID string) *GetGameHighScoresCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*GetGameHighScoresCall) MessageID ¶ added in v0.0.5

func (call *GetGameHighScoresCall) MessageID(messageID int) *GetGameHighScoresCall

MessageID Required if inline_message_id is not specified. Identifier of the sent message

func (*GetGameHighScoresCall) UserID ¶ added in v0.0.5

func (call *GetGameHighScoresCall) UserID(userID UserID) *GetGameHighScoresCall

UserID Target user id

type GetMeCall ¶

type GetMeCall struct {
	Call[User]
}

GetMeCall reprenesents a call to the getMe method. A simple method for testing your bot's authentication token Requires no parameters Returns basic information about the bot in form of a User object.

func NewGetMeCall ¶

func NewGetMeCall() *GetMeCall

NewGetMeCall constructs a new GetMeCall with required parameters.

type GetMyCommandsCall ¶

type GetMyCommandsCall struct {
	Call[[]BotCommand]
}

GetMyCommandsCall reprenesents a call to the getMyCommands method. Use this method to get the current list of the bot's commands for the given scope and user language Returns Array of BotCommand on success If commands aren't set, an empty list is returned.

func NewGetMyCommandsCall ¶

func NewGetMyCommandsCall() *GetMyCommandsCall

NewGetMyCommandsCall constructs a new GetMyCommandsCall with required parameters.

func (*GetMyCommandsCall) LanguageCode ¶

func (call *GetMyCommandsCall) LanguageCode(languageCode string) *GetMyCommandsCall

LanguageCode A two-letter ISO 639-1 language code or an empty string

func (*GetMyCommandsCall) Scope ¶

Scope A JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.

type GetMyDefaultAdministratorRightsCall ¶

type GetMyDefaultAdministratorRightsCall struct {
	Call[ChatAdministratorRights]
}

GetMyDefaultAdministratorRightsCall reprenesents a call to the getMyDefaultAdministratorRights method. Use this method to get the current default administrator rights of the bot Returns ChatAdministratorRights on success.

func NewGetMyDefaultAdministratorRightsCall ¶

func NewGetMyDefaultAdministratorRightsCall() *GetMyDefaultAdministratorRightsCall

NewGetMyDefaultAdministratorRightsCall constructs a new GetMyDefaultAdministratorRightsCall with required parameters.

func (*GetMyDefaultAdministratorRightsCall) ForChannels ¶

ForChannels Pass True to get default administrator rights of the bot in channels. Otherwise, default administrator rights of the bot for groups and supergroups will be returned.

type GetStickerSetCall ¶

type GetStickerSetCall struct {
	Call[StickerSet]
}

GetStickerSetCall reprenesents a call to the getStickerSet method. Use this method to get a sticker set On success, a StickerSet object is returned.

func NewGetStickerSetCall ¶

func NewGetStickerSetCall(name string) *GetStickerSetCall

NewGetStickerSetCall constructs a new GetStickerSetCall with required parameters. name - Name of the sticker set

func (*GetStickerSetCall) Name ¶

func (call *GetStickerSetCall) Name(name string) *GetStickerSetCall

Name Name of the sticker set

type GetUpdatesCall ¶

type GetUpdatesCall struct {
	Call[[]Update]
}

GetUpdatesCall reprenesents a call to the getUpdates method. Use this method to receive incoming updates using long polling (wiki) An Array of Update objects is returned.

func NewGetUpdatesCall ¶

func NewGetUpdatesCall() *GetUpdatesCall

NewGetUpdatesCall constructs a new GetUpdatesCall with required parameters.

func (*GetUpdatesCall) AllowedUpdates ¶

func (call *GetUpdatesCall) AllowedUpdates(allowedUpdates []string) *GetUpdatesCall

AllowedUpdates A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.

func (*GetUpdatesCall) Limit ¶

func (call *GetUpdatesCall) Limit(limit int) *GetUpdatesCall

Limit Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.

func (*GetUpdatesCall) Offset ¶

func (call *GetUpdatesCall) Offset(offset int) *GetUpdatesCall

Offset Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten.

func (*GetUpdatesCall) Timeout ¶

func (call *GetUpdatesCall) Timeout(timeout int) *GetUpdatesCall

Timeout Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.

type GetUserProfilePhotosCall ¶

type GetUserProfilePhotosCall struct {
	Call[UserProfilePhotos]
}

GetUserProfilePhotosCall reprenesents a call to the getUserProfilePhotos method. Use this method to get a list of profile pictures for a user Returns a UserProfilePhotos object.

func NewGetUserProfilePhotosCall ¶

func NewGetUserProfilePhotosCall(userID UserID) *GetUserProfilePhotosCall

NewGetUserProfilePhotosCall constructs a new GetUserProfilePhotosCall with required parameters. userID - Unique identifier of the target user

func (*GetUserProfilePhotosCall) Limit ¶

Limit Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.

func (*GetUserProfilePhotosCall) Offset ¶

Offset Sequential number of the first photo to be returned. By default, all photos are returned.

func (*GetUserProfilePhotosCall) UserID ¶ added in v0.0.5

UserID Unique identifier of the target user

type GetWebhookInfoCall ¶

type GetWebhookInfoCall struct {
	Call[WebhookInfo]
}

GetWebhookInfoCall reprenesents a call to the getWebhookInfo method. Use this method to get current webhook status Requires no parameters On success, returns a WebhookInfo object If the bot is using getUpdates, will return an object with the url field empty.

func NewGetWebhookInfoCall ¶

func NewGetWebhookInfoCall() *GetWebhookInfoCall

NewGetWebhookInfoCall constructs a new GetWebhookInfoCall with required parameters.

type InlineKeyboardButton ¶

type InlineKeyboardButton struct {
	// Label text on the button
	Text string `json:"text"`

	// Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
	URL string `json:"url,omitempty"`

	// Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
	CallbackData string `json:"callback_data,omitempty"`

	// Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.
	WebApp *WebAppInfo `json:"web_app,omitempty"`

	// Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
	LoginURL *LoginURL `json:"login_url,omitempty"`

	// Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
	SwitchInlineQuery string `json:"switch_inline_query,omitempty"`

	// Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.
	SwitchInlineQueryCurrentChat string `json:"switch_inline_query_current_chat,omitempty"`

	// Optional. Description of the game that will be launched when the user presses the button.NOTE: This type of button must always be the first button in the first row.
	CallbackGame *CallbackGame `json:"callback_game,omitempty"`

	// Optional. Specify True, to send a Pay button.NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
	Pay bool `json:"pay,omitempty"`
}

InlineKeyboardButton this object represents one button of an inline keyboard. You must use exactly one of the optional fields.

func NewInlineKeyboardButtonCallback ¶ added in v0.0.2

func NewInlineKeyboardButtonCallback(text string, query string) InlineKeyboardButton

NewInlineKeyboardButtonCallback creates a new InlineKeyboardButton with specified callback data. Query should have length 1-64 bytes.

func NewInlineKeyboardButtonCallbackGame ¶ added in v0.0.2

func NewInlineKeyboardButtonCallbackGame(text string) InlineKeyboardButton

NewInlineKeyboardButtonCallbackGame represents the button which open a game.

func NewInlineKeyboardButtonLoginURL ¶ added in v0.0.2

func NewInlineKeyboardButtonLoginURL(text string, loginURL LoginURL) InlineKeyboardButton

InlineKeyboardMarkup represents button that open web page with auth data.

func NewInlineKeyboardButtonPay ¶ added in v0.0.2

func NewInlineKeyboardButtonPay(text string) InlineKeyboardButton

NewInlineKeyboardButtonPay represents a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages

func NewInlineKeyboardButtonSwitchInlineQuery ¶ added in v0.0.2

func NewInlineKeyboardButtonSwitchInlineQuery(text string, query string) InlineKeyboardButton

NewInlineKeyboardButtonSwitchInlineQuery represents button that

will prompt the user to select one of their chats,

open that chat and insert the bot's username and the specified inline query in the input field.

func NewInlineKeyboardButtonSwitchInlineQueryCurrentChat ¶ added in v0.0.2

func NewInlineKeyboardButtonSwitchInlineQueryCurrentChat(text string, query string) InlineKeyboardButton

NewInlineKeyboardButtonSwitchInlineQueryCurrentChat represents button that will insert the bot's username and the specified inline query in the current chat's input field

func NewInlineKeyboardButtonURL ¶ added in v0.0.2

func NewInlineKeyboardButtonURL(text string, url string) InlineKeyboardButton

NewInlineButtonURL create inline button with http(s):// or tg:// URL to be opened when the button is pressed.

func NewInlineKeyboardButtonWebApp ¶ added in v0.0.2

func NewInlineKeyboardButtonWebApp(text string, webApp WebAppInfo) InlineKeyboardButton

NewInlineKeyboardButtonWebApp creates a button that open a web app.

type InlineKeyboardMarkup ¶

type InlineKeyboardMarkup struct {
	// Array of button rows, each represented by an Array of InlineKeyboardButton objects
	InlineKeyboard [][]InlineKeyboardButton `json:"inline_keyboard"`
}

InlineKeyboardMarkup this object represents an inline keyboard that appears right next to the message it belongs to.

func NewInlineKeyboardMarkup ¶ added in v0.0.2

func NewInlineKeyboardMarkup(rows ...[]InlineKeyboardButton) InlineKeyboardMarkup

NewInlineKeyboardMarkup creates a new InlineKeyboardMarkup.

func (InlineKeyboardMarkup) Ptr ¶ added in v0.0.3

type InlineQuery ¶

type InlineQuery struct {
	// Unique identifier for this query
	ID string `json:"id"`

	// Sender
	From User `json:"from"`

	// Text of the query (up to 256 characters)
	Query string `json:"query"`

	// Offset of the results to be returned, can be controlled by the bot
	Offset string `json:"offset"`

	// Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat
	ChatType ChatType `json:"chat_type,omitempty"`

	// Optional. Sender location, only for bots that request user location
	Location *Location `json:"location,omitempty"`
}

InlineQuery this object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

type InlineQueryResult ¶

type InlineQueryResult interface {
	json.Marshaler
	// contains filtered or unexported methods
}

type InlineQueryResultArticle ¶

type InlineQueryResultArticle struct {
	// Type of the result, must be article
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 Bytes
	ID string `json:"id"`

	// Title of the result
	Title string `json:"title"`

	// Content of the message to be sent
	InputMessageContent InputMessageContent `json:"input_message_content"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. URL of the result
	URL string `json:"url,omitempty"`

	// Optional. Pass True, if you don't want the URL to be shown in the message
	HideURL bool `json:"hide_url,omitempty"`

	// Optional. Short description of the result
	Description string `json:"description,omitempty"`

	// Optional. Url of the thumbnail for the result
	ThumbURL string `json:"thumb_url,omitempty"`

	// Optional. Thumbnail width
	ThumbWidth int `json:"thumb_width,omitempty"`

	// Optional. Thumbnail height
	ThumbHeight int `json:"thumb_height,omitempty"`
}

InlineQueryResultArticle represents a link to an article or web page.

func (InlineQueryResultArticle) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultArticle) MarshalJSON() ([]byte, error)

type InlineQueryResultAudio ¶

type InlineQueryResultAudio struct {
	// Type of the result, must be audio
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid URL for the audio file
	AudioURL string `json:"audio_url"`

	// Title
	Title string `json:"title"`

	// Optional. Caption, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Performer
	Performer string `json:"performer,omitempty"`

	// Optional. Audio duration in seconds
	AudioDuration int `json:"audio_duration,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the audio
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultAudio represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

func (InlineQueryResultAudio) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultAudio) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedAudio ¶

type InlineQueryResultCachedAudio struct {
	// Type of the result, must be audio
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid file identifier for the audio file
	AudioFileID string `json:"audio_file_id"`

	// Optional. Caption, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the audio
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedAudio represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

func (InlineQueryResultCachedAudio) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultCachedAudio) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedDocument ¶

type InlineQueryResultCachedDocument struct {
	// Type of the result, must be document
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// Title for the result
	Title string `json:"title"`

	// A valid file identifier for the file
	DocumentFileID string `json:"document_file_id"`

	// Optional. Short description of the result
	Description string `json:"description,omitempty"`

	// Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the document caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the file
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedDocument represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

func (InlineQueryResultCachedDocument) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultCachedDocument) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedGIF ¶ added in v0.0.5

type InlineQueryResultCachedGIF struct {
	// Type of the result, must be gif
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid file identifier for the GIF file
	GIFFileID string `json:"gif_file_id"`

	// Optional. Title for the result
	Title string `json:"title,omitempty"`

	// Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the GIF animation
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedGIF represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.

func (InlineQueryResultCachedGIF) MarshalJSON ¶ added in v0.0.5

func (result InlineQueryResultCachedGIF) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedMPEG4GIF ¶ added in v0.0.5

type InlineQueryResultCachedMPEG4GIF struct {
	// Type of the result, must be mpeg4_gif
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid file identifier for the MPEG4 file
	MPEG4FileID string `json:"mpeg4_file_id"`

	// Optional. Title for the result
	Title string `json:"title,omitempty"`

	// Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the video animation
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedMPEG4GIF represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

func (InlineQueryResultCachedMPEG4GIF) MarshalJSON ¶ added in v0.0.5

func (result InlineQueryResultCachedMPEG4GIF) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedPhoto ¶

type InlineQueryResultCachedPhoto struct {
	// Type of the result, must be photo
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid file identifier of the photo
	PhotoFileID string `json:"photo_file_id"`

	// Optional. Title for the result
	Title string `json:"title,omitempty"`

	// Optional. Short description of the result
	Description string `json:"description,omitempty"`

	// Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the photo
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedPhoto represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

func (InlineQueryResultCachedPhoto) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultCachedPhoto) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedSticker ¶

type InlineQueryResultCachedSticker struct {
	// Type of the result, must be sticker
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid file identifier of the sticker
	StickerFileID string `json:"sticker_file_id"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the sticker
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedSticker represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

func (InlineQueryResultCachedSticker) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultCachedSticker) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedVideo ¶

type InlineQueryResultCachedVideo struct {
	// Type of the result, must be video
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid file identifier for the video file
	VideoFileID string `json:"video_file_id"`

	// Title for the result
	Title string `json:"title"`

	// Optional. Short description of the result
	Description string `json:"description,omitempty"`

	// Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the video caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the video
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedVideo represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

func (InlineQueryResultCachedVideo) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultCachedVideo) MarshalJSON() ([]byte, error)

type InlineQueryResultCachedVoice ¶

type InlineQueryResultCachedVoice struct {
	// Type of the result, must be voice
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid file identifier for the voice message
	VoiceFileID string `json:"voice_file_id"`

	// Voice message title
	Title string `json:"title"`

	// Optional. Caption, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the voice message
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultCachedVoice represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

func (InlineQueryResultCachedVoice) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultCachedVoice) MarshalJSON() ([]byte, error)

type InlineQueryResultContact ¶

type InlineQueryResultContact struct {
	// Type of the result, must be contact
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 Bytes
	ID string `json:"id"`

	// Contact's phone number
	PhoneNumber string `json:"phone_number"`

	// Contact's first name
	FirstName string `json:"first_name"`

	// Optional. Contact's last name
	LastName string `json:"last_name,omitempty"`

	// Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
	Vcard string `json:"vcard,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the contact
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`

	// Optional. Url of the thumbnail for the result
	ThumbURL string `json:"thumb_url,omitempty"`

	// Optional. Thumbnail width
	ThumbWidth int `json:"thumb_width,omitempty"`

	// Optional. Thumbnail height
	ThumbHeight int `json:"thumb_height,omitempty"`
}

InlineQueryResultContact represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

func (InlineQueryResultContact) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultContact) MarshalJSON() ([]byte, error)

type InlineQueryResultDocument ¶

type InlineQueryResultDocument struct {
	// Type of the result, must be document
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// Title for the result
	Title string `json:"title"`

	// Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the document caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// A valid URL for the file
	DocumentURL string `json:"document_url"`

	// MIME type of the content of the file, either “application/pdf” or “application/zip”
	MIMEType string `json:"mime_type"`

	// Optional. Short description of the result
	Description string `json:"description,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the file
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`

	// Optional. URL of the thumbnail (JPEG only) for the file
	ThumbURL string `json:"thumb_url,omitempty"`

	// Optional. Thumbnail width
	ThumbWidth int `json:"thumb_width,omitempty"`

	// Optional. Thumbnail height
	ThumbHeight int `json:"thumb_height,omitempty"`
}

InlineQueryResultDocument represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

func (InlineQueryResultDocument) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultDocument) MarshalJSON() ([]byte, error)

type InlineQueryResultGIF ¶ added in v0.0.5

type InlineQueryResultGIF struct {
	// Type of the result, must be gif
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid URL for the GIF file. File size must not exceed 1MB
	GIFURL string `json:"gif_url"`

	// Optional. Width of the GIF
	GIFWidth int `json:"gif_width,omitempty"`

	// Optional. Height of the GIF
	GIFHeight int `json:"gif_height,omitempty"`

	// Optional. Duration of the GIF in seconds
	GIFDuration int `json:"gif_duration,omitempty"`

	// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
	ThumbURL string `json:"thumb_url"`

	// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
	ThumbMIMEType string `json:"thumb_mime_type,omitempty"`

	// Optional. Title for the result
	Title string `json:"title,omitempty"`

	// Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the GIF animation
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultGIF represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

func (InlineQueryResultGIF) MarshalJSON ¶ added in v0.0.5

func (result InlineQueryResultGIF) MarshalJSON() ([]byte, error)

type InlineQueryResultGame ¶

type InlineQueryResultGame struct {
	// Type of the result, must be game
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// Short name of the game
	GameShortName string `json:"game_short_name"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}

InlineQueryResultGame represents a Game.

func (InlineQueryResultGame) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultGame) MarshalJSON() ([]byte, error)

type InlineQueryResultLocation ¶

type InlineQueryResultLocation struct {
	// Type of the result, must be location
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 Bytes
	ID string `json:"id"`

	// Location latitude in degrees
	Latitude float64 `json:"latitude"`

	// Location longitude in degrees
	Longitude float64 `json:"longitude"`

	// Location title
	Title string `json:"title"`

	// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
	HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`

	// Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
	LivePeriod int `json:"live_period,omitempty"`

	// Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
	Heading int `json:"heading,omitempty"`

	// Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
	ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the location
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`

	// Optional. Url of the thumbnail for the result
	ThumbURL string `json:"thumb_url,omitempty"`

	// Optional. Thumbnail width
	ThumbWidth int `json:"thumb_width,omitempty"`

	// Optional. Thumbnail height
	ThumbHeight int `json:"thumb_height,omitempty"`
}

InlineQueryResultLocation represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

func (InlineQueryResultLocation) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultLocation) MarshalJSON() ([]byte, error)

type InlineQueryResultMPEG4GIF ¶ added in v0.0.5

type InlineQueryResultMPEG4GIF struct {
	// Type of the result, must be mpeg4_gif
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid URL for the MPEG4 file. File size must not exceed 1MB
	MPEG4URL string `json:"mpeg4_url"`

	// Optional. Video width
	MPEG4Width int `json:"mpeg4_width,omitempty"`

	// Optional. Video height
	MPEG4Height int `json:"mpeg4_height,omitempty"`

	// Optional. Video duration in seconds
	MPEG4Duration int `json:"mpeg4_duration,omitempty"`

	// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
	ThumbURL string `json:"thumb_url"`

	// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
	ThumbMIMEType string `json:"thumb_mime_type,omitempty"`

	// Optional. Title for the result
	Title string `json:"title,omitempty"`

	// Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the video animation
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultMPEG4GIF represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

func (InlineQueryResultMPEG4GIF) MarshalJSON ¶ added in v0.0.5

func (result InlineQueryResultMPEG4GIF) MarshalJSON() ([]byte, error)

type InlineQueryResultPhoto ¶

type InlineQueryResultPhoto struct {
	// Type of the result, must be photo
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB
	PhotoURL string `json:"photo_url"`

	// URL of the thumbnail for the photo
	ThumbURL string `json:"thumb_url"`

	// Optional. Width of the photo
	PhotoWidth int `json:"photo_width,omitempty"`

	// Optional. Height of the photo
	PhotoHeight int `json:"photo_height,omitempty"`

	// Optional. Title for the result
	Title string `json:"title,omitempty"`

	// Optional. Short description of the result
	Description string `json:"description,omitempty"`

	// Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the photo
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultPhoto represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

func (InlineQueryResultPhoto) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultPhoto) MarshalJSON() ([]byte, error)

type InlineQueryResultVenue ¶

type InlineQueryResultVenue struct {
	// Type of the result, must be venue
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 Bytes
	ID string `json:"id"`

	// Latitude of the venue location in degrees
	Latitude float64 `json:"latitude"`

	// Longitude of the venue location in degrees
	Longitude float64 `json:"longitude"`

	// Title of the venue
	Title string `json:"title"`

	// Address of the venue
	Address string `json:"address"`

	// Optional. Foursquare identifier of the venue if known
	FoursquareID string `json:"foursquare_id,omitempty"`

	// Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
	FoursquareType string `json:"foursquare_type,omitempty"`

	// Optional. Google Places identifier of the venue
	GooglePlaceID string `json:"google_place_id,omitempty"`

	// Optional. Google Places type of the venue. (See supported types.)
	GooglePlaceType string `json:"google_place_type,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the venue
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`

	// Optional. Url of the thumbnail for the result
	ThumbURL string `json:"thumb_url,omitempty"`

	// Optional. Thumbnail width
	ThumbWidth int `json:"thumb_width,omitempty"`

	// Optional. Thumbnail height
	ThumbHeight int `json:"thumb_height,omitempty"`
}

InlineQueryResultVenue represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

func (InlineQueryResultVenue) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultVenue) MarshalJSON() ([]byte, error)

type InlineQueryResultVideo ¶

type InlineQueryResultVideo struct {
	// Type of the result, must be video
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid URL for the embedded video player or video file
	VideoURL string `json:"video_url"`

	// MIME type of the content of the video URL, “text/html” or “video/mp4”
	MIMEType string `json:"mime_type"`

	// URL of the thumbnail (JPEG only) for the video
	ThumbURL string `json:"thumb_url"`

	// Title for the result
	Title string `json:"title"`

	// Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the video caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Video width
	VideoWidth int `json:"video_width,omitempty"`

	// Optional. Video height
	VideoHeight int `json:"video_height,omitempty"`

	// Optional. Video duration in seconds
	VideoDuration int `json:"video_duration,omitempty"`

	// Optional. Short description of the result
	Description string `json:"description,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultVideo represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

func (InlineQueryResultVideo) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultVideo) MarshalJSON() ([]byte, error)

type InlineQueryResultVoice ¶

type InlineQueryResultVoice struct {
	// Type of the result, must be voice
	Type string `json:"type"`

	// Unique identifier for this result, 1-64 bytes
	ID string `json:"id"`

	// A valid URL for the voice recording
	VoiceURL string `json:"voice_url"`

	// Recording title
	Title string `json:"title"`

	// Optional. Caption, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Recording duration in seconds
	VoiceDuration int `json:"voice_duration,omitempty"`

	// Optional. Inline keyboard attached to the message
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`

	// Optional. Content of the message to be sent instead of the voice recording
	InputMessageContent *InputMessageContent `json:"input_message_content,omitempty"`
}

InlineQueryResultVoice represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

func (InlineQueryResultVoice) MarshalJSON ¶ added in v0.0.3

func (result InlineQueryResultVoice) MarshalJSON() ([]byte, error)

type InputContactMessageContent ¶

type InputContactMessageContent struct {
	// Contact's phone number
	PhoneNumber string `json:"phone_number"`

	// Contact's first name
	FirstName string `json:"first_name"`

	// Optional. Contact's last name
	LastName string `json:"last_name,omitempty"`

	// Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes
	Vcard string `json:"vcard,omitempty"`
}

InputContactMessageContent represents the content of a contact message to be sent as the result of an inline query.

type InputFile ¶

type InputFile struct {
	// Name of file
	Name string

	// Body of file
	Body io.Reader
	// contains filtered or unexported fields
}

InputFile represents the file that should be uploaded to the telegram.

func NewInputFile ¶

func NewInputFile(name string, body io.Reader) InputFile

NewInputFile creates new InputFile with given name and body.

func NewInputFileBytes ¶

func NewInputFileBytes(name string, body []byte) InputFile

NewInputFileFromBytes creates new InputFile with given name and bytes slice.

Example:

file := NewInputFileBytes("test.txt", []byte("test, test, test..."))

func NewInputFileLocal ¶

func NewInputFileLocal(path string) (InputFile, func() error, error)

NewInputFileLocal creates the InputFile from provided local file. This method just open file by provided path. So, you should close it AFTER send.

Example:

file, close, err := NewInputFileLocal("test.png")
if err != nil {
    return err
}
defer close()

func (*InputFile) MarshalJSON ¶ added in v0.0.5

func (file *InputFile) MarshalJSON() ([]byte, error)

func (InputFile) Ptr ¶ added in v0.0.5

func (file InputFile) Ptr() *InputFile

Ptr returns pointer to InputFile. Helper method.

func (InputFile) WithName ¶

func (file InputFile) WithName(name string) InputFile

WithName creates new InputFile with overridden name.

type InputInvoiceMessageContent ¶

type InputInvoiceMessageContent struct {
	// Product name, 1-32 characters
	Title string `json:"title"`

	// Product description, 1-255 characters
	Description string `json:"description"`

	// Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
	Payload string `json:"payload"`

	// Payment provider token, obtained via @BotFather
	ProviderToken string `json:"provider_token"`

	// Three-letter ISO 4217 currency code, see more on currencies
	Currency string `json:"currency"`

	// Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
	Prices []LabeledPrice `json:"prices"`

	// Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
	MaxTipAmount int `json:"max_tip_amount,omitempty"`

	// Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.
	SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"`

	// Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.
	ProviderData string `json:"provider_data,omitempty"`

	// Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.
	PhotoURL string `json:"photo_url,omitempty"`

	// Optional. Photo size in bytes
	PhotoSize int `json:"photo_size,omitempty"`

	// Optional. Photo width
	PhotoWidth int `json:"photo_width,omitempty"`

	// Optional. Photo height
	PhotoHeight int `json:"photo_height,omitempty"`

	// Optional. Pass True, if you require the user's full name to complete the order
	NeedName bool `json:"need_name,omitempty"`

	// Optional. Pass True, if you require the user's phone number to complete the order
	NeedPhoneNumber bool `json:"need_phone_number,omitempty"`

	// Optional. Pass True, if you require the user's email address to complete the order
	NeedEmail bool `json:"need_email,omitempty"`

	// Optional. Pass True, if you require the user's shipping address to complete the order
	NeedShippingAddress bool `json:"need_shipping_address,omitempty"`

	// Optional. Pass True, if the user's phone number should be sent to provider
	SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"`

	// Optional. Pass True, if the user's email address should be sent to provider
	SendEmailToProvider bool `json:"send_email_to_provider,omitempty"`

	// Optional. Pass True, if the final price depends on the shipping method
	IsFlexible bool `json:"is_flexible,omitempty"`
}

InputInvoiceMessageContent represents the content of an invoice message to be sent as the result of an inline query.

type InputLocationMessageContent ¶

type InputLocationMessageContent struct {
	// Latitude of the location in degrees
	Latitude float64 `json:"latitude"`

	// Longitude of the location in degrees
	Longitude float64 `json:"longitude"`

	// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
	HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`

	// Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.
	LivePeriod int `json:"live_period,omitempty"`

	// Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
	Heading int `json:"heading,omitempty"`

	// Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
	ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
}

InputLocationMessageContent represents the content of a location message to be sent as the result of an inline query.

type InputMedia ¶

type InputMedia interface {
	// contains filtered or unexported methods
}

type InputMediaAnimation ¶

type InputMediaAnimation struct {
	// Type of the result, must be animation
	Type string `json:"type"`

	// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
	Media FileArg `json:"media"`

	// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
	Thumb *InputFile `json:"thumb,omitempty"`

	// Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the animation caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Animation width
	Width int `json:"width,omitempty"`

	// Optional. Animation height
	Height int `json:"height,omitempty"`

	// Optional. Animation duration in seconds
	Duration int `json:"duration,omitempty"`
}

InputMediaAnimation represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

func (*InputMediaAnimation) MarshalJSON ¶ added in v0.0.5

func (media *InputMediaAnimation) MarshalJSON() ([]byte, error)

type InputMediaAudio ¶

type InputMediaAudio struct {
	// Type of the result, must be audio
	Type string `json:"type"`

	// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
	Media FileArg `json:"media"`

	// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
	Thumb *InputFile `json:"thumb,omitempty"`

	// Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Duration of the audio in seconds
	Duration int `json:"duration,omitempty"`

	// Optional. Performer of the audio
	Performer string `json:"performer,omitempty"`

	// Optional. Title of the audio
	Title string `json:"title,omitempty"`
}

InputMediaAudio represents an audio file to be treated as music to be sent.

func (*InputMediaAudio) MarshalJSON ¶ added in v0.0.5

func (media *InputMediaAudio) MarshalJSON() ([]byte, error)

type InputMediaDocument ¶

type InputMediaDocument struct {
	// Type of the result, must be document
	Type string `json:"type"`

	// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
	Media FileArg `json:"media"`

	// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
	Thumb *InputFile `json:"thumb,omitempty"`

	// Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the document caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
	DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"`
}

InputMediaDocument represents a general file to be sent.

func (*InputMediaDocument) MarshalJSON ¶ added in v0.0.5

func (media *InputMediaDocument) MarshalJSON() ([]byte, error)

type InputMediaPhoto ¶

type InputMediaPhoto struct {
	// Type of the result, must be photo
	Type string `json:"type"`

	// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
	Media FileArg `json:"media"`

	// Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
}

InputMediaPhoto represents a photo to be sent.

func (*InputMediaPhoto) MarshalJSON ¶ added in v0.0.5

func (media *InputMediaPhoto) MarshalJSON() ([]byte, error)

type InputMediaVideo ¶

type InputMediaVideo struct {
	// Type of the result, must be video
	Type string `json:"type"`

	// File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »
	Media FileArg `json:"media"`

	// Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »
	Thumb *InputFile `json:"thumb,omitempty"`

	// Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
	Caption string `json:"caption,omitempty"`

	// Optional. Mode for parsing entities in the video caption. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Video width
	Width int `json:"width,omitempty"`

	// Optional. Video height
	Height int `json:"height,omitempty"`

	// Optional. Video duration in seconds
	Duration int `json:"duration,omitempty"`

	// Optional. Pass True, if the uploaded video is suitable for streaming
	SupportsStreaming bool `json:"supports_streaming,omitempty"`
}

InputMediaVideo represents a video to be sent.

func (*InputMediaVideo) MarshalJSON ¶ added in v0.0.5

func (media *InputMediaVideo) MarshalJSON() ([]byte, error)

type InputMessageContent ¶

type InputMessageContent interface {
	// contains filtered or unexported methods
}

type InputTextMessageContent ¶

type InputTextMessageContent struct {
	// Text of the message to be sent, 1-4096 characters
	MessageText string `json:"message_text"`

	// Optional. Mode for parsing entities in the message text. See formatting options for more details.
	ParseMode ParseMode `json:"parse_mode,omitempty"`

	// Optional. List of special entities that appear in message text, which can be specified instead of parse_mode
	Entities []MessageEntity `json:"entities,omitempty"`

	// Optional. Disables link previews for links in the sent message
	DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"`
}

InputTextMessageContent represents the content of a text message to be sent as the result of an inline query.

type InputVenueMessageContent ¶

type InputVenueMessageContent struct {
	// Latitude of the venue in degrees
	Latitude float64 `json:"latitude"`

	// Longitude of the venue in degrees
	Longitude float64 `json:"longitude"`

	// Name of the venue
	Title string `json:"title"`

	// Address of the venue
	Address string `json:"address"`

	// Optional. Foursquare identifier of the venue, if known
	FoursquareID string `json:"foursquare_id,omitempty"`

	// Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
	FoursquareType string `json:"foursquare_type,omitempty"`

	// Optional. Google Places identifier of the venue
	GooglePlaceID string `json:"google_place_id,omitempty"`

	// Optional. Google Places type of the venue. (See supported types.)
	GooglePlaceType string `json:"google_place_type,omitempty"`
}

InputVenueMessageContent represents the content of a venue message to be sent as the result of an inline query.

type Invoice ¶

type Invoice struct {
	// Product name
	Title string `json:"title"`

	// Product description
	Description string `json:"description"`

	// Unique bot deep-linking parameter that can be used to generate this invoice
	StartParameter string `json:"start_parameter"`

	// Three-letter ISO 4217 currency code
	Currency string `json:"currency"`

	// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
	TotalAmount int `json:"total_amount"`
}

Invoice this object contains basic information about an invoice.

type KeyboardButton ¶

type KeyboardButton struct {
	// Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
	Text string `json:"text"`

	// Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.
	RequestContact bool `json:"request_contact,omitempty"`

	// Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only.
	RequestLocation bool `json:"request_location,omitempty"`

	// Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.
	RequestPoll *KeyboardButtonPollType `json:"request_poll,omitempty"`

	// Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.
	WebApp *WebAppInfo `json:"web_app,omitempty"`
}

KeyboardButton this object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive.

func NewKeyboardButton ¶ added in v0.0.2

func NewKeyboardButton(text string) KeyboardButton

NewKeyboardButton creates a plain reply keyboard button.

func NewKeyboardButtonRequestContact ¶ added in v0.0.2

func NewKeyboardButtonRequestContact(text string) KeyboardButton

NewKeyboardButtonRequestContact creates a reply keyboard button that request a contact from user. Available in private chats only.

func NewKeyboardButtonRequestLocation ¶ added in v0.0.2

func NewKeyboardButtonRequestLocation(text string) KeyboardButton

NewKeyboardButtonRequestLocation creates a reply keyboard button that request a location from user. Available in private chats only.

func NewKeyboardButtonRequestPoll ¶ added in v0.0.2

func NewKeyboardButtonRequestPoll(text string, poll KeyboardButtonPollType) KeyboardButton

NewKeyboardButtonRequestPoll creates a reply keyboard button that request a poll from user. Available in private chats only.

func NewKeyboardButtonWebApp ¶ added in v0.0.2

func NewKeyboardButtonWebApp(text string, webApp WebAppInfo) KeyboardButton

NewKeyboardButtonWebApp create a reply keyboard button that open a web app.

type KeyboardButtonPollType ¶

type KeyboardButtonPollType struct {
	// Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.
	Type string `json:"type,omitempty"`
}

KeyboardButtonPollType this object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

type LabeledPrice ¶

type LabeledPrice struct {
	// Portion label
	Label string `json:"label"`

	// Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
	Amount int `json:"amount"`
}

LabeledPrice this object represents a portion of the price for goods or services.

type LeaveChatCall ¶

type LeaveChatCall struct {
	CallNoResult
}

LeaveChatCall reprenesents a call to the leaveChat method. Use this method for your bot to leave a group, supergroup or channel

func NewLeaveChatCall ¶

func NewLeaveChatCall(chatID PeerID) *LeaveChatCall

NewLeaveChatCall constructs a new LeaveChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

func (*LeaveChatCall) ChatID ¶ added in v0.0.5

func (call *LeaveChatCall) ChatID(chatID PeerID) *LeaveChatCall

ChatID Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)

type Location ¶

type Location struct {
	// Longitude as defined by sender
	Longitude float64 `json:"longitude"`

	// Latitude as defined by sender
	Latitude float64 `json:"latitude"`

	// Optional. The radius of uncertainty for the location, measured in meters; 0-1500
	HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`

	// Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
	LivePeriod int `json:"live_period,omitempty"`

	// Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
	Heading int `json:"heading,omitempty"`

	// Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
	ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
}

Location this object represents a point on the map.

type LogOutCall ¶

type LogOutCall struct {
	CallNoResult
}

LogOutCall reprenesents a call to the logOut method. Use this method to log out from the cloud Bot API server before launching the bot locally You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes Requires no parameters.

func NewLogOutCall ¶

func NewLogOutCall() *LogOutCall

NewLogOutCall constructs a new LogOutCall with required parameters.

type LoginURL ¶ added in v0.0.5

type LoginURL struct {
	// An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.
	URL string `json:"url"`

	// Optional. New text of the button in forwarded messages.
	ForwardText string `json:"forward_text,omitempty"`

	// Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.
	BotUsername string `json:"bot_username,omitempty"`

	// Optional. Pass True to request the permission for your bot to send messages to the user.
	RequestWriteAccess bool `json:"request_write_access,omitempty"`
}

LoginURL this object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:

type MaskPosition ¶

type MaskPosition struct {
	// The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
	Point string `json:"point"`

	// Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
	XShift float64 `json:"x_shift"`

	// Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
	YShift float64 `json:"y_shift"`

	// Mask scaling coefficient. For example, 2.0 means double size.
	Scale float64 `json:"scale"`
}

MaskPosition this object describes the position on faces where a mask should be placed by default.

type MenuButton interface {
	json.Marshaler
	// contains filtered or unexported methods
}
type MenuButtonCommands struct {
	// Type of the button, must be commands
	Type string `json:"type"`
}

MenuButtonCommands represents a menu button, which opens the bot's list of commands.

func (button MenuButtonCommands) MarshalJSON() ([]byte, error)
type MenuButtonDefault struct {
	// Type of the button, must be default
	Type string `json:"type"`
}

MenuButtonDefault describes that no specific value for the menu button was set.

func (button MenuButtonDefault) MarshalJSON() ([]byte, error)
type MenuButtonWebApp struct {
	// Type of the button, must be web_app
	Type string `json:"type"`

	// Text on the button
	Text string `json:"text"`

	// Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.
	WebApp WebAppInfo `json:"web_app"`
}

MenuButtonWebApp represents a menu button, which launches a Web App.

func (button MenuButtonWebApp) MarshalJSON() ([]byte, error)

type Message ¶

type Message struct {
	// Unique message identifier inside this chat
	ID int `json:"message_id"`

	// Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
	From *User `json:"from,omitempty"`

	// Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.
	SenderChat *Chat `json:"sender_chat,omitempty"`

	// Date the message was sent in Unix time
	Date int `json:"date"`

	// Conversation the message belongs to
	Chat Chat `json:"chat"`

	// Optional. For forwarded messages, sender of the original message
	ForwardFrom *User `json:"forward_from,omitempty"`

	// Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
	ForwardFromChat *Chat `json:"forward_from_chat,omitempty"`

	// Optional. For messages forwarded from channels, identifier of the original message in the channel
	ForwardFromMessageID int `json:"forward_from_message_id,omitempty"`

	// Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present
	ForwardSignature string `json:"forward_signature,omitempty"`

	// Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
	ForwardSenderName string `json:"forward_sender_name,omitempty"`

	// Optional. For forwarded messages, date the original message was sent in Unix time
	ForwardDate int64 `json:"forward_date,omitempty"`

	// Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group
	IsAutomaticForward bool `json:"is_automatic_forward,omitempty"`

	// Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.
	ReplyToMessage *Message `json:"reply_to_message,omitempty"`

	// Optional. Bot through which the message was sent
	ViaBot *User `json:"via_bot,omitempty"`

	// Optional. Date the message was last edited in Unix time
	EditDate int64 `json:"edit_date,omitempty"`

	// Optional. True, if the message can't be forwarded
	HasProtectedContent bool `json:"has_protected_content,omitempty"`

	// Optional. The unique identifier of a media message group this message belongs to
	MediaGroupID string `json:"media_group_id,omitempty"`

	// Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
	AuthorSignature string `json:"author_signature,omitempty"`

	// Optional. For text messages, the actual UTF-8 text of the message
	Text string `json:"text,omitempty"`

	// Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
	Entities []MessageEntity `json:"entities,omitempty"`

	// Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
	Animation *Animation `json:"animation,omitempty"`

	// Optional. Message is an audio file, information about the file
	Audio *Audio `json:"audio,omitempty"`

	// Optional. Message is a general file, information about the file
	Document *Document `json:"document,omitempty"`

	// Optional. Message is a photo, available sizes of the photo
	Photo []PhotoSize `json:"photo,omitempty"`

	// Optional. Message is a sticker, information about the sticker
	Sticker *Sticker `json:"sticker,omitempty"`

	// Optional. Message is a video, information about the video
	Video *Video `json:"video,omitempty"`

	// Optional. Message is a video note, information about the video message
	VideoNote *VideoNote `json:"video_note,omitempty"`

	// Optional. Message is a voice message, information about the file
	Voice *Voice `json:"voice,omitempty"`

	// Optional. Caption for the animation, audio, document, photo, video or voice
	Caption string `json:"caption,omitempty"`

	// Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
	CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`

	// Optional. Message is a shared contact, information about the contact
	Contact *Contact `json:"contact,omitempty"`

	// Optional. Message is a dice with random value
	Dice *Dice `json:"dice,omitempty"`

	// Optional. Message is a game, information about the game. More about games »
	Game *Game `json:"game,omitempty"`

	// Optional. Message is a native poll, information about the poll
	Poll *Poll `json:"poll,omitempty"`

	// Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
	Venue *Venue `json:"venue,omitempty"`

	// Optional. Message is a shared location, information about the location
	Location *Location `json:"location,omitempty"`

	// Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)
	NewChatMembers []User `json:"new_chat_members,omitempty"`

	// Optional. A member was removed from the group, information about them (this member may be the bot itself)
	LeftChatMember *User `json:"left_chat_member,omitempty"`

	// Optional. A chat title was changed to this value
	NewChatTitle string `json:"new_chat_title,omitempty"`

	// Optional. A chat photo was change to this value
	NewChatPhoto []PhotoSize `json:"new_chat_photo,omitempty"`

	// Optional. Service message: the chat photo was deleted
	DeleteChatPhoto bool `json:"delete_chat_photo,omitempty"`

	// Optional. Service message: the group has been created
	GroupChatCreated bool `json:"group_chat_created,omitempty"`

	// Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.
	SupergroupChatCreated bool `json:"supergroup_chat_created,omitempty"`

	// Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.
	ChannelChatCreated bool `json:"channel_chat_created,omitempty"`

	// Optional. Service message: auto-delete timer settings changed in the chat
	MessageAutoDeleteTimerChanged *MessageAutoDeleteTimerChanged `json:"message_auto_delete_timer_changed,omitempty"`

	// Optional. The group has been migrated to a supergroup with the specified identifier.
	MigrateToChatID ChatID `json:"migrate_to_chat_id,omitempty"`

	// Optional. The supergroup has been migrated from a group with the specified identifier.
	MigrateFromChatID ChatID `json:"migrate_from_chat_id,omitempty"`

	// Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.
	PinnedMessage *Message `json:"pinned_message,omitempty"`

	// Optional. Message is an invoice for a payment, information about the invoice. More about payments »
	Invoice *Invoice `json:"invoice,omitempty"`

	// Optional. Message is a service message about a successful payment, information about the payment. More about payments »
	SuccessfulPayment *SuccessfulPayment `json:"successful_payment,omitempty"`

	// Optional. The domain name of the website on which the user has logged in. More about Telegram Login »
	ConnectedWebsite string `json:"connected_website,omitempty"`

	// Optional. Telegram Passport data
	PassportData *PassportData `json:"passport_data,omitempty"`

	// Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
	ProximityAlertTriggered *ProximityAlertTriggered `json:"proximity_alert_triggered,omitempty"`

	// Optional. Service message: video chat scheduled
	VideoChatScheduled *VideoChatScheduled `json:"video_chat_scheduled,omitempty"`

	// Optional. Service message: video chat started
	VideoChatStarted *VideoChatStarted `json:"video_chat_started,omitempty"`

	// Optional. Service message: video chat ended
	VideoChatEnded *VideoChatEnded `json:"video_chat_ended,omitempty"`

	// Optional. Service message: new participants invited to a video chat
	VideoChatParticipantsInvited *VideoChatParticipantsInvited `json:"video_chat_participants_invited,omitempty"`

	// Optional. Service message: data sent by a Web App
	WebAppData *WebAppData `json:"web_app_data,omitempty"`

	// Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
	ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}

Message this object represents a message.

func (*Message) Type ¶ added in v0.0.6

func (msg *Message) Type() MessageType

type MessageAutoDeleteTimerChanged ¶

type MessageAutoDeleteTimerChanged struct {
	// New auto-delete time for messages in the chat; in seconds
	MessageAutoDeleteTime int `json:"message_auto_delete_time"`
}

MessageAutoDeleteTimerChanged this object represents a service message about a change in auto-delete timer settings.

type MessageEntity ¶

type MessageEntity struct {
	// Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)
	Type string `json:"type"`

	// Offset in UTF-16 code units to the start of the entity
	Offset int `json:"offset"`

	// Length of the entity in UTF-16 code units
	Length int `json:"length"`

	// Optional. For “text_link” only, URL that will be opened after user taps on the text
	URL string `json:"url,omitempty"`

	// Optional. For “text_mention” only, the mentioned user
	User *User `json:"user,omitempty"`

	// Optional. For “pre” only, the programming language of the entity text
	Language string `json:"language,omitempty"`
}

MessageEntity this object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

type MessageID ¶

type MessageID struct {
	// Unique message identifier
	MessageID int `json:"message_id"`
}

MessageID this object represents a unique message identifier.

type MessageType ¶ added in v0.0.6

type MessageType int

MessageType it's type for describe content of Message.

const (
	MessageTypeUnknown MessageType = iota
	MessageTypeText
	MessageTypeAnimation
	MessageTypeAudio
	MessageTypeDocument
	MessageTypePhoto
	MessageTypeSticker
	MessageTypeVideo
	MessageTypeVideoNote
	MessageTypeVoice
	MessageTypeContact
	MessageTypeDice
	MessageTypeGame
	MessageTypePoll
	MessageTypeVenue
	MessageTypeLocation
	MessageTypeNewChatMembers
	MessageTypeLeftChatMember
	MessageTypeNewChatTitle
	MessageTypeNewChatPhoto
	MessageTypeDeleteChatPhoto
	MessageTypeGroupChatCreated
	MessageTypeSupergroupChatCreated
	MessageTypeChannelChatCreated
	MessageTypeMessageAutoDeleteTimerChanged
	MessageTypeMigrateToChatID
	MessageTypeMigrateFromChatID
	MessageTypePinnedMessage
	MessageTypeInvoice
	MessageTypeSuccessfulPayment
	MessageTypeConnectedWebsite
	MessageTypePassportData
	MessageTypeProximityAlertTriggered
	MessageTypeVideoChatScheduled
	MessageTypeVideoChatStarted
	MessageTypeVideoChatEnded
	MessageTypeVideoChatParticipantsInvited
	MessageTypeWebAppData
)

type OrderInfo ¶

type OrderInfo struct {
	// Optional. User name
	Name string `json:"name,omitempty"`

	// Optional. User's phone number
	PhoneNumber string `json:"phone_number,omitempty"`

	// Optional. User email
	Email string `json:"email,omitempty"`

	// Optional. User shipping address
	ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"`
}

OrderInfo this object represents information about an order.

type ParseMode ¶

type ParseMode interface {
	encoding.TextMarshaler
	fmt.Stringer

	// Change separator for next calls
	Sep(v string) ParseMode

	// Text joins the given strings with new line seprator
	Text(v ...string) string

	// Line joins the given strings with space seprator
	Line(v ...string) string

	// Bold
	Bold(v ...string) string

	// Italic
	Italic(v ...string) string

	// Underline
	Underline(v ...string) string

	// Deleted (Striketrough)
	Strike(v ...string) string

	// Spoiler
	Spoiler(v ...string) string

	// Link
	Link(title, url string) string

	// Code
	Code(v ...string) string

	// Preformated text
	Pre(v ...string) string

	// Escape
	Escape(v string) string
}
var (
	// HTML is ParseMode that uses HTML tags
	HTML ParseMode = parseMode{
			// contains filtered or unexported fields
	}

	// MD is ParseMode that uses Markdown tags.
	// Warning: this is legacy mode, use MarkdownV2 (MD2) instead.
	MD ParseMode = parseMode{
		// contains filtered or unexported fields
	}

	// MD2 is ParseMode that uses MarkdownV2 tags.
	MD2 ParseMode = parseMode{
		// contains filtered or unexported fields
	}
)

type PassportData ¶

type PassportData struct {
	// Array with information about documents and other Telegram Passport elements that was shared with the bot
	Data []EncryptedPassportElement `json:"data"`

	// Encrypted credentials required to decrypt the data
	Credentials EncryptedCredentials `json:"credentials"`
}

PassportData describes Telegram Passport data shared with the bot by the user.

type PassportElementError ¶

type PassportElementError struct {
	// Error source, must be data
	Source string `json:"source"`

	// The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
	Type string `json:"type"`

	// Name of the data field which has the error
	FieldName string `json:"field_name"`

	// Base64-encoded data hash
	DataHash string `json:"data_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementError this object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:

type PassportElementErrorDataField ¶

type PassportElementErrorDataField struct {
	// Error source, must be data
	Source string `json:"source"`

	// The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
	Type string `json:"type"`

	// Name of the data field which has the error
	FieldName string `json:"field_name"`

	// Base64-encoded data hash
	DataHash string `json:"data_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorDataField represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.

type PassportElementErrorFile ¶

type PassportElementErrorFile struct {
	// Error source, must be file
	Source string `json:"source"`

	// The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
	Type string `json:"type"`

	// Base64-encoded file hash
	FileHash string `json:"file_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorFile represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.

type PassportElementErrorFiles ¶

type PassportElementErrorFiles struct {
	// Error source, must be files
	Source string `json:"source"`

	// The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
	Type string `json:"type"`

	// List of base64-encoded file hashes
	FileHashes []string `json:"file_hashes"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorFiles represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.

type PassportElementErrorFrontSide ¶

type PassportElementErrorFrontSide struct {
	// Error source, must be front_side
	Source string `json:"source"`

	// The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
	Type string `json:"type"`

	// Base64-encoded hash of the file with the front side of the document
	FileHash string `json:"file_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorFrontSide represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.

type PassportElementErrorReverseSide ¶

type PassportElementErrorReverseSide struct {
	// Error source, must be reverse_side
	Source string `json:"source"`

	// The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
	Type string `json:"type"`

	// Base64-encoded hash of the file with the reverse side of the document
	FileHash string `json:"file_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorReverseSide represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.

type PassportElementErrorSelfie ¶

type PassportElementErrorSelfie struct {
	// Error source, must be selfie
	Source string `json:"source"`

	// The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
	Type string `json:"type"`

	// Base64-encoded hash of the file with the selfie
	FileHash string `json:"file_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorSelfie represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.

type PassportElementErrorTranslationFile ¶

type PassportElementErrorTranslationFile struct {
	// Error source, must be translation_file
	Source string `json:"source"`

	// Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
	Type string `json:"type"`

	// Base64-encoded file hash
	FileHash string `json:"file_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorTranslationFile represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.

type PassportElementErrorTranslationFiles ¶

type PassportElementErrorTranslationFiles struct {
	// Error source, must be translation_files
	Source string `json:"source"`

	// Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
	Type string `json:"type"`

	// List of base64-encoded file hashes
	FileHashes []string `json:"file_hashes"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorTranslationFiles represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.

type PassportElementErrorUnspecified ¶

type PassportElementErrorUnspecified struct {
	// Error source, must be unspecified
	Source string `json:"source"`

	// Type of element of the user's Telegram Passport which has the issue
	Type string `json:"type"`

	// Base64-encoded element hash
	ElementHash string `json:"element_hash"`

	// Error message
	Message string `json:"message"`
}

PassportElementErrorUnspecified represents an issue in an unspecified place. The error is considered resolved when new data is added.

type PassportFile ¶

type PassportFile struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID string `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// File size in bytes
	FileSize int `json:"file_size"`

	// Unix time when the file was uploaded
	FileDate int `json:"file_date"`
}

PassportFile this object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.

type PeerID ¶

type PeerID interface {
	PeerID() string
}

type PhotoSize ¶

type PhotoSize struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Photo width
	Width int `json:"width"`

	// Photo height
	Height int `json:"height"`

	// Optional. File size in bytes
	FileSize int `json:"file_size,omitempty"`
}

PhotoSize this object represents one size of a photo or a file / sticker thumbnail.

type PinChatMessageCall ¶

type PinChatMessageCall struct {
	CallNoResult
}

PinChatMessageCall reprenesents a call to the pinChatMessage method. Use this method to add a message to the list of pinned messages in a chat If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel

func NewPinChatMessageCall ¶

func NewPinChatMessageCall(chatID PeerID, messageID int) *PinChatMessageCall

NewPinChatMessageCall constructs a new PinChatMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Identifier of a message to pin

func (*PinChatMessageCall) ChatID ¶ added in v0.0.5

func (call *PinChatMessageCall) ChatID(chatID PeerID) *PinChatMessageCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*PinChatMessageCall) DisableNotification ¶

func (call *PinChatMessageCall) DisableNotification(disableNotification bool) *PinChatMessageCall

DisableNotification Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.

func (*PinChatMessageCall) MessageID ¶ added in v0.0.5

func (call *PinChatMessageCall) MessageID(messageID int) *PinChatMessageCall

MessageID Identifier of a message to pin

type Poll ¶

type Poll struct {
	// Unique poll identifier
	ID string `json:"id"`

	// Poll question, 1-300 characters
	Question string `json:"question"`

	// List of poll options
	Options []PollOption `json:"options"`

	// Total number of users that voted in the poll
	TotalVoterCount int `json:"total_voter_count"`

	// True, if the poll is closed
	IsClosed bool `json:"is_closed"`

	// True, if the poll is anonymous
	IsAnonymous bool `json:"is_anonymous"`

	// Poll type, currently can be “regular” or “quiz”
	Type string `json:"type"`

	// True, if the poll allows multiple answers
	AllowsMultipleAnswers bool `json:"allows_multiple_answers"`

	// Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.
	CorrectOptionID int `json:"correct_option_id,omitempty"`

	// Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
	Explanation string `json:"explanation,omitempty"`

	// Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
	ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`

	// Optional. Amount of time in seconds the poll will be active after creation
	OpenPeriod int `json:"open_period,omitempty"`

	// Optional. Point in time (Unix timestamp) when the poll will be automatically closed
	CloseDate int `json:"close_date,omitempty"`
}

Poll this object contains information about a poll.

type PollAnswer ¶

type PollAnswer struct {
	// Unique poll identifier
	PollID string `json:"poll_id"`

	// The user, who changed the answer to the poll
	User User `json:"user"`

	// 0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
	OptionaIDs []int `json:"option_ids"`
}

PollAnswer this object represents an answer of a user in a non-anonymous poll.

type PollOption ¶

type PollOption struct {
	// Option text, 1-100 characters
	Text string `json:"text"`

	// Number of users that voted for this option
	VoterCount int `json:"voter_count"`
}

PollOption this object contains information about one answer option in a poll.

type PreCheckoutQuery ¶

type PreCheckoutQuery struct {
	// Unique query identifier
	ID string `json:"id"`

	// User who sent the query
	From User `json:"from"`

	// Three-letter ISO 4217 currency code
	Currency string `json:"currency"`

	// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
	TotalAmount int `json:"total_amount"`

	// Bot specified invoice payload
	InvoicePayload string `json:"invoice_payload"`

	// Optional. Identifier of the shipping option chosen by the user
	ShippingOptionID string `json:"shipping_option_id,omitempty"`

	// Optional. Order information provided by the user
	OrderInfo *OrderInfo `json:"order_info,omitempty"`
}

PreCheckoutQuery this object contains information about an incoming pre-checkout query.

type PromoteChatMemberCall ¶

type PromoteChatMemberCall struct {
	CallNoResult
}

PromoteChatMemberCall reprenesents a call to the promoteChatMember method. Use this method to promote or demote a user in a supergroup or a channel The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Pass False for all boolean parameters to demote a user

func NewPromoteChatMemberCall ¶

func NewPromoteChatMemberCall(chatID PeerID, userID UserID) *PromoteChatMemberCall

NewPromoteChatMemberCall constructs a new PromoteChatMemberCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) userID - Unique identifier of the target user

func (*PromoteChatMemberCall) CanChangeInfo ¶

func (call *PromoteChatMemberCall) CanChangeInfo(canChangeInfo bool) *PromoteChatMemberCall

CanChangeInfo Pass True, if the administrator can change chat title, photo and other settings

func (*PromoteChatMemberCall) CanDeleteMessages ¶

func (call *PromoteChatMemberCall) CanDeleteMessages(canDeleteMessages bool) *PromoteChatMemberCall

CanDeleteMessages Pass True, if the administrator can delete messages of other users

func (*PromoteChatMemberCall) CanEditMessages ¶

func (call *PromoteChatMemberCall) CanEditMessages(canEditMessages bool) *PromoteChatMemberCall

CanEditMessages Pass True, if the administrator can edit messages of other users and can pin messages, channels only

func (*PromoteChatMemberCall) CanInviteUsers ¶

func (call *PromoteChatMemberCall) CanInviteUsers(canInviteUsers bool) *PromoteChatMemberCall

CanInviteUsers Pass True, if the administrator can invite new users to the chat

func (*PromoteChatMemberCall) CanManageChat ¶

func (call *PromoteChatMemberCall) CanManageChat(canManageChat bool) *PromoteChatMemberCall

CanManageChat Pass True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

func (*PromoteChatMemberCall) CanManageVideoChats ¶

func (call *PromoteChatMemberCall) CanManageVideoChats(canManageVideoChats bool) *PromoteChatMemberCall

CanManageVideoChats Pass True, if the administrator can manage video chats

func (*PromoteChatMemberCall) CanPinMessages ¶

func (call *PromoteChatMemberCall) CanPinMessages(canPinMessages bool) *PromoteChatMemberCall

CanPinMessages Pass True, if the administrator can pin messages, supergroups only

func (*PromoteChatMemberCall) CanPostMessages ¶

func (call *PromoteChatMemberCall) CanPostMessages(canPostMessages bool) *PromoteChatMemberCall

CanPostMessages Pass True, if the administrator can create channel posts, channels only

func (*PromoteChatMemberCall) CanPromoteMembers ¶

func (call *PromoteChatMemberCall) CanPromoteMembers(canPromoteMembers bool) *PromoteChatMemberCall

CanPromoteMembers Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)

func (*PromoteChatMemberCall) CanRestrictMembers ¶

func (call *PromoteChatMemberCall) CanRestrictMembers(canRestrictMembers bool) *PromoteChatMemberCall

CanRestrictMembers Pass True, if the administrator can restrict, ban or unban chat members

func (*PromoteChatMemberCall) ChatID ¶ added in v0.0.5

func (call *PromoteChatMemberCall) ChatID(chatID PeerID) *PromoteChatMemberCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*PromoteChatMemberCall) IsAnonymous ¶

func (call *PromoteChatMemberCall) IsAnonymous(isAnonymous bool) *PromoteChatMemberCall

IsAnonymous Pass True, if the administrator's presence in the chat is hidden

func (*PromoteChatMemberCall) UserID ¶ added in v0.0.5

func (call *PromoteChatMemberCall) UserID(userID UserID) *PromoteChatMemberCall

UserID Unique identifier of the target user

type ProximityAlertTriggered ¶

type ProximityAlertTriggered struct {
	// User that triggered the alert
	Traveler User `json:"traveler"`

	// User that set the alert
	Watcher User `json:"watcher"`

	// The distance between the users
	Distance int `json:"distance"`
}

ProximityAlertTriggered this object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

type ReplyKeyboardMarkup ¶

type ReplyKeyboardMarkup struct {
	// Array of button rows, each represented by an Array of KeyboardButton objects
	Keyboard [][]KeyboardButton `json:"keyboard"`

	// Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.
	ResizeKeyboard bool `json:"resize_keyboard,omitempty"`

	// Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
	OneTimeKeyboard bool `json:"one_time_keyboard,omitempty"`

	// Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
	InputFieldPlaceholder string `json:"input_field_placeholder,omitempty"`

	// Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.
	Selective bool `json:"selective,omitempty"`
}

ReplyKeyboardMarkup this object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

func NewReplyKeyboardMarkup ¶ added in v0.0.2

func NewReplyKeyboardMarkup(rows ...[]KeyboardButton) *ReplyKeyboardMarkup

NewReplyKeyboardMarkup creates a new ReplyKeyboardMarkup.

func (*ReplyKeyboardMarkup) WithInputFieldPlaceholder ¶ added in v0.0.2

func (markup *ReplyKeyboardMarkup) WithInputFieldPlaceholder(placeholder string) *ReplyKeyboardMarkup

WithInputFieldPlaceholder sets the placeholder to be shown in the input field when the keyboard is active; 1-64 characters

func (*ReplyKeyboardMarkup) WithOneTimeKeyboardMarkup ¶ added in v0.0.2

func (markup *ReplyKeyboardMarkup) WithOneTimeKeyboardMarkup() *ReplyKeyboardMarkup

WithOneTimeKeyboard requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.

func (*ReplyKeyboardMarkup) WithResizeKeyboardMarkup ¶ added in v0.0.2

func (markup *ReplyKeyboardMarkup) WithResizeKeyboardMarkup() *ReplyKeyboardMarkup

WithResizeKeyboard requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.

func (*ReplyKeyboardMarkup) WithSelective ¶ added in v0.0.2

func (markup *ReplyKeyboardMarkup) WithSelective() *ReplyKeyboardMarkup

Use this parameter if you want to show the keyboard to specific users only.

type ReplyKeyboardRemove ¶

type ReplyKeyboardRemove struct {
	// Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)
	RemoveKeyboard bool `json:"remove_keyboard"`

	// Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.
	Selective bool `json:"selective,omitempty"`
}

ReplyKeyboardRemove upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).

func NewReplyKeyboardRemove ¶ added in v0.0.2

func NewReplyKeyboardRemove() *ReplyKeyboardRemove

NewReplyKeyboardRemove creates a new ReplyKeyboardRemove.

func (*ReplyKeyboardRemove) WithSelective ¶ added in v0.0.2

func (markup *ReplyKeyboardRemove) WithSelective() *ReplyKeyboardRemove

WithSelective set it if you want to remove the keyboard for specific users only.

type ReplyMarkup ¶

type ReplyMarkup interface {
	// contains filtered or unexported methods
}

ReplyMarkup represents a custom keyboard.

type Request ¶

type Request struct {
	Method string
	// contains filtered or unexported fields
}

Request is Telegram Bot API request structure.

func NewRequest ¶

func NewRequest(method string) *Request

func (*Request) Bool ¶

func (r *Request) Bool(name string, value bool) *Request

func (*Request) ChatID ¶

func (r *Request) ChatID(name string, v ChatID) *Request

func (*Request) Encode ¶

func (r *Request) Encode(encoder Encoder) error

Encode request using encoder.

func (*Request) File ¶

func (r *Request) File(name string, arg FileArg) *Request

func (*Request) Float64 ¶

func (r *Request) Float64(name string, value float64) *Request

func (*Request) InputFile ¶

func (r *Request) InputFile(name string, file InputFile) *Request

func (*Request) InputMedia ¶ added in v0.0.5

func (r *Request) InputMedia(im InputMedia) *Request

func (*Request) InputMediaSlice ¶ added in v0.0.5

func (r *Request) InputMediaSlice(name string, im []InputMedia) *Request

func (*Request) Int ¶

func (r *Request) Int(name string, value int) *Request

func (*Request) Int64 ¶

func (r *Request) Int64(name string, value int64) *Request

func (*Request) JSON ¶

func (r *Request) JSON(name string, v any) *Request

func (*Request) PeerID ¶

func (r *Request) PeerID(name string, v PeerID) *Request

func (*Request) String ¶

func (r *Request) String(name, value string) *Request

func (*Request) Stringer ¶ added in v0.0.4

func (r *Request) Stringer(name string, v fmt.Stringer) *Request

func (*Request) UserID ¶ added in v0.0.3

func (r *Request) UserID(name string, v UserID) *Request

type Response ¶

type Response struct {
	// If equals true, the request was successful
	// and the result of the query can be found in the 'result' field
	Ok bool `json:"ok"`

	// A human-readable description of the result.
	// Empty if Ok is true.
	// Containes error message if Ok is false.
	Description string `json:"description"`

	// Optional. The result of the request
	Result json.RawMessage `json:"result"`

	// Optional. ErrorCode is the error code returned by Telegram Bot API.
	ErrorCode int `json:"error_code"`

	// Optional.
	Parameters *ResponseParameters `json:"parameters"`

	// HTTP response status code.
	StatusCode int `json:"-"`
}

Response is Telegram Bot API response structure.

type ResponseParameters ¶

type ResponseParameters struct {
	// Optional. The group has been migrated to a supergroup with the specified identifier.
	MigrateToChatID int64 `json:"migrate_to_chat_id,omitempty"`

	// Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
	RetryAfter int `json:"retry_after,omitempty"`
}

ResponseParameters describes why a request was unsuccessful.

type RestrictChatMemberCall ¶

type RestrictChatMemberCall struct {
	CallNoResult
}

RestrictChatMemberCall reprenesents a call to the restrictChatMember method. Use this method to restrict a user in a supergroup The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights Pass True for all permissions to lift restrictions from a user

func NewRestrictChatMemberCall ¶

func NewRestrictChatMemberCall(chatID PeerID, userID UserID, permissions ChatPermissions) *RestrictChatMemberCall

NewRestrictChatMemberCall constructs a new RestrictChatMemberCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) userID - Unique identifier of the target user permissions - A JSON-serialized object for new user permissions

func (*RestrictChatMemberCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

func (*RestrictChatMemberCall) Permissions ¶

func (call *RestrictChatMemberCall) Permissions(permissions ChatPermissions) *RestrictChatMemberCall

Permissions A JSON-serialized object for new user permissions

func (*RestrictChatMemberCall) UntilDate ¶

func (call *RestrictChatMemberCall) UntilDate(untilDate int) *RestrictChatMemberCall

UntilDate Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever

func (*RestrictChatMemberCall) UserID ¶ added in v0.0.5

UserID Unique identifier of the target user

type RevokeChatInviteLinkCall ¶

type RevokeChatInviteLinkCall struct {
	Call[ChatInviteLink]
}

RevokeChatInviteLinkCall reprenesents a call to the revokeChatInviteLink method. Use this method to revoke an invite link created by the bot If the primary link is revoked, a new link is automatically generated The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Returns the revoked invite link as ChatInviteLink object.

func NewRevokeChatInviteLinkCall ¶

func NewRevokeChatInviteLinkCall(chatID PeerID, inviteLink string) *RevokeChatInviteLinkCall

NewRevokeChatInviteLinkCall constructs a new RevokeChatInviteLinkCall with required parameters. chatID - Unique identifier of the target chat or username of the target channel (in the format @channelusername) inviteLink - The invite link to revoke

func (*RevokeChatInviteLinkCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier of the target chat or username of the target channel (in the format @channelusername)

func (call *RevokeChatInviteLinkCall) InviteLink(inviteLink string) *RevokeChatInviteLinkCall

InviteLink The invite link to revoke

type SendAnimationCall ¶

type SendAnimationCall struct {
	Call[Message]
}

SendAnimationCall reprenesents a call to the sendAnimation method. Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound) On success, the sent Message is returned Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

func NewSendAnimationCall ¶

func NewSendAnimationCall(chatID PeerID, animation FileArg) *SendAnimationCall

NewSendAnimationCall constructs a new SendAnimationCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) animation - Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »

func (*SendAnimationCall) AllowSendingWithoutReply ¶

func (call *SendAnimationCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendAnimationCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendAnimationCall) Animation ¶

func (call *SendAnimationCall) Animation(animation FileArg) *SendAnimationCall

Animation Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More information on Sending Files »

func (*SendAnimationCall) Caption ¶

func (call *SendAnimationCall) Caption(caption string) *SendAnimationCall

Caption Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing

func (*SendAnimationCall) CaptionEntities ¶

func (call *SendAnimationCall) CaptionEntities(captionEntities []MessageEntity) *SendAnimationCall

CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

func (*SendAnimationCall) ChatID ¶ added in v0.0.5

func (call *SendAnimationCall) ChatID(chatID PeerID) *SendAnimationCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendAnimationCall) DisableNotification ¶

func (call *SendAnimationCall) DisableNotification(disableNotification bool) *SendAnimationCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendAnimationCall) Duration ¶

func (call *SendAnimationCall) Duration(duration int) *SendAnimationCall

Duration Duration of sent animation in seconds

func (*SendAnimationCall) Height ¶

func (call *SendAnimationCall) Height(height int) *SendAnimationCall

Height Animation height

func (*SendAnimationCall) ParseMode ¶

func (call *SendAnimationCall) ParseMode(parseMode ParseMode) *SendAnimationCall

ParseMode Mode for parsing entities in the animation caption. See formatting options for more details.

func (*SendAnimationCall) ProtectContent ¶

func (call *SendAnimationCall) ProtectContent(protectContent bool) *SendAnimationCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendAnimationCall) ReplyMarkup ¶

func (call *SendAnimationCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendAnimationCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendAnimationCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendAnimationCall) ReplyToMessageID(replyToMessageID int) *SendAnimationCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendAnimationCall) Thumb ¶

func (call *SendAnimationCall) Thumb(thumb FileArg) *SendAnimationCall

Thumb Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

func (*SendAnimationCall) Width ¶

func (call *SendAnimationCall) Width(width int) *SendAnimationCall

Width Animation width

type SendAudioCall ¶

type SendAudioCall struct {
	Call[Message]
}

SendAudioCall reprenesents a call to the sendAudio method. Use this method to send audio files, if you want Telegram clients to display them in the music player Your audio must be in the .MP3 or .M4A format On success, the sent Message is returned Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. For sending voice messages, use the sendVoice method instead.

func NewSendAudioCall ¶

func NewSendAudioCall(chatID PeerID, audio FileArg) *SendAudioCall

NewSendAudioCall constructs a new SendAudioCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) audio - Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*SendAudioCall) AllowSendingWithoutReply ¶

func (call *SendAudioCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendAudioCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendAudioCall) Audio ¶

func (call *SendAudioCall) Audio(audio FileArg) *SendAudioCall

Audio Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*SendAudioCall) Caption ¶

func (call *SendAudioCall) Caption(caption string) *SendAudioCall

Caption Audio caption, 0-1024 characters after entities parsing

func (*SendAudioCall) CaptionEntities ¶

func (call *SendAudioCall) CaptionEntities(captionEntities []MessageEntity) *SendAudioCall

CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

func (*SendAudioCall) ChatID ¶ added in v0.0.5

func (call *SendAudioCall) ChatID(chatID PeerID) *SendAudioCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendAudioCall) DisableNotification ¶

func (call *SendAudioCall) DisableNotification(disableNotification bool) *SendAudioCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendAudioCall) Duration ¶

func (call *SendAudioCall) Duration(duration int) *SendAudioCall

Duration Duration of the audio in seconds

func (*SendAudioCall) ParseMode ¶

func (call *SendAudioCall) ParseMode(parseMode ParseMode) *SendAudioCall

ParseMode Mode for parsing entities in the audio caption. See formatting options for more details.

func (*SendAudioCall) Performer ¶

func (call *SendAudioCall) Performer(performer string) *SendAudioCall

Performer Performer

func (*SendAudioCall) ProtectContent ¶

func (call *SendAudioCall) ProtectContent(protectContent bool) *SendAudioCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendAudioCall) ReplyMarkup ¶

func (call *SendAudioCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendAudioCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendAudioCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendAudioCall) ReplyToMessageID(replyToMessageID int) *SendAudioCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendAudioCall) Thumb ¶

func (call *SendAudioCall) Thumb(thumb FileArg) *SendAudioCall

Thumb Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

func (*SendAudioCall) Title ¶

func (call *SendAudioCall) Title(title string) *SendAudioCall

Title Track name

type SendChatActionCall ¶

type SendChatActionCall struct {
	CallNoResult
}

SendChatActionCall reprenesents a call to the sendChatAction method. Use this method when you need to tell the user that something is happening on the bot's side The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status) Example: The ImageBot needs some time to process a request and upload the image Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo The user will see a “sending photo” status for the bot. We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

func NewSendChatActionCall ¶

func NewSendChatActionCall(chatID PeerID, action ChatAction) *SendChatActionCall

NewSendChatActionCall constructs a new SendChatActionCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) action - Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.

func (*SendChatActionCall) Action ¶

func (call *SendChatActionCall) Action(action ChatAction) *SendChatActionCall

Action Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.

func (*SendChatActionCall) ChatID ¶ added in v0.0.5

func (call *SendChatActionCall) ChatID(chatID PeerID) *SendChatActionCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

type SendContactCall ¶

type SendContactCall struct {
	Call[Message]
}

SendContactCall reprenesents a call to the sendContact method. Use this method to send phone contacts On success, the sent Message is returned.

func NewSendContactCall ¶

func NewSendContactCall(chatID PeerID, phoneNumber string, firstName string) *SendContactCall

NewSendContactCall constructs a new SendContactCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) phoneNumber - Contact's phone number firstName - Contact's first name

func (*SendContactCall) AllowSendingWithoutReply ¶

func (call *SendContactCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendContactCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendContactCall) ChatID ¶ added in v0.0.5

func (call *SendContactCall) ChatID(chatID PeerID) *SendContactCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendContactCall) DisableNotification ¶

func (call *SendContactCall) DisableNotification(disableNotification bool) *SendContactCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendContactCall) FirstName ¶

func (call *SendContactCall) FirstName(firstName string) *SendContactCall

FirstName Contact's first name

func (*SendContactCall) LastName ¶

func (call *SendContactCall) LastName(lastName string) *SendContactCall

LastName Contact's last name

func (*SendContactCall) PhoneNumber ¶

func (call *SendContactCall) PhoneNumber(phoneNumber string) *SendContactCall

PhoneNumber Contact's phone number

func (*SendContactCall) ProtectContent ¶

func (call *SendContactCall) ProtectContent(protectContent bool) *SendContactCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendContactCall) ReplyMarkup ¶

func (call *SendContactCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendContactCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user.

func (*SendContactCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendContactCall) ReplyToMessageID(replyToMessageID int) *SendContactCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendContactCall) Vcard ¶

func (call *SendContactCall) Vcard(vcard string) *SendContactCall

Vcard Additional data about the contact in the form of a vCard, 0-2048 bytes

type SendDiceCall ¶

type SendDiceCall struct {
	Call[Message]
}

SendDiceCall reprenesents a call to the sendDice method. Use this method to send an animated emoji that will display a random value On success, the sent Message is returned.

func NewSendDiceCall ¶

func NewSendDiceCall(chatID PeerID) *SendDiceCall

NewSendDiceCall constructs a new SendDiceCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendDiceCall) AllowSendingWithoutReply ¶

func (call *SendDiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendDiceCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendDiceCall) ChatID ¶ added in v0.0.5

func (call *SendDiceCall) ChatID(chatID PeerID) *SendDiceCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendDiceCall) DisableNotification ¶

func (call *SendDiceCall) DisableNotification(disableNotification bool) *SendDiceCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendDiceCall) Emoji ¶

func (call *SendDiceCall) Emoji(emoji string) *SendDiceCall

Emoji Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, “”, “”, “”, or “”. Dice can have values 1-6 for “”, “” and “”, values 1-5 for “” and “”, and values 1-64 for “”. Defaults to “”

func (*SendDiceCall) ProtectContent ¶

func (call *SendDiceCall) ProtectContent(protectContent bool) *SendDiceCall

ProtectContent Protects the contents of the sent message from forwarding

func (*SendDiceCall) ReplyMarkup ¶

func (call *SendDiceCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendDiceCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendDiceCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendDiceCall) ReplyToMessageID(replyToMessageID int) *SendDiceCall

ReplyToMessageID If the message is a reply, ID of the original message

type SendDocumentCall ¶

type SendDocumentCall struct {
	Call[Message]
}

SendDocumentCall reprenesents a call to the sendDocument method. Use this method to send general files On success, the sent Message is returned Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

func NewSendDocumentCall ¶

func NewSendDocumentCall(chatID PeerID, document FileArg) *SendDocumentCall

NewSendDocumentCall constructs a new SendDocumentCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) document - File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*SendDocumentCall) AllowSendingWithoutReply ¶

func (call *SendDocumentCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendDocumentCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendDocumentCall) Caption ¶

func (call *SendDocumentCall) Caption(caption string) *SendDocumentCall

Caption Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing

func (*SendDocumentCall) CaptionEntities ¶

func (call *SendDocumentCall) CaptionEntities(captionEntities []MessageEntity) *SendDocumentCall

CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

func (*SendDocumentCall) ChatID ¶ added in v0.0.5

func (call *SendDocumentCall) ChatID(chatID PeerID) *SendDocumentCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendDocumentCall) DisableContentTypeDetection ¶

func (call *SendDocumentCall) DisableContentTypeDetection(disableContentTypeDetection bool) *SendDocumentCall

DisableContentTypeDetection Disables automatic server-side content type detection for files uploaded using multipart/form-data

func (*SendDocumentCall) DisableNotification ¶

func (call *SendDocumentCall) DisableNotification(disableNotification bool) *SendDocumentCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendDocumentCall) Document ¶

func (call *SendDocumentCall) Document(document FileArg) *SendDocumentCall

Document File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*SendDocumentCall) ParseMode ¶

func (call *SendDocumentCall) ParseMode(parseMode ParseMode) *SendDocumentCall

ParseMode Mode for parsing entities in the document caption. See formatting options for more details.

func (*SendDocumentCall) ProtectContent ¶

func (call *SendDocumentCall) ProtectContent(protectContent bool) *SendDocumentCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendDocumentCall) ReplyMarkup ¶

func (call *SendDocumentCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendDocumentCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendDocumentCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendDocumentCall) ReplyToMessageID(replyToMessageID int) *SendDocumentCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendDocumentCall) Thumb ¶

func (call *SendDocumentCall) Thumb(thumb FileArg) *SendDocumentCall

Thumb Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

type SendGameCall ¶

type SendGameCall struct {
	Call[Message]
}

SendGameCall reprenesents a call to the sendGame method. Use this method to send a game On success, the sent Message is returned.

func NewSendGameCall ¶

func NewSendGameCall(chatID ChatID, gameShortName string) *SendGameCall

NewSendGameCall constructs a new SendGameCall with required parameters. chatID - Unique identifier for the target chat gameShortName - Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.

func (*SendGameCall) AllowSendingWithoutReply ¶

func (call *SendGameCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendGameCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendGameCall) ChatID ¶ added in v0.0.5

func (call *SendGameCall) ChatID(chatID ChatID) *SendGameCall

ChatID Unique identifier for the target chat

func (*SendGameCall) DisableNotification ¶

func (call *SendGameCall) DisableNotification(disableNotification bool) *SendGameCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendGameCall) GameShortName ¶

func (call *SendGameCall) GameShortName(gameShortName string) *SendGameCall

GameShortName Short name of the game, serves as the unique identifier for the game. Set up your games via @BotFather.

func (*SendGameCall) ProtectContent ¶

func (call *SendGameCall) ProtectContent(protectContent bool) *SendGameCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendGameCall) ReplyMarkup ¶

func (call *SendGameCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *SendGameCall

ReplyMarkup A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.

func (*SendGameCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendGameCall) ReplyToMessageID(replyToMessageID int) *SendGameCall

ReplyToMessageID If the message is a reply, ID of the original message

type SendInvoiceCall ¶

type SendInvoiceCall struct {
	Call[Message]
}

SendInvoiceCall reprenesents a call to the sendInvoice method. Use this method to send invoices On success, the sent Message is returned.

func NewSendInvoiceCall ¶

func NewSendInvoiceCall(chatID PeerID, title string, description string, payload string, providerToken string, currency string, prices []LabeledPrice) *SendInvoiceCall

NewSendInvoiceCall constructs a new SendInvoiceCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) title - Product name, 1-32 characters description - Product description, 1-255 characters payload - Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. providerToken - Payment provider token, obtained via @BotFather currency - Three-letter ISO 4217 currency code, see more on currencies prices - Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

func (*SendInvoiceCall) AllowSendingWithoutReply ¶

func (call *SendInvoiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendInvoiceCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendInvoiceCall) ChatID ¶ added in v0.0.5

func (call *SendInvoiceCall) ChatID(chatID PeerID) *SendInvoiceCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendInvoiceCall) Currency ¶

func (call *SendInvoiceCall) Currency(currency string) *SendInvoiceCall

Currency Three-letter ISO 4217 currency code, see more on currencies

func (*SendInvoiceCall) Description ¶

func (call *SendInvoiceCall) Description(description string) *SendInvoiceCall

Description Product description, 1-255 characters

func (*SendInvoiceCall) DisableNotification ¶

func (call *SendInvoiceCall) DisableNotification(disableNotification bool) *SendInvoiceCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendInvoiceCall) IsFlexible ¶

func (call *SendInvoiceCall) IsFlexible(isFlexible bool) *SendInvoiceCall

IsFlexible Pass True, if the final price depends on the shipping method

func (*SendInvoiceCall) MaxTipAmount ¶

func (call *SendInvoiceCall) MaxTipAmount(maxTipAmount int) *SendInvoiceCall

MaxTipAmount The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

func (*SendInvoiceCall) NeedEmail ¶

func (call *SendInvoiceCall) NeedEmail(needEmail bool) *SendInvoiceCall

NeedEmail Pass True, if you require the user's email address to complete the order

func (*SendInvoiceCall) NeedName ¶

func (call *SendInvoiceCall) NeedName(needName bool) *SendInvoiceCall

NeedName Pass True, if you require the user's full name to complete the order

func (*SendInvoiceCall) NeedPhoneNumber ¶

func (call *SendInvoiceCall) NeedPhoneNumber(needPhoneNumber bool) *SendInvoiceCall

NeedPhoneNumber Pass True, if you require the user's phone number to complete the order

func (*SendInvoiceCall) NeedShippingAddress ¶

func (call *SendInvoiceCall) NeedShippingAddress(needShippingAddress bool) *SendInvoiceCall

NeedShippingAddress Pass True, if you require the user's shipping address to complete the order

func (*SendInvoiceCall) Payload ¶

func (call *SendInvoiceCall) Payload(payload string) *SendInvoiceCall

Payload Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

func (*SendInvoiceCall) PhotoHeight ¶

func (call *SendInvoiceCall) PhotoHeight(photoHeight int) *SendInvoiceCall

PhotoHeight Photo height

func (*SendInvoiceCall) PhotoSize ¶

func (call *SendInvoiceCall) PhotoSize(photoSize int) *SendInvoiceCall

PhotoSize Photo size in bytes

func (*SendInvoiceCall) PhotoURL ¶ added in v0.0.5

func (call *SendInvoiceCall) PhotoURL(photoURL string) *SendInvoiceCall

PhotoURL URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

func (*SendInvoiceCall) PhotoWidth ¶

func (call *SendInvoiceCall) PhotoWidth(photoWidth int) *SendInvoiceCall

PhotoWidth Photo width

func (*SendInvoiceCall) Prices ¶

func (call *SendInvoiceCall) Prices(prices []LabeledPrice) *SendInvoiceCall

Prices Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

func (*SendInvoiceCall) ProtectContent ¶

func (call *SendInvoiceCall) ProtectContent(protectContent bool) *SendInvoiceCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendInvoiceCall) ProviderData ¶

func (call *SendInvoiceCall) ProviderData(providerData string) *SendInvoiceCall

ProviderData JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

func (*SendInvoiceCall) ProviderToken ¶

func (call *SendInvoiceCall) ProviderToken(providerToken string) *SendInvoiceCall

ProviderToken Payment provider token, obtained via @BotFather

func (*SendInvoiceCall) ReplyMarkup ¶

func (call *SendInvoiceCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *SendInvoiceCall

ReplyMarkup A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

func (*SendInvoiceCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendInvoiceCall) ReplyToMessageID(replyToMessageID int) *SendInvoiceCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendInvoiceCall) SendEmailToProvider ¶

func (call *SendInvoiceCall) SendEmailToProvider(sendEmailToProvider bool) *SendInvoiceCall

SendEmailToProvider Pass True, if the user's email address should be sent to provider

func (*SendInvoiceCall) SendPhoneNumberToProvider ¶

func (call *SendInvoiceCall) SendPhoneNumberToProvider(sendPhoneNumberToProvider bool) *SendInvoiceCall

SendPhoneNumberToProvider Pass True, if the user's phone number should be sent to provider

func (*SendInvoiceCall) StartParameter ¶

func (call *SendInvoiceCall) StartParameter(startParameter string) *SendInvoiceCall

StartParameter Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter

func (*SendInvoiceCall) SuggestedTipAmounts ¶

func (call *SendInvoiceCall) SuggestedTipAmounts(suggestedTipAmounts []int) *SendInvoiceCall

SuggestedTipAmounts A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

func (*SendInvoiceCall) Title ¶

func (call *SendInvoiceCall) Title(title string) *SendInvoiceCall

Title Product name, 1-32 characters

type SendLocationCall ¶

type SendLocationCall struct {
	Call[Message]
}

SendLocationCall reprenesents a call to the sendLocation method. Use this method to send point on the map On success, the sent Message is returned.

func NewSendLocationCall ¶

func NewSendLocationCall(chatID PeerID, latitude float64, longitude float64) *SendLocationCall

NewSendLocationCall constructs a new SendLocationCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) latitude - Latitude of the location longitude - Longitude of the location

func (*SendLocationCall) AllowSendingWithoutReply ¶

func (call *SendLocationCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendLocationCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendLocationCall) ChatID ¶ added in v0.0.5

func (call *SendLocationCall) ChatID(chatID PeerID) *SendLocationCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendLocationCall) DisableNotification ¶

func (call *SendLocationCall) DisableNotification(disableNotification bool) *SendLocationCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendLocationCall) Heading ¶

func (call *SendLocationCall) Heading(heading int) *SendLocationCall

Heading For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

func (*SendLocationCall) HorizontalAccuracy ¶

func (call *SendLocationCall) HorizontalAccuracy(horizontalAccuracy float64) *SendLocationCall

HorizontalAccuracy The radius of uncertainty for the location, measured in meters; 0-1500

func (*SendLocationCall) Latitude ¶

func (call *SendLocationCall) Latitude(latitude float64) *SendLocationCall

Latitude Latitude of the location

func (*SendLocationCall) LivePeriod ¶

func (call *SendLocationCall) LivePeriod(livePeriod int) *SendLocationCall

LivePeriod Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.

func (*SendLocationCall) Longitude ¶

func (call *SendLocationCall) Longitude(longitude float64) *SendLocationCall

Longitude Longitude of the location

func (*SendLocationCall) ProtectContent ¶

func (call *SendLocationCall) ProtectContent(protectContent bool) *SendLocationCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendLocationCall) ProximityAlertRadius ¶

func (call *SendLocationCall) ProximityAlertRadius(proximityAlertRadius int) *SendLocationCall

ProximityAlertRadius For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

func (*SendLocationCall) ReplyMarkup ¶

func (call *SendLocationCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendLocationCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendLocationCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendLocationCall) ReplyToMessageID(replyToMessageID int) *SendLocationCall

ReplyToMessageID If the message is a reply, ID of the original message

type SendMediaGroupCall ¶ added in v0.0.5

type SendMediaGroupCall struct {
	Call[[]Message]
}

SendMediaGroupCall reprenesents a call to the sendMediaGroup method. Use this method to send a group of photos, videos, documents or audios as an album Documents and audio files can be only grouped in an album with messages of the same type On success, an array of Messages that were sent is returned.

func NewSendMediaGroupCall ¶ added in v0.0.5

func NewSendMediaGroupCall(chatID PeerID, media []InputMedia) *SendMediaGroupCall

NewSendMediaGroupCall constructs a new SendMediaGroupCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) media - A JSON-serialized array describing messages to be sent, must include 2-10 items

func (*SendMediaGroupCall) AllowSendingWithoutReply ¶ added in v0.0.5

func (call *SendMediaGroupCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendMediaGroupCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendMediaGroupCall) ChatID ¶ added in v0.0.5

func (call *SendMediaGroupCall) ChatID(chatID PeerID) *SendMediaGroupCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendMediaGroupCall) DisableNotification ¶ added in v0.0.5

func (call *SendMediaGroupCall) DisableNotification(disableNotification bool) *SendMediaGroupCall

DisableNotification Sends messages silently. Users will receive a notification with no sound.

func (*SendMediaGroupCall) Media ¶ added in v0.0.5

func (call *SendMediaGroupCall) Media(media []InputMedia) *SendMediaGroupCall

Media A JSON-serialized array describing messages to be sent, must include 2-10 items

func (*SendMediaGroupCall) ProtectContent ¶ added in v0.0.5

func (call *SendMediaGroupCall) ProtectContent(protectContent bool) *SendMediaGroupCall

ProtectContent Protects the contents of the sent messages from forwarding and saving

func (*SendMediaGroupCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendMediaGroupCall) ReplyToMessageID(replyToMessageID int) *SendMediaGroupCall

ReplyToMessageID If the messages are a reply, ID of the original message

type SendMessageCall ¶

type SendMessageCall struct {
	Call[Message]
}

SendMessageCall reprenesents a call to the sendMessage method. Use this method to send text messages On success, the sent Message is returned.

func NewSendMessageCall ¶

func NewSendMessageCall(chatID PeerID, text string) *SendMessageCall

NewSendMessageCall constructs a new SendMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) text - Text of the message to be sent, 1-4096 characters after entities parsing

func (*SendMessageCall) AllowSendingWithoutReply ¶

func (call *SendMessageCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendMessageCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendMessageCall) ChatID ¶ added in v0.0.5

func (call *SendMessageCall) ChatID(chatID PeerID) *SendMessageCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendMessageCall) DisableNotification ¶

func (call *SendMessageCall) DisableNotification(disableNotification bool) *SendMessageCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendMessageCall) DisableWebPagePreview ¶

func (call *SendMessageCall) DisableWebPagePreview(disableWebPagePreview bool) *SendMessageCall

DisableWebPagePreview Disables link previews for links in this message

func (*SendMessageCall) Entities ¶

func (call *SendMessageCall) Entities(entities []MessageEntity) *SendMessageCall

Entities A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode

func (*SendMessageCall) ParseMode ¶

func (call *SendMessageCall) ParseMode(parseMode ParseMode) *SendMessageCall

ParseMode Mode for parsing entities in the message text. See formatting options for more details.

func (*SendMessageCall) ProtectContent ¶

func (call *SendMessageCall) ProtectContent(protectContent bool) *SendMessageCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendMessageCall) ReplyMarkup ¶

func (call *SendMessageCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendMessageCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendMessageCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendMessageCall) ReplyToMessageID(replyToMessageID int) *SendMessageCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendMessageCall) Text ¶

func (call *SendMessageCall) Text(text string) *SendMessageCall

Text Text of the message to be sent, 1-4096 characters after entities parsing

type SendPhotoCall ¶

type SendPhotoCall struct {
	Call[Message]
}

SendPhotoCall reprenesents a call to the sendPhoto method. Use this method to send photos On success, the sent Message is returned.

func NewSendPhotoCall ¶

func NewSendPhotoCall(chatID PeerID, photo FileArg) *SendPhotoCall

NewSendPhotoCall constructs a new SendPhotoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) photo - Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »

func (*SendPhotoCall) AllowSendingWithoutReply ¶

func (call *SendPhotoCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendPhotoCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendPhotoCall) Caption ¶

func (call *SendPhotoCall) Caption(caption string) *SendPhotoCall

Caption Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing

func (*SendPhotoCall) CaptionEntities ¶

func (call *SendPhotoCall) CaptionEntities(captionEntities []MessageEntity) *SendPhotoCall

CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

func (*SendPhotoCall) ChatID ¶ added in v0.0.5

func (call *SendPhotoCall) ChatID(chatID PeerID) *SendPhotoCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendPhotoCall) DisableNotification ¶

func (call *SendPhotoCall) DisableNotification(disableNotification bool) *SendPhotoCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendPhotoCall) ParseMode ¶

func (call *SendPhotoCall) ParseMode(parseMode ParseMode) *SendPhotoCall

ParseMode Mode for parsing entities in the photo caption. See formatting options for more details.

func (*SendPhotoCall) Photo ¶

func (call *SendPhotoCall) Photo(photo FileArg) *SendPhotoCall

Photo Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More information on Sending Files »

func (*SendPhotoCall) ProtectContent ¶

func (call *SendPhotoCall) ProtectContent(protectContent bool) *SendPhotoCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendPhotoCall) ReplyMarkup ¶

func (call *SendPhotoCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendPhotoCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendPhotoCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendPhotoCall) ReplyToMessageID(replyToMessageID int) *SendPhotoCall

ReplyToMessageID If the message is a reply, ID of the original message

type SendPollCall ¶

type SendPollCall struct {
	Call[Message]
}

SendPollCall reprenesents a call to the sendPoll method. Use this method to send a native poll On success, the sent Message is returned.

func NewSendPollCall ¶

func NewSendPollCall(chatID PeerID, question string, options []string) *SendPollCall

NewSendPollCall constructs a new SendPollCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) question - Poll question, 1-300 characters options - A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

func (*SendPollCall) AllowSendingWithoutReply ¶

func (call *SendPollCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendPollCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendPollCall) AllowsMultipleAnswers ¶

func (call *SendPollCall) AllowsMultipleAnswers(allowsMultipleAnswers bool) *SendPollCall

AllowsMultipleAnswers True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False

func (*SendPollCall) ChatID ¶ added in v0.0.5

func (call *SendPollCall) ChatID(chatID PeerID) *SendPollCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendPollCall) CloseDate ¶

func (call *SendPollCall) CloseDate(closeDate int) *SendPollCall

CloseDate Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.

func (*SendPollCall) CorrectOptionID ¶ added in v0.0.5

func (call *SendPollCall) CorrectOptionID(correctOptionID int) *SendPollCall

CorrectOptionID 0-based identifier of the correct answer option, required for polls in quiz mode

func (*SendPollCall) DisableNotification ¶

func (call *SendPollCall) DisableNotification(disableNotification bool) *SendPollCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendPollCall) Explanation ¶

func (call *SendPollCall) Explanation(explanation string) *SendPollCall

Explanation Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing

func (*SendPollCall) ExplanationEntities ¶

func (call *SendPollCall) ExplanationEntities(explanationEntities []MessageEntity) *SendPollCall

ExplanationEntities A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode

func (*SendPollCall) ExplanationParseMode ¶

func (call *SendPollCall) ExplanationParseMode(explanationParseMode string) *SendPollCall

ExplanationParseMode Mode for parsing entities in the explanation. See formatting options for more details.

func (*SendPollCall) IsAnonymous ¶

func (call *SendPollCall) IsAnonymous(isAnonymous bool) *SendPollCall

IsAnonymous True, if the poll needs to be anonymous, defaults to True

func (*SendPollCall) IsClosed ¶

func (call *SendPollCall) IsClosed(isClosed bool) *SendPollCall

IsClosed Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.

func (*SendPollCall) OpenPeriod ¶

func (call *SendPollCall) OpenPeriod(openPeriod int) *SendPollCall

OpenPeriod Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.

func (*SendPollCall) Options ¶

func (call *SendPollCall) Options(options []string) *SendPollCall

Options A JSON-serialized list of answer options, 2-10 strings 1-100 characters each

func (*SendPollCall) ProtectContent ¶

func (call *SendPollCall) ProtectContent(protectContent bool) *SendPollCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendPollCall) Question ¶

func (call *SendPollCall) Question(question string) *SendPollCall

Question Poll question, 1-300 characters

func (*SendPollCall) ReplyMarkup ¶

func (call *SendPollCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendPollCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendPollCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendPollCall) ReplyToMessageID(replyToMessageID int) *SendPollCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendPollCall) Type ¶

func (call *SendPollCall) Type(typ string) *SendPollCall

Type Poll type, “quiz” or “regular”, defaults to “regular”

type SendStickerCall ¶

type SendStickerCall struct {
	Call[Message]
}

SendStickerCall reprenesents a call to the sendSticker method. Use this method to send static .WEBP, animated .TGS, or video .WEBM stickers On success, the sent Message is returned.

func NewSendStickerCall ¶

func NewSendStickerCall(chatID PeerID, sticker FileArg) *SendStickerCall

NewSendStickerCall constructs a new SendStickerCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) sticker - Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*SendStickerCall) AllowSendingWithoutReply ¶

func (call *SendStickerCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendStickerCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendStickerCall) ChatID ¶ added in v0.0.5

func (call *SendStickerCall) ChatID(chatID PeerID) *SendStickerCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendStickerCall) DisableNotification ¶

func (call *SendStickerCall) DisableNotification(disableNotification bool) *SendStickerCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendStickerCall) ProtectContent ¶

func (call *SendStickerCall) ProtectContent(protectContent bool) *SendStickerCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendStickerCall) ReplyMarkup ¶

func (call *SendStickerCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendStickerCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendStickerCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendStickerCall) ReplyToMessageID(replyToMessageID int) *SendStickerCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendStickerCall) Sticker ¶

func (call *SendStickerCall) Sticker(sticker FileArg) *SendStickerCall

Sticker Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

type SendVenueCall ¶

type SendVenueCall struct {
	Call[Message]
}

SendVenueCall reprenesents a call to the sendVenue method. Use this method to send information about a venue On success, the sent Message is returned.

func NewSendVenueCall ¶

func NewSendVenueCall(chatID PeerID, latitude float64, longitude float64, title string, address string) *SendVenueCall

NewSendVenueCall constructs a new SendVenueCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) latitude - Latitude of the venue longitude - Longitude of the venue title - Name of the venue address - Address of the venue

func (*SendVenueCall) Address ¶

func (call *SendVenueCall) Address(address string) *SendVenueCall

Address Address of the venue

func (*SendVenueCall) AllowSendingWithoutReply ¶

func (call *SendVenueCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVenueCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendVenueCall) ChatID ¶ added in v0.0.5

func (call *SendVenueCall) ChatID(chatID PeerID) *SendVenueCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendVenueCall) DisableNotification ¶

func (call *SendVenueCall) DisableNotification(disableNotification bool) *SendVenueCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendVenueCall) FoursquareID ¶ added in v0.0.5

func (call *SendVenueCall) FoursquareID(foursquareID string) *SendVenueCall

FoursquareID Foursquare identifier of the venue

func (*SendVenueCall) FoursquareType ¶

func (call *SendVenueCall) FoursquareType(foursquareType string) *SendVenueCall

FoursquareType Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)

func (*SendVenueCall) GooglePlaceID ¶ added in v0.0.5

func (call *SendVenueCall) GooglePlaceID(googlePlaceID string) *SendVenueCall

GooglePlaceID Google Places identifier of the venue

func (*SendVenueCall) GooglePlaceType ¶

func (call *SendVenueCall) GooglePlaceType(googlePlaceType string) *SendVenueCall

GooglePlaceType Google Places type of the venue. (See supported types.)

func (*SendVenueCall) Latitude ¶

func (call *SendVenueCall) Latitude(latitude float64) *SendVenueCall

Latitude Latitude of the venue

func (*SendVenueCall) Longitude ¶

func (call *SendVenueCall) Longitude(longitude float64) *SendVenueCall

Longitude Longitude of the venue

func (*SendVenueCall) ProtectContent ¶

func (call *SendVenueCall) ProtectContent(protectContent bool) *SendVenueCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendVenueCall) ReplyMarkup ¶

func (call *SendVenueCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVenueCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendVenueCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendVenueCall) ReplyToMessageID(replyToMessageID int) *SendVenueCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendVenueCall) Title ¶

func (call *SendVenueCall) Title(title string) *SendVenueCall

Title Name of the venue

type SendVideoCall ¶

type SendVideoCall struct {
	Call[Message]
}

SendVideoCall reprenesents a call to the sendVideo method. Use this method to send video files, Telegram clients support MPEG4 videos (other formats may be sent as Document) On success, the sent Message is returned Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

func NewSendVideoCall ¶

func NewSendVideoCall(chatID PeerID, video FileArg) *SendVideoCall

NewSendVideoCall constructs a new SendVideoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) video - Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »

func (*SendVideoCall) AllowSendingWithoutReply ¶

func (call *SendVideoCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVideoCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendVideoCall) Caption ¶

func (call *SendVideoCall) Caption(caption string) *SendVideoCall

Caption Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing

func (*SendVideoCall) CaptionEntities ¶

func (call *SendVideoCall) CaptionEntities(captionEntities []MessageEntity) *SendVideoCall

CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

func (*SendVideoCall) ChatID ¶ added in v0.0.5

func (call *SendVideoCall) ChatID(chatID PeerID) *SendVideoCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendVideoCall) DisableNotification ¶

func (call *SendVideoCall) DisableNotification(disableNotification bool) *SendVideoCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendVideoCall) Duration ¶

func (call *SendVideoCall) Duration(duration int) *SendVideoCall

Duration Duration of sent video in seconds

func (*SendVideoCall) Height ¶

func (call *SendVideoCall) Height(height int) *SendVideoCall

Height Video height

func (*SendVideoCall) ParseMode ¶

func (call *SendVideoCall) ParseMode(parseMode ParseMode) *SendVideoCall

ParseMode Mode for parsing entities in the video caption. See formatting options for more details.

func (*SendVideoCall) ProtectContent ¶

func (call *SendVideoCall) ProtectContent(protectContent bool) *SendVideoCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendVideoCall) ReplyMarkup ¶

func (call *SendVideoCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVideoCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendVideoCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendVideoCall) ReplyToMessageID(replyToMessageID int) *SendVideoCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendVideoCall) SupportsStreaming ¶

func (call *SendVideoCall) SupportsStreaming(supportsStreaming bool) *SendVideoCall

SupportsStreaming Pass True, if the uploaded video is suitable for streaming

func (*SendVideoCall) Thumb ¶

func (call *SendVideoCall) Thumb(thumb FileArg) *SendVideoCall

Thumb Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

func (*SendVideoCall) Video ¶

func (call *SendVideoCall) Video(video FileArg) *SendVideoCall

Video Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More information on Sending Files »

func (*SendVideoCall) Width ¶

func (call *SendVideoCall) Width(width int) *SendVideoCall

Width Video width

type SendVideoNoteCall ¶

type SendVideoNoteCall struct {
	Call[Message]
}

SendVideoNoteCall reprenesents a call to the sendVideoNote method. As of v.4.0, Telegram clients support rounded square MPEG4 videos of up to 1 minute long Use this method to send video messages On success, the sent Message is returned.

func NewSendVideoNoteCall ¶

func NewSendVideoNoteCall(chatID PeerID, videoNote FileArg) *SendVideoNoteCall

NewSendVideoNoteCall constructs a new SendVideoNoteCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) videoNote - Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported

func (*SendVideoNoteCall) AllowSendingWithoutReply ¶

func (call *SendVideoNoteCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVideoNoteCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendVideoNoteCall) ChatID ¶ added in v0.0.5

func (call *SendVideoNoteCall) ChatID(chatID PeerID) *SendVideoNoteCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendVideoNoteCall) DisableNotification ¶

func (call *SendVideoNoteCall) DisableNotification(disableNotification bool) *SendVideoNoteCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendVideoNoteCall) Duration ¶

func (call *SendVideoNoteCall) Duration(duration int) *SendVideoNoteCall

Duration Duration of sent video in seconds

func (*SendVideoNoteCall) Length ¶

func (call *SendVideoNoteCall) Length(length int) *SendVideoNoteCall

Length Video width and height, i.e. diameter of the video message

func (*SendVideoNoteCall) ProtectContent ¶

func (call *SendVideoNoteCall) ProtectContent(protectContent bool) *SendVideoNoteCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendVideoNoteCall) ReplyMarkup ¶

func (call *SendVideoNoteCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVideoNoteCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendVideoNoteCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendVideoNoteCall) ReplyToMessageID(replyToMessageID int) *SendVideoNoteCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendVideoNoteCall) Thumb ¶

func (call *SendVideoNoteCall) Thumb(thumb FileArg) *SendVideoNoteCall

Thumb Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

func (*SendVideoNoteCall) VideoNote ¶

func (call *SendVideoNoteCall) VideoNote(videoNote FileArg) *SendVideoNoteCall

VideoNote Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More information on Sending Files ». Sending video notes by a URL is currently unsupported

type SendVoiceCall ¶

type SendVoiceCall struct {
	Call[Message]
}

SendVoiceCall reprenesents a call to the sendVoice method. Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document) On success, the sent Message is returned Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

func NewSendVoiceCall ¶

func NewSendVoiceCall(chatID PeerID, voice FileArg) *SendVoiceCall

NewSendVoiceCall constructs a new SendVoiceCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) voice - Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

func (*SendVoiceCall) AllowSendingWithoutReply ¶

func (call *SendVoiceCall) AllowSendingWithoutReply(allowSendingWithoutReply bool) *SendVoiceCall

AllowSendingWithoutReply Pass True, if the message should be sent even if the specified replied-to message is not found

func (*SendVoiceCall) Caption ¶

func (call *SendVoiceCall) Caption(caption string) *SendVoiceCall

Caption Voice message caption, 0-1024 characters after entities parsing

func (*SendVoiceCall) CaptionEntities ¶

func (call *SendVoiceCall) CaptionEntities(captionEntities []MessageEntity) *SendVoiceCall

CaptionEntities A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode

func (*SendVoiceCall) ChatID ¶ added in v0.0.5

func (call *SendVoiceCall) ChatID(chatID PeerID) *SendVoiceCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SendVoiceCall) DisableNotification ¶

func (call *SendVoiceCall) DisableNotification(disableNotification bool) *SendVoiceCall

DisableNotification Sends the message silently. Users will receive a notification with no sound.

func (*SendVoiceCall) Duration ¶

func (call *SendVoiceCall) Duration(duration int) *SendVoiceCall

Duration Duration of the voice message in seconds

func (*SendVoiceCall) ParseMode ¶

func (call *SendVoiceCall) ParseMode(parseMode ParseMode) *SendVoiceCall

ParseMode Mode for parsing entities in the voice message caption. See formatting options for more details.

func (*SendVoiceCall) ProtectContent ¶

func (call *SendVoiceCall) ProtectContent(protectContent bool) *SendVoiceCall

ProtectContent Protects the contents of the sent message from forwarding and saving

func (*SendVoiceCall) ReplyMarkup ¶

func (call *SendVoiceCall) ReplyMarkup(replyMarkup ReplyMarkup) *SendVoiceCall

ReplyMarkup Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

func (*SendVoiceCall) ReplyToMessageID ¶ added in v0.0.5

func (call *SendVoiceCall) ReplyToMessageID(replyToMessageID int) *SendVoiceCall

ReplyToMessageID If the message is a reply, ID of the original message

func (*SendVoiceCall) Voice ¶

func (call *SendVoiceCall) Voice(voice FileArg) *SendVoiceCall

Voice Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

type SentWebAppMessage ¶

type SentWebAppMessage struct {
	// Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message.
	InlineMessageID string `json:"inline_message_id,omitempty"`
}

SentWebAppMessage describes an inline message sent by a Web App on behalf of a user.

type SetChatAdministratorCustomTitleCall ¶

type SetChatAdministratorCustomTitleCall struct {
	CallNoResult
}

SetChatAdministratorCustomTitleCall reprenesents a call to the setChatAdministratorCustomTitle method. Use this method to set a custom title for an administrator in a supergroup promoted by the bot

func NewSetChatAdministratorCustomTitleCall ¶

func NewSetChatAdministratorCustomTitleCall(chatID PeerID, userID UserID, customTitle string) *SetChatAdministratorCustomTitleCall

NewSetChatAdministratorCustomTitleCall constructs a new SetChatAdministratorCustomTitleCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) userID - Unique identifier of the target user customTitle - New custom title for the administrator; 0-16 characters, emoji are not allowed

func (*SetChatAdministratorCustomTitleCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

func (*SetChatAdministratorCustomTitleCall) CustomTitle ¶

CustomTitle New custom title for the administrator; 0-16 characters, emoji are not allowed

func (*SetChatAdministratorCustomTitleCall) UserID ¶ added in v0.0.5

UserID Unique identifier of the target user

type SetChatDescriptionCall ¶

type SetChatDescriptionCall struct {
	CallNoResult
}

SetChatDescriptionCall reprenesents a call to the setChatDescription method. Use this method to change the description of a group, a supergroup or a channel The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights

func NewSetChatDescriptionCall ¶

func NewSetChatDescriptionCall(chatID PeerID) *SetChatDescriptionCall

NewSetChatDescriptionCall constructs a new SetChatDescriptionCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SetChatDescriptionCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SetChatDescriptionCall) Description ¶

func (call *SetChatDescriptionCall) Description(description string) *SetChatDescriptionCall

Description New chat description, 0-255 characters

type SetChatMenuButtonCall ¶

type SetChatMenuButtonCall struct {
	CallNoResult
}

SetChatMenuButtonCall reprenesents a call to the setChatMenuButton method. Use this method to change the bot's menu button in a private chat, or the default menu button

func NewSetChatMenuButtonCall ¶

func NewSetChatMenuButtonCall() *SetChatMenuButtonCall

NewSetChatMenuButtonCall constructs a new SetChatMenuButtonCall with required parameters.

func (*SetChatMenuButtonCall) ChatID ¶ added in v0.0.5

func (call *SetChatMenuButtonCall) ChatID(chatID ChatID) *SetChatMenuButtonCall

ChatID Unique identifier for the target private chat. If not specified, default bot's menu button will be changed

func (*SetChatMenuButtonCall) MenuButton ¶

func (call *SetChatMenuButtonCall) MenuButton(menuButton MenuButton) *SetChatMenuButtonCall

MenuButton A JSON-serialized object for the bot's new menu button. Defaults to MenuButtonDefault

type SetChatPermissionsCall ¶

type SetChatPermissionsCall struct {
	CallNoResult
}

SetChatPermissionsCall reprenesents a call to the setChatPermissions method. Use this method to set default chat permissions for all members The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights

func NewSetChatPermissionsCall ¶

func NewSetChatPermissionsCall(chatID PeerID, permissions ChatPermissions) *SetChatPermissionsCall

NewSetChatPermissionsCall constructs a new SetChatPermissionsCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) permissions - A JSON-serialized object for new default chat permissions

func (*SetChatPermissionsCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

func (*SetChatPermissionsCall) Permissions ¶

func (call *SetChatPermissionsCall) Permissions(permissions ChatPermissions) *SetChatPermissionsCall

Permissions A JSON-serialized object for new default chat permissions

type SetChatPhotoCall ¶

type SetChatPhotoCall struct {
	CallNoResult
}

SetChatPhotoCall reprenesents a call to the setChatPhoto method. Use this method to set a new profile photo for the chat Photos can't be changed for private chats The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights

func NewSetChatPhotoCall ¶

func NewSetChatPhotoCall(chatID PeerID, photo InputFile) *SetChatPhotoCall

NewSetChatPhotoCall constructs a new SetChatPhotoCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) photo - New chat photo, uploaded using multipart/form-data

func (*SetChatPhotoCall) ChatID ¶ added in v0.0.5

func (call *SetChatPhotoCall) ChatID(chatID PeerID) *SetChatPhotoCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SetChatPhotoCall) Photo ¶

func (call *SetChatPhotoCall) Photo(photo InputFile) *SetChatPhotoCall

Photo New chat photo, uploaded using multipart/form-data

type SetChatStickerSetCall ¶

type SetChatStickerSetCall struct {
	CallNoResult
}

SetChatStickerSetCall reprenesents a call to the setChatStickerSet method. Use this method to set a new group sticker set for a supergroup The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method

func NewSetChatStickerSetCall ¶

func NewSetChatStickerSetCall(chatID PeerID, stickerSetName string) *SetChatStickerSetCall

NewSetChatStickerSetCall constructs a new SetChatStickerSetCall with required parameters. chatID - Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) stickerSetName - Name of the sticker set to be set as the group sticker set

func (*SetChatStickerSetCall) ChatID ¶ added in v0.0.5

func (call *SetChatStickerSetCall) ChatID(chatID PeerID) *SetChatStickerSetCall

ChatID Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)

func (*SetChatStickerSetCall) StickerSetName ¶

func (call *SetChatStickerSetCall) StickerSetName(stickerSetName string) *SetChatStickerSetCall

StickerSetName Name of the sticker set to be set as the group sticker set

type SetChatTitleCall ¶

type SetChatTitleCall struct {
	CallNoResult
}

SetChatTitleCall reprenesents a call to the setChatTitle method. Use this method to change the title of a chat Titles can't be changed for private chats The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights

func NewSetChatTitleCall ¶

func NewSetChatTitleCall(chatID PeerID, title string) *SetChatTitleCall

NewSetChatTitleCall constructs a new SetChatTitleCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) title - New chat title, 1-255 characters

func (*SetChatTitleCall) ChatID ¶ added in v0.0.5

func (call *SetChatTitleCall) ChatID(chatID PeerID) *SetChatTitleCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*SetChatTitleCall) Title ¶

func (call *SetChatTitleCall) Title(title string) *SetChatTitleCall

Title New chat title, 1-255 characters

type SetGameScoreCall ¶

type SetGameScoreCall struct {
	Call[Message]
}

SetGameScoreCall reprenesents a call to the setGameScore method. Use this method to set the score of the specified user in a game message On success, if the message is not an inline message, the Message is returned, otherwise True is returned Returns an error, if the new score is not greater than the user's current score in the chat and force is False.

func NewSetGameScoreCall ¶

func NewSetGameScoreCall(userID UserID, score int) *SetGameScoreCall

NewSetGameScoreCall constructs a new SetGameScoreCall with required parameters. userID - User identifier score - New score, must be non-negative

func (*SetGameScoreCall) ChatID ¶ added in v0.0.5

func (call *SetGameScoreCall) ChatID(chatID ChatID) *SetGameScoreCall

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat

func (*SetGameScoreCall) DisableEditMessage ¶

func (call *SetGameScoreCall) DisableEditMessage(disableEditMessage bool) *SetGameScoreCall

DisableEditMessage Pass True, if the game message should not be automatically edited to include the current scoreboard

func (*SetGameScoreCall) Force ¶

func (call *SetGameScoreCall) Force(force bool) *SetGameScoreCall

Force Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters

func (*SetGameScoreCall) InlineMessageID ¶ added in v0.0.5

func (call *SetGameScoreCall) InlineMessageID(inlineMessageID string) *SetGameScoreCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*SetGameScoreCall) MessageID ¶ added in v0.0.5

func (call *SetGameScoreCall) MessageID(messageID int) *SetGameScoreCall

MessageID Required if inline_message_id is not specified. Identifier of the sent message

func (*SetGameScoreCall) Score ¶

func (call *SetGameScoreCall) Score(score int) *SetGameScoreCall

Score New score, must be non-negative

func (*SetGameScoreCall) UserID ¶ added in v0.0.5

func (call *SetGameScoreCall) UserID(userID UserID) *SetGameScoreCall

UserID User identifier

type SetMyCommandsCall ¶

type SetMyCommandsCall struct {
	CallNoResult
}

SetMyCommandsCall reprenesents a call to the setMyCommands method. Use this method to change the list of the bot's commands See https://core.telegram.org/bots#commands for more details about bot commands

func NewSetMyCommandsCall ¶

func NewSetMyCommandsCall(commands []BotCommand) *SetMyCommandsCall

NewSetMyCommandsCall constructs a new SetMyCommandsCall with required parameters. commands - A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.

func (*SetMyCommandsCall) Commands ¶

func (call *SetMyCommandsCall) Commands(commands []BotCommand) *SetMyCommandsCall

Commands A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.

func (*SetMyCommandsCall) LanguageCode ¶

func (call *SetMyCommandsCall) LanguageCode(languageCode string) *SetMyCommandsCall

LanguageCode A two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands

func (*SetMyCommandsCall) Scope ¶

Scope A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.

type SetMyDefaultAdministratorRightsCall ¶

type SetMyDefaultAdministratorRightsCall struct {
	CallNoResult
}

SetMyDefaultAdministratorRightsCall reprenesents a call to the setMyDefaultAdministratorRights method. Use this method to change the default administrator rights requested by the bot when it's added as an administrator to groups or channels These rights will be suggested to users, but they are are free to modify the list before adding the bot

func NewSetMyDefaultAdministratorRightsCall ¶

func NewSetMyDefaultAdministratorRightsCall() *SetMyDefaultAdministratorRightsCall

NewSetMyDefaultAdministratorRightsCall constructs a new SetMyDefaultAdministratorRightsCall with required parameters.

func (*SetMyDefaultAdministratorRightsCall) ForChannels ¶

ForChannels Pass True to change the default administrator rights of the bot in channels. Otherwise, the default administrator rights of the bot for groups and supergroups will be changed.

func (*SetMyDefaultAdministratorRightsCall) Rights ¶

Rights A JSON-serialized object describing new default administrator rights. If not specified, the default administrator rights will be cleared.

type SetPassportDataErrorsCall ¶

type SetPassportDataErrorsCall struct {
	CallNoResult
}

SetPassportDataErrorsCall reprenesents a call to the setPassportDataErrors method. Informs a user that some of the Telegram Passport elements they provided contains errors The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change) Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc Supply some details in the error message to make sure the user knows how to correct the issues.

func NewSetPassportDataErrorsCall ¶

func NewSetPassportDataErrorsCall(userID UserID, errors []PassportElementError) *SetPassportDataErrorsCall

NewSetPassportDataErrorsCall constructs a new SetPassportDataErrorsCall with required parameters. userID - User identifier errors - A JSON-serialized array describing the errors

func (*SetPassportDataErrorsCall) Errors ¶

Errors A JSON-serialized array describing the errors

func (*SetPassportDataErrorsCall) UserID ¶ added in v0.0.5

UserID User identifier

type SetStickerPositionInSetCall ¶

type SetStickerPositionInSetCall struct {
	CallNoResult
}

SetStickerPositionInSetCall reprenesents a call to the setStickerPositionInSet method. Use this method to move a sticker in a set created by the bot to a specific position

func NewSetStickerPositionInSetCall ¶

func NewSetStickerPositionInSetCall(sticker string, position int) *SetStickerPositionInSetCall

NewSetStickerPositionInSetCall constructs a new SetStickerPositionInSetCall with required parameters. sticker - File identifier of the sticker position - New sticker position in the set, zero-based

func (*SetStickerPositionInSetCall) Position ¶

Position New sticker position in the set, zero-based

func (*SetStickerPositionInSetCall) Sticker ¶

Sticker File identifier of the sticker

type SetStickerSetThumbCall ¶

type SetStickerSetThumbCall struct {
	CallNoResult
}

SetStickerSetThumbCall reprenesents a call to the setStickerSetThumb method. Use this method to set the thumbnail of a sticker set Animated thumbnails can be set for animated sticker sets only Video thumbnails can be set only for video sticker sets only

func NewSetStickerSetThumbCall ¶

func NewSetStickerSetThumbCall(name string, userID UserID) *SetStickerSetThumbCall

NewSetStickerSetThumbCall constructs a new SetStickerSetThumbCall with required parameters. name - Sticker set name userID - User identifier of the sticker set owner

func (*SetStickerSetThumbCall) Name ¶

Name Sticker set name

func (*SetStickerSetThumbCall) Thumb ¶

Thumb A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#animated-sticker-requirements for animated sticker technical requirements, or a WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-sticker-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files ». Animated sticker set thumbnails can't be uploaded via HTTP URL.

func (*SetStickerSetThumbCall) UserID ¶ added in v0.0.5

UserID User identifier of the sticker set owner

type SetWebhookCall ¶

type SetWebhookCall struct {
	CallNoResult
}

SetWebhookCall reprenesents a call to the setWebhook method. Use this method to specify a URL and receive incoming updates via an outgoing webhook Whenever there is an update for the bot, we will send an HTTPS POST request to the specified URL, containing a JSON-serialized Update In case of an unsuccessful request, we will give up after a reasonable amount of attempts If you'd like to make sure that the webhook was set by you, you can specify secret data in the parameter secret_token If specified, the request will contain a header “X-Telegram-Bot-Api-Secret-Token” with the secret token as content.

func NewSetWebhookCall ¶

func NewSetWebhookCall(url string) *SetWebhookCall

NewSetWebhookCall constructs a new SetWebhookCall with required parameters. url - HTTPS URL to send updates to. Use an empty string to remove webhook integration

func (*SetWebhookCall) AllowedUpdates ¶

func (call *SetWebhookCall) AllowedUpdates(allowedUpdates []string) *SetWebhookCall

AllowedUpdates A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all update types except chat_member (default). If not specified, the previous setting will be used.Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.

func (*SetWebhookCall) Certificate ¶

func (call *SetWebhookCall) Certificate(certificate InputFile) *SetWebhookCall

Certificate Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.

func (*SetWebhookCall) DropPendingUpdates ¶

func (call *SetWebhookCall) DropPendingUpdates(dropPendingUpdates bool) *SetWebhookCall

DropPendingUpdates Pass True to drop all pending updates

func (*SetWebhookCall) IPAddress ¶ added in v0.0.5

func (call *SetWebhookCall) IPAddress(ipAddress string) *SetWebhookCall

IPAddress The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS

func (*SetWebhookCall) MaxConnections ¶

func (call *SetWebhookCall) MaxConnections(maxConnections int) *SetWebhookCall

MaxConnections The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.

func (*SetWebhookCall) SecretToken ¶

func (call *SetWebhookCall) SecretToken(secretToken string) *SetWebhookCall

SecretToken A secret token to be sent in a header “X-Telegram-Bot-Api-Secret-Token” in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.

func (*SetWebhookCall) URL ¶ added in v0.0.5

func (call *SetWebhookCall) URL(url string) *SetWebhookCall

URL HTTPS URL to send updates to. Use an empty string to remove webhook integration

type ShippingAddress ¶

type ShippingAddress struct {
	// Two-letter ISO 3166-1 alpha-2 country code
	CountryCode string `json:"country_code"`

	// State, if applicable
	State string `json:"state"`

	// City
	City string `json:"city"`

	// First line for the address
	StreetLine1 string `json:"street_line1"`

	// Second line for the address
	StreetLine2 string `json:"street_line2"`

	// Address post code
	PostCode string `json:"post_code"`
}

ShippingAddress this object represents a shipping address.

type ShippingOption ¶

type ShippingOption struct {
	// Shipping option identifier
	ID string `json:"id"`

	// Option title
	Title string `json:"title"`

	// List of price portions
	Prices []LabeledPrice `json:"prices"`
}

ShippingOption this object represents one shipping option.

type ShippingQuery ¶

type ShippingQuery struct {
	// Unique query identifier
	ID string `json:"id"`

	// User who sent the query
	From User `json:"from"`

	// Bot specified invoice payload
	InvoicePayload string `json:"invoice_payload"`

	// User specified shipping address
	ShippingAddress ShippingAddress `json:"shipping_address"`
}

ShippingQuery this object contains information about an incoming shipping query.

type Sticker ¶

type Sticker struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID string `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Sticker width
	Width int `json:"width"`

	// Sticker height
	Height int `json:"height"`

	// True, if the sticker is animated
	IsAnimated bool `json:"is_animated"`

	// True, if the sticker is a video sticker
	IsVideo bool `json:"is_video"`

	// Optional. Sticker thumbnail in the .WEBP or .JPG format
	Thumb *PhotoSize `json:"thumb,omitempty"`

	// Optional. Emoji associated with the sticker
	Emoji string `json:"emoji,omitempty"`

	// Optional. Name of the sticker set to which the sticker belongs
	SetName string `json:"set_name,omitempty"`

	// Optional. Premium animation for the sticker, if the sticker is premium
	PremiumAnimation *File `json:"premium_animation,omitempty"`

	// Optional. For mask stickers, the position where the mask should be placed
	MaskPosition *MaskPosition `json:"mask_position,omitempty"`

	// Optional. File size in bytes
	FileSize int `json:"file_size,omitempty"`
}

Sticker this object represents a sticker.

type StickerSet ¶

type StickerSet struct {
	// Sticker set name
	Name string `json:"name"`

	// Sticker set title
	Title string `json:"title"`

	// True, if the sticker set contains animated stickers
	IsAnimated bool `json:"is_animated"`

	// True, if the sticker set contains video stickers
	IsVideo bool `json:"is_video"`

	// True, if the sticker set contains masks
	ContainsMasks bool `json:"contains_masks"`

	// List of all set stickers
	Stickers []Sticker `json:"stickers"`

	// Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
	Thumb *PhotoSize `json:"thumb,omitempty"`
}

StickerSet this object represents a sticker set.

type StopMessageLiveLocationCall ¶

type StopMessageLiveLocationCall struct {
	Call[Message]
}

StopMessageLiveLocationCall reprenesents a call to the stopMessageLiveLocation method. Use this method to stop updating a live location message before live_period expires On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.

func NewStopMessageLiveLocationCall ¶

func NewStopMessageLiveLocationCall(chatID PeerID, messageID int) *StopMessageLiveLocationCall

NewStopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters. chatID - Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Required if inline_message_id is not specified. Identifier of the message with live location to stop

func NewStopMessageLiveLocationInlineCall ¶

func NewStopMessageLiveLocationInlineCall(inlineMessageID string) *StopMessageLiveLocationCall

NewStopMessageLiveLocationCall constructs a new StopMessageLiveLocationCall with required parameters. inlineMessageID - Required if chat_id and message_id are not specified. Identifier of the inline message

func (*StopMessageLiveLocationCall) ChatID ¶ added in v0.0.5

ChatID Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*StopMessageLiveLocationCall) InlineMessageID ¶ added in v0.0.5

func (call *StopMessageLiveLocationCall) InlineMessageID(inlineMessageID string) *StopMessageLiveLocationCall

InlineMessageID Required if chat_id and message_id are not specified. Identifier of the inline message

func (*StopMessageLiveLocationCall) MessageID ¶ added in v0.0.5

func (call *StopMessageLiveLocationCall) MessageID(messageID int) *StopMessageLiveLocationCall

MessageID Required if inline_message_id is not specified. Identifier of the message with live location to stop

func (*StopMessageLiveLocationCall) ReplyMarkup ¶

ReplyMarkup A JSON-serialized object for a new inline keyboard.

type StopPollCall ¶

type StopPollCall struct {
	Call[Poll]
}

StopPollCall reprenesents a call to the stopPoll method. Use this method to stop a poll which was sent by the bot On success, the stopped Poll is returned.

func NewStopPollCall ¶

func NewStopPollCall(chatID PeerID, messageID int) *StopPollCall

NewStopPollCall constructs a new StopPollCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) messageID - Identifier of the original message with the poll

func (*StopPollCall) ChatID ¶ added in v0.0.5

func (call *StopPollCall) ChatID(chatID PeerID) *StopPollCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*StopPollCall) MessageID ¶ added in v0.0.5

func (call *StopPollCall) MessageID(messageID int) *StopPollCall

MessageID Identifier of the original message with the poll

func (*StopPollCall) ReplyMarkup ¶

func (call *StopPollCall) ReplyMarkup(replyMarkup InlineKeyboardMarkup) *StopPollCall

ReplyMarkup A JSON-serialized object for a new message inline keyboard.

type SuccessfulPayment ¶

type SuccessfulPayment struct {
	// Three-letter ISO 4217 currency code
	Currency string `json:"currency"`

	// Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
	TotalAmount int `json:"total_amount"`

	// Bot specified invoice payload
	InvoicePayload string `json:"invoice_payload"`

	// Optional. Identifier of the shipping option chosen by the user
	ShippingOptionID string `json:"shipping_option_id,omitempty"`

	// Optional. Order information provided by the user
	OrderInfo *OrderInfo `json:"order_info,omitempty"`

	// Telegram payment identifier
	TelegramPaymentChargeID string `json:"telegram_payment_charge_id"`

	// Provider payment identifier
	ProviderPaymentChargeID string `json:"provider_payment_charge_id"`
}

SuccessfulPayment this object contains basic information about a successful payment.

type UnbanChatMemberCall ¶

type UnbanChatMemberCall struct {
	CallNoResult
}

UnbanChatMemberCall reprenesents a call to the unbanChatMember method. Use this method to unban a previously banned user in a supergroup or channel The user will not return to the group or channel automatically, but will be able to join via link, etc The bot must be an administrator for this to work By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it So if the user is a member of the chat they will also be removed from the chat If you don't want this, use the parameter only_if_banned

func NewUnbanChatMemberCall ¶

func NewUnbanChatMemberCall(chatID PeerID, userID UserID) *UnbanChatMemberCall

NewUnbanChatMemberCall constructs a new UnbanChatMemberCall with required parameters. chatID - Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) userID - Unique identifier of the target user

func (*UnbanChatMemberCall) ChatID ¶ added in v0.0.5

func (call *UnbanChatMemberCall) ChatID(chatID PeerID) *UnbanChatMemberCall

ChatID Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)

func (*UnbanChatMemberCall) OnlyIfBanned ¶

func (call *UnbanChatMemberCall) OnlyIfBanned(onlyIfBanned bool) *UnbanChatMemberCall

OnlyIfBanned Do nothing if the user is not banned

func (*UnbanChatMemberCall) UserID ¶ added in v0.0.5

func (call *UnbanChatMemberCall) UserID(userID UserID) *UnbanChatMemberCall

UserID Unique identifier of the target user

type UnbanChatSenderChatCall ¶

type UnbanChatSenderChatCall struct {
	CallNoResult
}

UnbanChatSenderChatCall reprenesents a call to the unbanChatSenderChat method. Use this method to unban a previously banned channel chat in a supergroup or channel The bot must be an administrator for this to work and must have the appropriate administrator rights

func NewUnbanChatSenderChatCall ¶

func NewUnbanChatSenderChatCall(chatID PeerID, senderChatID int) *UnbanChatSenderChatCall

NewUnbanChatSenderChatCall constructs a new UnbanChatSenderChatCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername) senderChatID - Unique identifier of the target sender chat

func (*UnbanChatSenderChatCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*UnbanChatSenderChatCall) SenderChatID ¶ added in v0.0.5

func (call *UnbanChatSenderChatCall) SenderChatID(senderChatID int) *UnbanChatSenderChatCall

SenderChatID Unique identifier of the target sender chat

type UnpinAllChatMessagesCall ¶

type UnpinAllChatMessagesCall struct {
	CallNoResult
}

UnpinAllChatMessagesCall reprenesents a call to the unpinAllChatMessages method. Use this method to clear the list of pinned messages in a chat If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel

func NewUnpinAllChatMessagesCall ¶

func NewUnpinAllChatMessagesCall(chatID PeerID) *UnpinAllChatMessagesCall

NewUnpinAllChatMessagesCall constructs a new UnpinAllChatMessagesCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*UnpinAllChatMessagesCall) ChatID ¶ added in v0.0.5

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

type UnpinChatMessageCall ¶

type UnpinChatMessageCall struct {
	CallNoResult
}

UnpinChatMessageCall reprenesents a call to the unpinChatMessage method. Use this method to remove a message from the list of pinned messages in a chat If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel

func NewUnpinChatMessageCall ¶

func NewUnpinChatMessageCall(chatID PeerID) *UnpinChatMessageCall

NewUnpinChatMessageCall constructs a new UnpinChatMessageCall with required parameters. chatID - Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*UnpinChatMessageCall) ChatID ¶ added in v0.0.5

func (call *UnpinChatMessageCall) ChatID(chatID PeerID) *UnpinChatMessageCall

ChatID Unique identifier for the target chat or username of the target channel (in the format @channelusername)

func (*UnpinChatMessageCall) MessageID ¶ added in v0.0.5

func (call *UnpinChatMessageCall) MessageID(messageID int) *UnpinChatMessageCall

MessageID Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.

type Update ¶

type Update struct {
	// The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.
	ID int `json:"update_id"`

	// Optional. New incoming message of any kind - text, photo, sticker, etc.
	Message *Message `json:"message,omitempty"`

	// Optional. New version of a message that is known to the bot and was edited
	EditedMessage *Message `json:"edited_message,omitempty"`

	// Optional. New incoming channel post of any kind - text, photo, sticker, etc.
	ChannelPost *Message `json:"channel_post,omitempty"`

	// Optional. New version of a channel post that is known to the bot and was edited
	EditedChannelPost *Message `json:"edited_channel_post,omitempty"`

	// Optional. New incoming inline query
	InlineQuery *InlineQuery `json:"inline_query,omitempty"`

	// Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.
	ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"`

	// Optional. New incoming callback query
	CallbackQuery *CallbackQuery `json:"callback_query,omitempty"`

	// Optional. New incoming shipping query. Only for invoices with flexible price
	ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"`

	// Optional. New incoming pre-checkout query. Contains full information about checkout
	PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"`

	// Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
	Poll *Poll `json:"poll,omitempty"`

	// Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.
	PollAnswer *PollAnswer `json:"poll_answer,omitempty"`

	// Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.
	MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"`

	// Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.
	ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"`

	// Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.
	ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"`
}

Update this object represents an incoming update.At most one of the optional parameters can be present in any given update.

type UploadStickerFileCall ¶

type UploadStickerFileCall struct {
	Call[File]
}

UploadStickerFileCall reprenesents a call to the uploadStickerFile method. Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times) Returns the uploaded File on success.

func NewUploadStickerFileCall ¶

func NewUploadStickerFileCall(userID UserID, pngSticker InputFile) *UploadStickerFileCall

NewUploadStickerFileCall constructs a new UploadStickerFileCall with required parameters. userID - User identifier of sticker file owner pngSticker - PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More information on Sending Files »

func (*UploadStickerFileCall) PNGSticker ¶ added in v0.0.5

func (call *UploadStickerFileCall) PNGSticker(pngSticker InputFile) *UploadStickerFileCall

PNGSticker PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More information on Sending Files »

func (*UploadStickerFileCall) UserID ¶ added in v0.0.5

func (call *UploadStickerFileCall) UserID(userID UserID) *UploadStickerFileCall

UserID User identifier of sticker file owner

type User ¶

type User struct {
	// Unique identifier for this user or bot.
	ID UserID `json:"id"`

	// True, if this user is a bot
	IsBot bool `json:"is_bot"`

	// User's or bot's first name
	FirstName string `json:"first_name"`

	// Optional. User's or bot's last name
	LastName string `json:"last_name,omitempty"`

	// Optional. User's or bot's username
	Username Username `json:"username,omitempty"`

	// Optional. IETF language tag of the user's language
	LanguageCode string `json:"language_code,omitempty"`

	// Optional. True, if this user is a Telegram Premium user
	IsPremium bool `json:"is_premium,omitempty"`

	// Optional. True, if this user added the bot to the attachment menu
	AddedToAttachmentMenu bool `json:"added_to_attachment_menu,omitempty"`

	// Optional. True, if the bot can be invited to groups. Returned only in getMe.
	CanJoinGroups bool `json:"can_join_groups,omitempty"`

	// Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
	CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"`

	// Optional. True, if the bot supports inline queries. Returned only in getMe.
	SupportsInlineQueries bool `json:"supports_inline_queries,omitempty"`
}

User this object represents a Telegram user or bot.

type UserID ¶

type UserID int64

UserID it's unique identifier for Telegram user or bot.

func (UserID) PeerID ¶

func (id UserID) PeerID() string

type UserProfilePhotos ¶

type UserProfilePhotos struct {
	// Total number of profile pictures the target user has
	TotalCount int `json:"total_count"`

	// Requested profile pictures (in up to 4 sizes each)
	Photos [][]PhotoSize `json:"photos"`
}

UserProfilePhotos this object represent a user's profile pictures.

type Username ¶

type Username string

func (Username) PeerID ¶

func (un Username) PeerID() string

type Venue ¶

type Venue struct {
	// Venue location. Can't be a live location
	Location Location `json:"location"`

	// Name of the venue
	Title string `json:"title"`

	// Address of the venue
	Address string `json:"address"`

	// Optional. Foursquare identifier of the venue
	FoursquareID string `json:"foursquare_id,omitempty"`

	// Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
	FoursquareType string `json:"foursquare_type,omitempty"`

	// Optional. Google Places identifier of the venue
	GooglePlaceID string `json:"google_place_id,omitempty"`

	// Optional. Google Places type of the venue. (See supported types.)
	GooglePlaceType string `json:"google_place_type,omitempty"`
}

Venue this object represents a venue.

type Video ¶

type Video struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Video width as defined by sender
	Width int `json:"width"`

	// Video height as defined by sender
	Height int `json:"height"`

	// Duration of the video in seconds as defined by sender
	Duration int `json:"duration"`

	// Optional. Video thumbnail
	Thumb *PhotoSize `json:"thumb,omitempty"`

	// Optional. Original filename as defined by sender
	FileName string `json:"file_name,omitempty"`

	// Optional. MIME type of the file as defined by sender
	MIMEType string `json:"mime_type,omitempty"`

	// Optional. File size in bytes.
	FileSize int64 `json:"file_size,omitempty"`
}

Video this object represents a video file.

type VideoChatEnded ¶

type VideoChatEnded struct {
	// Video chat duration in seconds
	Duration int `json:"duration"`
}

VideoChatEnded this object represents a service message about a video chat ended in the chat.

type VideoChatParticipantsInvited ¶

type VideoChatParticipantsInvited struct {
	// New members that were invited to the video chat
	Users []User `json:"users"`
}

VideoChatParticipantsInvited this object represents a service message about new members invited to a video chat.

type VideoChatScheduled ¶

type VideoChatScheduled struct {
	// Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator
	StartDate int `json:"start_date"`
}

VideoChatScheduled this object represents a service message about a video chat scheduled in the chat.

type VideoChatStarted ¶

type VideoChatStarted struct {
	// Video chat duration in seconds
	Duration int `json:"duration"`
}

VideoChatStarted this object represents a service message about a video chat started in the chat. Currently holds no information.

type VideoNote ¶

type VideoNote struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Video width and height (diameter of the video message) as defined by sender
	Length int `json:"length"`

	// Duration of the video in seconds as defined by sender
	Duration int `json:"duration"`

	// Optional. Video thumbnail
	Thumb *PhotoSize `json:"thumb,omitempty"`

	// Optional. File size in bytes
	FileSize int `json:"file_size,omitempty"`
}

VideoNote this object represents a video message (available in Telegram apps as of v.4.0).

type Voice ¶

type Voice struct {
	// Identifier for this file, which can be used to download or reuse the file
	FileID FileID `json:"file_id"`

	// Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
	FileUniqueID string `json:"file_unique_id"`

	// Duration of the audio in seconds as defined by sender
	Duration int `json:"duration"`

	// Optional. MIME type of the file as defined by sender
	MIMEType string `json:"mime_type,omitempty"`

	// Optional. File size in bytes.
	FileSize int64 `json:"file_size,omitempty"`
}

Voice this object represents a voice note.

type WebAppChat ¶ added in v0.0.5

type WebAppChat struct {
	// Unique identifier for this chat.
	ID ChatID `json:"id"`

	// Type of chat, can be either “group”, “supergroup” or “channel”
	Type ChatType `json:"type"`

	// Title of the chat
	Title string `json:"title"`

	// Optional. Username of the chat
	Username string `json:"username,omitempty"`

	// Optional. URL of the chat’s photo. The photo can be in .jpeg or .svg formats. Only returned for Web Apps launched from the attachment menu.
	PhotoURL string `json:"photo_url,omitempty"`
}

WebAppChat this object represents a chat.

type WebAppData ¶

type WebAppData struct {
	// The data. Be aware that a bad client can send arbitrary data in this field.
	Data string `json:"data"`

	// Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.
	ButtonText string `json:"button_text"`
}

WebAppData describes data sent from a Web App to the bot.

type WebAppInfo ¶

type WebAppInfo struct {
	// An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps
	URL string `json:"url"`
}

WebAppInfo describes a Web App.

type WebAppInitData ¶ added in v0.0.5

type WebAppInitData struct {
	// Optional. A unique identifier for the Web App session, required for sending messages via the answerWebAppQuery method.
	QueryID string `json:"query_id,omitempty"`

	// Optional. An object containing data about the current user.
	User *WebAppUser `json:"user,omitempty"`

	// Optional. An object containing data about the chat partner of the current user in the chat where the bot was launched via the attachment menu. Returned only for private chats and only for Web Apps launched via the attachment menu.
	Receiver *WebAppUser `json:"receiver,omitempty"`

	// Optional. An object containing data about the chat where the bot was launched via the attachment menu. Returned for supergroups, channels and group chats – only for Web Apps launched via the attachment menu.
	Chat *WebAppChat `json:"chat,omitempty"`

	// Optional. The value of the startattach parameter, passed via link. Only returned for Web Apps when launched from the attachment menu via link.The value of the start_param parameter will also be passed in the GET-parameter tgWebAppStartParam, so the Web App can load the correct interface right away.
	StartParam string `json:"start_param,omitempty"`

	// Optional. Time in seconds, after which a message can be sent via the answerWebAppQuery method.
	CanSendAfter int `json:"can_send_after,omitempty"`

	// Unix time when the form was opened.
	AuthDate int64 `json:"auth_date"`

	// A hash of all passed parameters, which the bot server can use to check their validity.
	Hash string `json:"hash"`
	// contains filtered or unexported fields
}

WebAppInitData this object contains data that is transferred to the Web App when it is opened. It is empty if the Web App was launched from a keyboard button.

func ParseWebAppInitData ¶ added in v0.0.5

func ParseWebAppInitData(vs url.Values) (*WebAppInitData, error)

ParseWebAppInitData parses a WebAppInitData from query string.

func (WebAppInitData) Query ¶ added in v0.0.5

func (w WebAppInitData) Query() url.Values

Query returns a query values for the WebAppInitData.

func (WebAppInitData) Signature ¶ added in v0.0.5

func (w WebAppInitData) Signature(token string) string

Signature returns the signature of the WebAppInitData.

func (WebAppInitData) Valid ¶ added in v0.0.5

func (w WebAppInitData) Valid(token string) bool

type WebAppUser ¶ added in v0.0.5

type WebAppUser struct {
	// A unique identifier for the user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. It has at most 52 significant bits, so a 64-bit integer or a double-precision float type is safe for storing this identifier.
	ID UserID `json:"id"`

	// Optional. True, if this user is a bot. Returns in the receiver field only.
	IsBot bool `json:"is_bot,omitempty"`

	// First name of the user or bot.
	FirstName string `json:"first_name"`

	// Optional. Last name of the user or bot.
	LastName string `json:"last_name,omitempty"`

	// Optional. Username of the user or bot.
	Username string `json:"username,omitempty"`

	// Optional. IETF language tag of the user's language. Returns in user field only.
	LanguageCode string `json:"language_code,omitempty"`

	// Optional. URL of the user’s profile photo. The photo can be in .jpeg or .svg formats. Only returned for Web Apps launched from the attachment menu.
	PhotoURL string `json:"photo_url,omitempty"`
}

WebAppUser this object contains the data of the Web App user.

type WebhookInfo ¶

type WebhookInfo struct {
	// Webhook URL, may be empty if webhook is not set up
	URL string `json:"url"`

	// True, if a custom certificate was provided for webhook certificate checks
	HasCustomCertificate bool `json:"has_custom_certificate"`

	// Number of updates awaiting delivery
	PendingUpdateCount int `json:"pending_update_count"`

	// Optional. Currently used webhook IP address
	IPAddress string `json:"ip_address,omitempty"`

	// Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
	LastErrorDate int64 `json:"last_error_date,omitempty"`

	// Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
	LastErrorMessage string `json:"last_error_message,omitempty"`

	// Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters
	LastSynchronizationErrorDate int64 `json:"last_synchronization_error_date,omitempty"`

	// Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
	MaxConnections int `json:"max_connections,omitempty"`

	// Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
	AllowedUpdates []string `json:"allowed_updates,omitempty"`
}

WebhookInfo describes the current status of a webhook.

Directories ¶

Path Synopsis
Packages examples contains usage examples of go-tg.
Packages examples contains usage examples of go-tg.
calculator
Package contains example of using tgb.ChatType filter.
Package contains example of using tgb.ChatType filter.
chat-type-filter
Package contains example of using tgb.ChatType filter.
Package contains example of using tgb.ChatType filter.
echo-bot
Package contains simple echo bot, that demonstrates how to use handlers, filters and file uploads.
Package contains simple echo bot, that demonstrates how to use handlers, filters and file uploads.
media-group
Package contains example of using tgb.ChatType filter.
Package contains example of using tgb.ChatType filter.
quote-bot
Package contains example of using tgb.ChatType filter.
Package contains example of using tgb.ChatType filter.
webapps
Package contains example of using tgb.ChatType filter.
Package contains example of using tgb.ChatType filter.
tgb
Package tgb is a Telegram bot framework.
Package tgb is a Telegram bot framework.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL