Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
import * as myGrammy from "https://deno.land/x/my_grammy@v0.0.8/deps.ts";

Classes

This is the single most important class of grammY. It represents your bot.

The composer is the heart of the middleware system in grammY. It is also the superclass of Bot. Whenever you call use or on or some of the other methods on your bot, you are in fact using the underlying composer instance to register your middleware.

When your bot receives a message, Telegram sends an update object to your bot. The update contains information about the chat, the user, and of course the message itself. There are numerous other updates, too: https://core.telegram.org/bots/api#update

Use this class to simplify building an inline keyboard (something like this: https://core.telegram.org/bots/features#inline-keyboards).

Variables

Hydrates a context with an additional set of reply methods

Creates a new transformer for the given parse mode.

Functions

Runs a grammY bot with long polling. Updates are processed concurrently with a default maximum concurrency of 500 updates. Calls to getUpdates will be slowed down and the limit parameter will be adjusted as soon as this load limit is reached.

Using a runner for grammY allows your bot to run middleware concurrently. This has the benefit that multiple messages can be processed concurrently, hence making your bot drastically more scalable, but it comes at the cost that race conditions may occur because some messages need to be processed in order.

Session middleware provides a persistent data storage for your bot. You can use it to let your bot remember any data you want, for example the messages it sent or received in the past. This is done by attaching session data to every chat. The stored data is then provided on the context object under ctx.session.

Interfaces

A session flavor is a context flavor that holds session data under ctx.session.

Type Aliases

Represents a filter query that can be passed to bot.on. There are three different kinds of filter queries: Level 1, Level 2, and Level 3. Check out the website to read about how filter queries work in grammY, and how to use them.

Context flavor for Context that will be hydrated with an additional set of reply methods from hydrateReply