Skip to main content
grammY re-exports all types from the grammY types package, which provides TypeScript definitions for the complete Telegram Bot API.

Main Types

Update

Represents an incoming update from Telegram. An update is the fundamental unit that your bot receives.
Usage:

Message

Represents a message in Telegram. This is one of the most commonly used types.
Usage:

User

Represents a Telegram user or bot.
Usage:

Chat

Represents a chat (private, group, supergroup, or channel).
Usage:

Entity Types

MessageEntity

Represents formatting entities in messages (bold, links, mentions, etc.).
Usage:

Media Types

PhotoSize

Document

Audio, Video, Voice, VideoNote

Similar structures for different media types, all containing:
  • file_id: Unique identifier for the file
  • file_unique_id: Unique identifier across all bots
  • Type-specific properties (duration, width, height, etc.)
Usage:

Inline Mode Types

InlineQuery

Represents an incoming inline query.

CallbackQuery

Represents an incoming callback query from an inline button.
Usage:

Payment Types

PreCheckoutQuery

Other Important Types

ChatMemberUpdated

Represents changes in chat member status.

Poll

InputFile

For uploading files to Telegram:

Type Utilities

grammY exports all types from @grammyjs/types. You can import any type you need:
For the complete list of available types, see the Telegram Bot API documentation and the grammY types repository.

API Constants

grammY exports useful constants for working with the Bot API.

DEFAULT_UPDATE_TYPES

List of update types a bot receives by default (excludes chat_member, message_reaction, and message_reaction_count).

ALL_UPDATE_TYPES

List of all available update types, including those not delivered by default.

ALL_CHAT_PERMISSIONS

An object containing all chat permissions set to true. Useful for lifting all restrictions from a user.

See Also