Skip to content

Releases: gramiojs/contexts

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 16 Jun 19:28
6dcad93

Bumps @gramio/types to ^10.1.0.

  • poll-option Link structure (PollMedia.link)

    User.supportsJoinRequestQueries

  • chat join request queries: ctx.answerQuery, ChatFullInfo.guardBot,

Other 10.1 receive features:

  • ctx.streamMessage(): add an await using handle form to match

    auto-finalize via await using, AbortSignal) over sendRichMessageDraft

  • ctx.streamRichMessage(): draft lifecycle helper (throttled previews,

    command/filter handlers keep working on rich messages

  • RichMessage receive structure + .text flattener; ctx.text falls back to it so

    (brand-detected, no @gramio/format dependency)

  • route ctx.send/reply/editText to sendRichMessage when given a RichString

feat: Bot API 10.1 supportRich Messages (send + receive + streaming):

Co-authored-by: Adrian Galilea 90320947+adriangalilea@users.noreply.github.com

Gap reported & investigated by @adriangalilea in #4.

non-topic discussion threads).

covers it without the regression risk of forwarding message_thread_id in

is_topic_message for private-chat Threaded Mode too — so the guard already

the is_topic_message guard (grammY-consistent, and Bot API 10.1 sets

Add both getters, delegating to the originating message. Unlike #4, this keeps

replies fell into the chat's general thread.

SendMixin thread-forwarding guard could never fire inside a callback handler —

fix(callback): expose threadId + isTopicMessage so SendMixin forwards thread from callbacksCallbackQueryContext exposed chatId but not threadId/isTopicMessage, so the

build pass cleanly on 1.3.14.

test instantiates CallbackQueryContext from source. The full suite + pkgroll

contextMappings referencing Contexts.CallbackQueryContext at module-eval) when a

ci: bump publish bun to 1.3.141.1.34 trips a TDZ on the package's known circular init (src/index.ts builds
Full Changelog: v0.8.0...v0.9.0

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 03 Jun 13:16
e51c7bc

getters in MessageContext JSDoc.

TelegramFileDownload in @gramio/files. Also nudge ctx.payload -> camelCase

BotLike.downloadFile / context.download() with it. Implemented by

.text()/.json()/.stream()/.toFile()/.link()/.info()) and type

feat: rich FileDownload handle for ctx.download() / BotLike.downloadFileAdd a FileDownload interface (PromiseLike + .bytes()/.blob()/
Full Changelog: v0.7.0...v0.8.0

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 08 May 18:07
7d7bcb9
  • @gramio/types bumped to ^10.0.0; version 0.7.0

  • New top-level update mapping: guest_message -> MessageContext

  • ChatMemberControlMixin: getUserPersonalChatMessages, getManagedBotAccessSettings, setManagedBotAccessSettings

  • NodeMixin: deleteReaction, deleteAllReactions

  • ChatMember: canReactToMessages()

  • ChatPermissions: canReactToMessages

  • User: supportsGuestQueries()

  • PollOption: media

  • Poll: membersOnly, countryCodes, explanationMedia, media

  • Message: guestQueryId, guestBotCallerUser, guestBotCallerChat, livePhoto; MessageContext.answerGuestQuery

  • New structures: PaidMediaLivePhoto, PollMedia, BotAccessSettings, SentGuestMessage

feat: add Bot API 10.0 support- New attachment: LivePhotoAttachment + Message.livePhoto / ExternalReplyInfo.livePhoto / SendMixin.sendLivePhoto

fix: avoid circular import in poll-media via direct attachment imports
Full Changelog: v0.6.1...v0.7.0

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 10 Apr 22:21
8f41313

@gramio/keyboards.

through semver. Matches the range style used by @gramio/format and

(gramio, plugins) from picking up @gramio/types patch releases

chore: relax @gramio/types peer dep to ^9.6.0Exact-version pin in peerDependencies blocked downstream consumers
Full Changelog: v0.6.0...v0.6.1

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 10 Apr 21:09
bd1d296
  • ManagedBotContext: getManagedBotToken/replaceManagedBotToken using payload.user.id

  • ChatMemberControlMixin: getManagedBotToken, replaceManagedBotToken

  • PollAnswer: optionPersistentIds

  • PollOption: persistentId, addedByUser, addedByChat, additionDate

  • Poll: allowsRevoting, description, descriptionEntities; correctOptionId -> correctOptionIds

  • Message: replyToPollOptionId, managedBotCreated, pollOptionAdded, pollOptionDeleted

  • User: canManageBots()

  • New structures: ManagedBotCreated, ManagedBotUpdated, PollOptionAdded, PollOptionDeleted

feat: add Bot API 9.6 support- New contexts: managed_bot, managed_bot_created, poll_option_added, poll_option_deleted

and add a biome-ignore-all pragma to prevent future reordering.

initialization' in dist/index.cjs. Restore the original hand-crafted order

resolution at bundle time, causing 'Cannot access PinsMixin before

fix: restore mixins/index.ts export order to avoid runtime ReferenceErrorBiome auto-sorted exports alphabetically, which broke circular dependency
Full Changelog: v0.5.1...v0.6.0

v0.5.1

Choose a tag to compare

@github-actions github-actions released this 08 Apr 19:11
ea26290
  1. Context.is() type guard - used for runtime type narrowing

  2. GetDerives type - used in ContextType definition

__Derives property becomes 'any', causing type information loss in:

When Bot generic parameter is AnyBot (Bot<any, any, any>), the

fix: prevent type collapse when using AnyBot in type guardsFixes type narrowing for Composer and other contexts using AnyBot.

Merge pull request #3 from ttempaa/fix/anybot-type-narrowingFix type narrowing for AnyBot contexts

command and message handlers.

isChannel() previously narrowed ctx to never on Composer/Bot

gramiojs/gramio#28ctx.isPM(), isGroup(), isSupergroup(),

chore: bump version to 0.5.1Releases the AnyBot type narrowing fix from #3 which resolves

the publish workflow doesn't fail on the TS 5.5+ deprecation warning.

utils, etc.). Add ignoreDeprecations: "5.0" so tsc --noEmit in

chore: silence baseUrl deprecation in tsconfigbaseUrl is required by bare imports in src/ (structures/gift,

installed version.

ignoreDeprecations value mismatch — bunx pins to the locally

version than declared in package.json (^5.9.3), causing the

ci: use bunx tsc to pin TypeScript to local node_modules versionBare tsc in PATH on CI was resolving to a different TypeScript

to ~/.npmrc explicitly ensures non-interactive publish works.

back to browser-based interactive authentication. Writing the token

ci: write .npmrc with auth token before bun publishbun publish was not reading NPM_CONFIG_TOKEN env var and falling

Revert "ci: write .npmrc with auth token before bun publish"This reverts commit 980b879.

What's Changed

  • Fix type narrowing for AnyBot contexts by @ttempaa in #3

New Contributors

Full Changelog: v0.5.0...v0.5.1

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 01 Mar 11:13

feat: add Bot API 9.5 support for member tags and date_time entitiesAdd setChatMemberTag method to ChatMemberControlMixin. Extend ChatAdministratorRights with canManageTags permission. Add tag, canEditTag, and canManageTags fields to ChatMember. Add canEditTag to ChatPermissions. Add unixTime and dateTimeFormat fields to MessageEntity for date_time entity type. Add senderTag field to Message. Update @gramio/types to 9.5.0 and README.md Bot API version badge to 9.5. Add sync-gramio-types skill documentation

chore: bump version to 0.5.0 and update package metadataUpdate copyright year to 2026 in LICENSE. Add readme, homepage, and repository fields to package.json. Fix isTopicMessage return type to always return boolean instead of boolean | undefined.
Full Changelog: v0.4.0...v0.5.0

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 14 Feb 17:21

chore: add CLAUDE.md documentation for AI-assisted development

docs: expand CLAUDE.md with detailed @gramio/types sync workflow

feat: add support for 9.2 Bot API suggested posts and direct messages featuresAdd contexts, structures, and mappings for suggested post lifecycle events (approved, approval_failed, declined, paid, refunded). Implement DirectMessagesTopic structure and add direct messages support to Chat and ChatFullInfo. Extend ChatAdministratorRights and ChatMember with canManageDirectMessages permission. Add publisherChat field to Gift and UniqueGift structures, suggestedPostInfo and directMessagesTopic to Message, and re

feat: add GiftUpgradeSentContext for Bot API 9.3 gift upgrade service messagesAdd GiftUpgradeSentContext to handle service messages about gift upgrades purchased after the gift was sent. Implement context with properties for gift info, owned gift ID, star counts, upgrade capability, message text/entities, privacy settings, and unique gift number. Add sendMessageDraft method to SendMixin. Update README.md Bot API version badge to 9.3. Fix formatting in GiveawayCreatedContext and PaidMediaPurchasedContext.

feat: add streamMessage method for live-typing message drafts with automatic finalizationAdd streamMessage to SendMixin for streaming text chunks to chat with live typing previews via sendMessageDraft and automatic finalization via sendMessage when 4096-char segments complete. Accepts Iterable/AsyncIterable of MessageDraftPiece (strings or objects with text/entities). Auto-forwards threadId and businessConnectionId. Add MessageDraftPiece and StreamMessageOptions types with support for draft ID

chore: update @gramio/types to 9.4.0 and add Bot API 9.4 supportAdd ChatOwnerLeftContext and ChatOwnerChangedContext for service messages about chat ownership changes. Add VideoQuality structure for video quality variants. Extend User with allowsUsersToCreateTopics field, ChatFullInfo with firstProfileAudio, UniqueGiftModel with rarity field, and UniqueGift with isBurned flag. Add UserProfileAudios structure. Update README.md Bot API version badge to 9.4.

chore: update dependencies and bump version to 0.4.0Update @biomejs/biome to 2.3.15, @types/bun to 1.3.9, pkgroll to 2.25.2, tsup to 8.5.1, and typescript to 5.9.3. Remove organizeImports config from biome.json as it's enabled by default in newer versions.
Full Changelog: v0.3.1...v0.4.0

v0.3.1

Choose a tag to compare

@github-actions github-actions released this 01 Feb 13:24
57d943f

feat: provide chat id in callback query context

Merge pull request #2 from n08i40k/mainfeat: provide chat id in callback query context

chore: bump

chore: update @gramio/types to 9.3.0 and adapt UniqueGiftInfo to new resale fields

What's Changed

  • feat: provide chat id in callback query context by @n08i40k in #2

New Contributors

Full Changelog: v0.3.0...v0.3.1

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 11 Jul 23:43
c302061

feat: updates for 9.1 Bot API

chore: bump

chore: missing 9.1

Full Changelog: v0.2.5...v0.3.0