Main Types
Update
Represents an incoming update from Telegram. An update is the fundamental unit that your bot receives.Message
Represents a message in Telegram. This is one of the most commonly used types.User
Represents a Telegram user or bot.Chat
Represents a chat (private, group, supergroup, or channel).Entity Types
MessageEntity
Represents formatting entities in messages (bold, links, mentions, etc.).Media Types
PhotoSize
Document
Audio, Video, Voice, VideoNote
Similar structures for different media types, all containing:file_id: Unique identifier for the filefile_unique_id: Unique identifier across all bots- Type-specific properties (duration, width, height, etc.)
Inline Mode Types
InlineQuery
Represents an incoming inline query.CallbackQuery
Represents an incoming callback query from an inline button.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:API Constants
grammY exports useful constants for working with the Bot API.DEFAULT_UPDATE_TYPES
List of update types a bot receives by default (excludeschat_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 totrue. Useful for lifting all restrictions from a user.
See Also
- Filter Types - Type narrowing with filter queries
- Middleware Types - Middleware function signatures
- Context - The context object