Categorygithub.com/EgorMizerov/telebot
modulepackage
1.0.7
Repository: https://github.com/egormizerov/telebot.git
Documentation: pkg.go.dev

# README

Telebot

"I never knew creating Telegram bots could be so sexy!"

GoDoc GitHub Actions codecov.io Discuss on Telegram

go get -u gopkg.in/telebot.v3

Overview

Telebot is a bot framework for Telegram Bot API. This package provides the best of its kind API for command routing, inline query requests and keyboards, as well as callbacks. Actually, I went a couple steps further, so instead of making a 1:1 API wrapper I chose to focus on the beauty of API and performance. Some strong sides of Telebot are:

  • Real concise API
  • Command routing
  • Middleware
  • Transparent File API
  • Effortless bot callbacks

All the methods of Telebot API are extremely easy to memorize and get used to. Also, consider Telebot a highload-ready solution. I'll test and benchmark the most popular actions and if necessary, optimize against them without sacrificing API quality.

Getting Started

Let's take a look at the minimal Telebot setup:

package main

import (
	"log"
	"os"
	"time"

	tele "gopkg.in/telebot.v3"
)

func main() {
	pref := tele.Settings{
		Token:  os.Getenv("TOKEN"),
		Poller: &tele.LongPoller{Timeout: 10 * time.Second},
	}

	b, err := tele.NewBot(pref)
	if err != nil {
		log.Fatal(err)
		return
	}

	b.Handle("/hello", func(c tele.Context) error {
		return c.Send("Hello!")
	})

	b.Start()
}

Simple, innit? Telebot's routing system takes care of delivering updates to their endpoints, so in order to get to handle any meaningful event, all you got to do is just plug your function into one of the Telebot-provided endpoints. You can find the full list here.

There are dozens of supported endpoints (see package consts). Let me know if you'd like to see some endpoint or endpoint ideas implemented. This system is completely extensible, so I can introduce them without breaking backwards compatibility.

Context

Context is a special type that wraps a huge update structure and represents the context of the current event. It provides several helpers, which allow getting, for example, the chat that this update had been sent in, no matter what kind of update this is.

b.Handle(tele.OnText, func(c tele.Context) error {
	// All the text messages that weren't
	// captured by existing handlers.

	var (
		user = c.Sender()
		text = c.Text()
	)

	// Use full-fledged bot's functions
	// only if you need a result:
	msg, err := b.Send(user, text)
	if err != nil {
		return err
	}

	// Instead, prefer a context short-hand:
	return c.Send(text)
})

b.Handle(tele.OnChannelPost, func(c tele.Context) error {
	// Channel posts only.
	msg := c.Message()
})

b.Handle(tele.OnPhoto, func(c tele.Context) error {
	// Photos only.
	photo := c.Message().Photo
})

b.Handle(tele.OnQuery, func(c tele.Context) error {
	// Incoming inline queries.
	return c.Answer(...)
})

Middleware

Telebot has a simple and recognizable way to set up middleware — chained functions with access to Context, called before the handler execution.

Import a middleware package to get some basic out-of-box middleware implementations:

import "gopkg.in/telebot.v3/middleware"
// Global-scoped middleware:
b.Use(middleware.Logger())
b.Use(middleware.AutoRespond())

// Group-scoped middleware:
adminOnly := b.Group()
adminOnly.Use(middleware.Whitelist(adminIDs...))
adminOnly.Handle("/ban", onBan)
adminOnly.Handle("/kick", onKick)

// Handler-scoped middleware:
b.Handle(tele.OnText, onText, middleware.IgnoreVia())

Custom middleware example:

// AutoResponder automatically responds to every callback update.
func AutoResponder(next tele.HandlerFunc) tele.HandlerFunc {
	return func(c tele.Context) error {
		if c.Callback() != nil {
			defer c.Respond()
		}
		return next(c) // continue execution chain
	}
}

Poller

Telebot doesn't really care how you provide it with incoming updates, as long as you set it up with a Poller, or call ProcessUpdate for each update:

// Poller is a provider of Updates.
//
// All pollers must implement Poll(), which accepts bot
// pointer and subscription channel and start polling
// synchronously straight away.
type Poller interface {
	// Poll is supposed to take the bot object
	// subscription channel and start polling
	// for Updates immediately.
	//
	// Poller must listen for stop constantly and close
	// it as soon as it's done polling.
	Poll(b *Bot, updates chan Update, stop chan struct{})
}

Commands

When handling commands, Telebot supports both direct (/command) and group-like syntax (/command@botname) and will never deliver messages addressed to some other bot, even if privacy mode is off.

For simplified deep-linking, Telebot also extracts payload:

// Command: /start <PAYLOAD>
b.Handle("/start", func(c tele.Context) error {
	fmt.Println(c.Message().Payload) // <PAYLOAD>
})

For multiple arguments use:

// Command: /tags <tag1> <tag2> <...>
b.Handle("/tags", func(c tele.Context) error {
	tags := c.Args() // list of arguments splitted by a space
	for _, tag := range tags {
		// iterate through passed arguments
	}
})

Files

Telegram allows files up to 50 MB in size.

Telebot allows to both upload (from disk or by URL) and download (from Telegram) files in bot's scope. Also, sending any kind of media with a File created from disk will upload the file to Telegram automatically:

a := &tele.Audio{File: tele.FromDisk("file.ogg")}

fmt.Println(a.OnDisk()) // true
fmt.Println(a.InCloud()) // false

// Will upload the file from disk and send it to the recipient
b.Send(recipient, a)

// Next time you'll be sending this very *Audio, Telebot won't
// re-upload the same file but rather utilize its Telegram FileID
b.Send(otherRecipient, a)

fmt.Println(a.OnDisk()) // true
fmt.Println(a.InCloud()) // true
fmt.Println(a.FileID) // <Telegram file ID>

You might want to save certain Files in order to avoid re-uploading. Feel free to marshal them into whatever format, File only contain public fields, so no data will ever be lost.

Sendable

Send is undoubtedly the most important method in Telebot. Send() accepts a Recipient (could be user, group or a channel) and a Sendable. Other types other than the Telebot-provided media types (Photo, Audio, Video, etc.) are Sendable. If you create composite types of your own, and they satisfy the Sendable interface, Telebot will be able to send them out.

// Sendable is any object that can send itself.
//
// This is pretty cool, since it lets bots implement
// custom Sendables for complex kinds of media or
// chat objects spanning across multiple messages.
type Sendable interface {
	Send(*Bot, Recipient, *SendOptions) (*Message, error)
}

The only type at the time that doesn't fit Send() is Album and there is a reason for that. Albums were added not so long ago, so they are slightly quirky for backwards compatibilities sake. In fact, an Album can be sent, but never received. Instead, Telegram returns a []Message, one for each media object in the album:

p := &tele.Photo{File: tele.FromDisk("chicken.jpg")}
v := &tele.Video{File: tele.FromURL("http://video.mp4")}

msgs, err := b.SendAlbum(user, tele.Album{p, v})

Send options

Send options are objects and flags you can pass to Send(), Edit() and friends as optional arguments (following the recipient and the text/media). The most important one is called SendOptions, it lets you control all the properties of the message supported by Telegram. The only drawback is that it's rather inconvenient to use at times, so Send() supports multiple shorthands:

// regular send options
b.Send(user, "text", &tele.SendOptions{
	// ...
})

// ReplyMarkup is a part of SendOptions,
// but often it's the only option you need
b.Send(user, "text", &tele.ReplyMarkup{
	// ...
})

// flags: no notification && no web link preview
b.Send(user, "text", tele.Silent, tele.NoPreview)

Full list of supported option-flags you can find here.

Editable

If you want to edit some existing message, you don't really need to store the original *Message object. In fact, upon edit, Telegram only requires chat_id and message_id. So you don't really need the Message as a whole. Also, you might want to store references to certain messages in the database, so I thought it made sense for any Go struct to be editable as a Telegram message, to implement Editable:

// Editable is an interface for all objects that
// provide "message signature", a pair of 32-bit
// message ID and 64-bit chat ID, both required
// for edit operations.
//
// Use case: DB model struct for messages to-be
// edited with, say two columns: msg_id,chat_id
// could easily implement MessageSig() making
// instances of stored messages editable.
type Editable interface {
	// MessageSig is a "message signature".
	//
	// For inline messages, return chatID = 0.
	MessageSig() (messageID int, chatID int64)
}

For example, Message type is Editable. Here is the implementation of StoredMessage type, provided by Telebot:

// StoredMessage is an example struct suitable for being
// stored in the database as-is or being embedded into
// a larger struct, which is often the case (you might
// want to store some metadata alongside, or might not.)
type StoredMessage struct {
	MessageID int   `sql:"message_id" json:"message_id"`
	ChatID    int64 `sql:"chat_id" json:"chat_id"`
}

func (x StoredMessage) MessageSig() (int, int64) {
	return x.MessageID, x.ChatID
}

Why bother at all? Well, it allows you to do things like this:

// just two integer columns in the database
var msgs []tele.StoredMessage
db.Find(&msgs) // gorm syntax

for _, msg := range msgs {
	bot.Edit(&msg, "Updated text")
	// or
	bot.Delete(&msg)
}

I find it incredibly neat. Worth noting, at this point of time there exists another method in the Edit family, EditCaption() which is of a pretty rare use, so I didn't bother including it to Edit(), just like I did with SendAlbum() as it would inevitably lead to unnecessary complications.

var m *Message

// change caption of a photo, audio, etc.
bot.EditCaption(m, "new caption")

Keyboards

Telebot supports both kinds of keyboards Telegram provides: reply and inline keyboards. Any button can also act as endpoints for Handle().

var (
	// Universal markup builders.
	menu     = &tele.ReplyMarkup{ResizeKeyboard: true}
	selector = &tele.ReplyMarkup{}

	// Reply buttons.
	btnHelp     = menu.Text("ℹ Help")
	btnSettings = menu.Text("⚙ Settings")

	// Inline buttons.
	//
	// Pressing it will cause the client to
	// send the bot a callback.
	//
	// Make sure Unique stays unique as per button kind
	// since it's required for callback routing to work.
	//
	btnPrev = selector.Data("⬅", "prev", ...)
	btnNext = selector.Data("➡", "next", ...)
)

menu.Reply(
	menu.Row(btnHelp),
	menu.Row(btnSettings),
)
selector.Inline(
	selector.Row(btnPrev, btnNext),
)

b.Handle("/start", func(c tele.Context) error {
	return c.Send("Hello!", menu)
})

// On reply button pressed (message)
b.Handle(&btnHelp, func(c tele.Context) error {
	return c.Edit("Here is some help: ...")
})

// On inline button pressed (callback)
b.Handle(&btnPrev, func(c tele.Context) error {
	return c.Respond()
})

You can use markup constructor for every type of possible button:

r := b.NewMarkup()

// Reply buttons:
r.Text("Hello!")
r.Contact("Send phone number")
r.Location("Send location")
r.Poll(tele.PollQuiz)

// Inline buttons:
r.Data("Show help", "help") // data is optional
r.Data("Delete item", "delete", item.ID)
r.URL("Visit", "https://google.com")
r.Query("Search", query)
r.QueryChat("Share", query)
r.Login("Login", &tele.Login{...})

Inline mode

So if you want to handle incoming inline queries you better plug the tele.OnQuery endpoint and then use the Answer() method to send a list of inline queries back. I think at the time of writing, Telebot supports all of the provided result types (but not the cached ones). This is what it looks like:

b.Handle(tele.OnQuery, func(c tele.Context) error {
	urls := []string{
		"http://photo.jpg",
		"http://photo2.jpg",
	}

	results := make(tele.Results, len(urls)) // []tele.Result
	for i, url := range urls {
		result := &tele.PhotoResult{
			URL:      url,
			ThumbURL: url, // required for photos
		}

		results[i] = result
		// needed to set a unique string ID for each result
		results[i].SetResultID(strconv.Itoa(i))
	}

	return c.Answer(&tele.QueryResponse{
		Results:   results,
		CacheTime: 60, // a minute
	})
})

There's not much to talk about really. It also supports some form of authentication through deep-linking. For that, use fields SwitchPMText and SwitchPMParameter of QueryResponse.

Contributing

  1. Fork it
  2. Clone v3: git clone -b v3 https://github.com/tucnak/telebot
  3. Create your feature branch: git checkout -b v3-feature
  4. Make changes and add them: git add .
  5. Commit: git commit -m "add some feature"
  6. Push: git push origin v3-feature
  7. Pull request

Donate

I do coding for fun, but I also try to search for interesting solutions and optimize them as much as possible. If you feel like it's a good piece of software, I wouldn't mind a tip!

Litecoin: ltc1qskt5ltrtyg7esfjm0ftx6jnacwffhpzpqmerus

Ethereum: 0xB78A2Ac1D83a0aD0b993046F9fDEfC5e619efCAB

License

Telebot is distributed under MIT.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# Functions

AdminRights could be used to promote user to admin.
Err returns Error instance by given description.
ErrIs checks if the error with given description matches an error err.
Flag returns a pointer to the given bool.
Forever is a ExpireUnixtime of "forever" banning.
FromDisk constructs a new local (on-disk) file object.
FromReader constructs a new file from io.Reader.
FromURL constructs a new file on provided HTTP URL.
NewBot does try to build a Bot with token `token`, which is a secret API key assigned to particular bot.
NewError returns new Error instance with given description.
NewMiddlewarePoller wait for it..
NoRestrictions should be used when un-restricting or un-promoting user.
NoRights is the default Rights{}.
Placeholder is used to set input field placeholder as a send option.

# Constants

No description provided by the author
AllowWithoutReply = SendOptions.AllowWithoutReply.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
ForceReply = ReplyMarkup.ForceReply.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NoPreview = SendOptions.DisableWebPagePreview.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
OneTimeKeyboard = ReplyMarkup.OneTimeKeyboard.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
OnMigration happens when group switches to a supergroup.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
Basic message handlers.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
These are one of the possible events Handle() can deal with.
NOTE: Despite "any" type isn't described in documentation, it needed for proper KeyboardButtonPollType marshaling.
No description provided by the author
No description provided by the author
Protected = SendOptions.Protected.
No description provided by the author
No description provided by the author
No description provided by the author
RemoveKeyboard = ReplyMarkup.RemoveKeyboard.
No description provided by the author
Silent = SendOptions.DisableNotification.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Bad request errors.
No description provided by the author
Bad request errors.
No description provided by the author
Bad request errors.
Bad request errors.
Forbidden errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
No description provided by the author
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
General errors.
Forbidden errors.
Forbidden errors.
Forbidden errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Forbidden errors.
General errors.
Bad request errors.
Bad request errors.
Bad request errors.
Forbidden errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
General errors.
Bad request errors.
Bad request errors.
No description provided by the author
General errors.
No description provided by the author
Bad request errors.
Bad request errors.
Forbidden errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
Bad request errors.
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

Animation object represents a animation file.
ArticleResult represents a link to an article or web page.
Audio object represents an audio file.
AudioResult represents a link to an mp3 audio file.
AutoDeleteTimer represents a service message about a change in auto-delete timer settings.
Boost contains information about a chat boost.
BoostAdded represents a service message about a user boosting a chat.
BoostRemoved represents a boost removed from a chat.
BoostSource describes the source of a chat boost.
BoostUpdated represents a boost added to a chat or changed.
Bot represents a separate Telegram bot instance.
BotInfo represents a single object of BotName, BotDescription, BotShortDescription instances.
Btn is a constructor button, which will later become either a reply, or an inline button.
Callback object represents a query from a callback button in an inline keyboard.
CallbackResponse builds a response to a Callback query.
Chat object represents a Telegram user, bot, group or a channel.
ChatInviteLink object represents an invite for a chat.
ChatJoinRequest represents a join request sent to a chat.
ChatLocation represents a location to which a chat is connected.
ChatMember object represents information about a single chat member.
ChatMemberUpdate object represents changes in the status of a chat member.
ChatPhoto object represents a chat photo.
Command represents a bot command.
CommandParams controls parameters for commands-related methods (setMyCommands, deleteMyCommands and getMyCommands).
CommandScope object represents a scope to which bot commands are applied.
Contact object represents a contact to Telegram user.
ContactResult represents a contact with a phone number.
Currency contains information about supported currency for payments.
Dice object represents a dice with a random value from 1 to 6 for currently supported base emoji.
Document object represents a general file (as opposed to Photo or Audio).
DocumentResult represents a link to a file.
No description provided by the author
ExternalReplyInfo contains information about a message that is being replied to, which may come from another chat or forum topic.
File object represents any sort of file.
No description provided by the author
Game object represents a game.
GameHighScore object represents one row of the high scores table for a game.
GameResult represents a game.
GifResult represents a link to an animated GIF file.
Giveaway represents a message about a scheduled giveaway.
GiveawayCompleted represents a service message about the completion of a giveaway without public winners.
GiveawayCreated represents a service message about the creation of a scheduled giveaway.
GiveawayWinners object represents a message about the completion of a giveaway with public winners.
Group is a separated group of handlers, united by the general middleware.
No description provided by the author
InlineButton represents a button displayed in the message.
InlineResult represents a result of an inline query that was chosen by the user and sent to their chat partner.
InputContactMessageContent represents the content of a contact message to be sent as the result of an inline query.
InputLocationMessageContent represents the content of a location message to be sent as the result of an inline query.
InputMedia represents a composite InputMedia struct that is used by Telebot in sending and editing media methods.
No description provided by the author
InputTextMessageContent represents the content of a text message to be sent as the result of an inline query.
InputVenueMessageContent represents the content of a venue message to be sent as the result of an inline query.
Invoice contains basic information about an invoice.
Location object represents geographic position.
LocationResult represents a location on a map.
Login represents a parameter of the inline keyboard button used to automatically authorize a user.
LongPoller is a classic LongPoller with timeout.
MaskPosition describes the position on faces where a mask should be placed by default.
MenuButton describes the bot's menu button in a private chat.
Message object represents a message.
MessageEntity object represents "special" parts of text messages, including hashtags, usernames, URLs, etc.
MessageOrigin a message reference that has been sent originally by a known user.
MessageReaction object represents a change of a reaction on a message performed by a user.
MessageReactionCount represents reaction changes on a message with anonymous reactions.
MiddlewarePoller is a special kind of poller that acts like a filter for updates.
Mpeg4GifResult represents a link to a video animation (H.264/MPEG-4 AVC video without sound).
Order represents information about an order.
Payment contains basic information about a successful payment.
Photo object represents a single photo file.
PhotoResult represents a link to a photo.
Poll contains information about a poll.
PollAnswer represents an answer of a user in a non-anonymous poll.
PollOption contains information about one answer option in a poll.
PreCheckoutQuery contains information about an incoming pre-checkout query.
PreviewOptions describes the options used for link preview generation.
Price represents a portion of the price for goods or services.
ProximityAlert sent whenever a user in the chat triggers a proximity alert set by another user.
Query is an incoming inline query.
QueryResponse builds a response to an inline Query.
QueryResponseButton represents a button to be shown above inline query results.
Reaction describes the type of reaction.
ReactionCount represents a reaction added to a message along with the number of times it was added.
ReactionOptions represents an object of reaction options.
RecipientShared combines both UserShared and ChatShared objects.
ReplyButton represents a button displayed in reply-keyboard.
ReplyMarkup controls two convenient options for bot-user communications such as reply keyboard and inline "keyboard" (a grid of buttons as a part of the message).
ReplyParams describes reply parameters for the message that is being sent.
ReplyRecipient combines both KeyboardButtonRequestUser and KeyboardButtonRequestChat objects.
ResultBase must be embedded into all IQRs.
Rights is a list of privileges available to chat members.
SendOptions has most complete control over in what way the message must be sent, providing an API-complete set of custom properties and options.
Settings represents a utility struct for passing certain properties of a bot around and is required to make bots.
ShippingAddress represents a shipping address.
ShippingOption represents one shipping option.
ShippingQuery contains information about an incoming shipping query.
Sticker object represents a WebP image, so-called sticker.
StickerResult represents an inline cached sticker response.
StickerSet represents a sticker set.
StoredMessage is an example struct suitable for being stored in the database as-is or being embedded into a larger struct, which is often the case (you might want to store some metadata alongside, or might not.).
Story
No description provided by the author
SwitchInlineQuery represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.
TextQuote contains information about the quoted part of a message that is replied to by the given message.
No description provided by the author
Update object represents an incoming update.
User object represents a Telegram user, bot.
Venue object represents a venue location with name, address and optional foursquare ID.
VenueResult represents a venue.
Video object represents a video file.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
VideoNote represents a video message.
VideoResult represents a link to a page containing an embedded video player or a video file.
Voice object represents a voice note.
VoiceResult represents a link to a voice recording in an .ogg container encoded with OPUS.
WebApp represents a parameter of the inline keyboard button or the keyboard button used to launch Web App.
WebAppData object represents a data sent from a Web App to the bot.
WebAppMessage describes an inline message sent by a Web App on behalf of a user.
A Webhook configures the poller for webhooks.
A WebhookEndpoint describes the endpoint to which telegram will send its requests.
A WebhookTLS specifies the path to a key and a cert so the poller can open a TLS listener.
WebAppAccessAllowed represents a service message about a user allowing a bot to write messages after adding the bot to the attachment menu or launching a Web App from a link.

# Interfaces

CallbackEndpoint is an interface any element capable of responding to a callback `\f<unique>`.
CallbackRXEndpoint is an interface any element capable of responding to a callback `\r<rxunique>`.
Context wraps an update and represents the context of current event.
Editable is an interface for all objects that provide "message signature", a pair of 32-bit message ID and 64-bit chat ID, both required for edit operations.
InputMessageContent objects represent the content of a message to be sent as a result of an inline query.
Inputtable is a generic type for all kinds of media you can put into an album.
Media is a generic type for all kinds of media that includes File.
Poller is a provider of Updates.
Recipient is any possible endpoint you can send messages to: either user, group or a channel.
Result represents one result of an inline query.
Sendable is any object that can send itself.

# Type aliases

Album lets you group multiple media into a single message.
BoostSourceType describes a type of boost.
ChatAction is a client-side status indicating bot activity.
ChatID represents a chat or an user integer ID, which can be used as recipient in bot methods.
ChatType represents one of the possible chat types.
No description provided by the author
DiceType defines dice types.
Entities are used to set message's text entities as a send option.
EntityType is a MessageEntity type.
HandlerFunc represents a handler function, which is used to handle actual endpoints.
M is a shortcut for map[string]interface{}.
No description provided by the author
MemberStatus is one's chat status.
No description provided by the author
MiddlewareFunc represents a middleware processing function, which get called before the endpoint group or specific handler.
Option is a shortcut flag type for certain message features (so-called options).
ParseMode determines the way client applications treat the text of the message.
PollType defines poll types.
Results is a slice wrapper for convenient marshalling.
Row represents an array of buttons, a row.
No description provided by the author
No description provided by the author