Skip to content

Conversation

@ArnabXD
Copy link
Contributor

@ArnabXD ArnabXD commented Jul 22, 2025

Issue :

the latest version of @mtkruto/parse is not compatible with the latest @mtkruto/mtkruto, causing ts issues

import { Client, Context } from "@mtkruto/mtkruto";
import { replyFmt, ReplyFmt } from "@mtkruto/parse";

const client = new Client<Context & ReplyFmt>({
  apiId: Number(prompt("API ID:")),
  apiHash: prompt("API hash:")!,
});

client.use(replyFmt)
Argument of type 'MiddlewareFn<Context & ReplyFmt>' is not assignable to parameter of type 'Middleware<Context & ReplyFmt & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & ... 24 more ... & UpdateLinkPreview>>'.
  Type 'MiddlewareFn<Context & ReplyFmt>' is not assignable to type 'MiddlewareFn<Context & ReplyFmt & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & ... 24 more ... & UpdateLinkPreview>>'.
    Types of parameters 'ctx' and 'ctx' are incompatible.
      Type 'Context & ReplyFmt & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & ... 24 more ... & UpdateLinkPreview>' is not assignable to type 'Context & ReplyFmt'.
        Type 'Context & ReplyFmt & Partial<UpdateConnectionState & UpdateAuthorizationState & UpdateNewMessage & ... 24 more ... & UpdateLinkPreview>' is not assignable to type 'Context'.
          Types of property 'client' are incompatible.
            Type 'import("https://jsr.io/@mtkruto/mtkruto/0.67.1/client/5_client").Client<import("https://jsr.io/@mtkruto/mtkruto/0.67.1/client/5_client").Context>' is not assignable to type 'import("https://jsr.io/@mtkruto/mtkruto/0.6.3/client/5_client").Client<import("https://jsr.io/@mtkruto/mtkruto/0.6.3/client/5_client").Context>'.
              Property '#client' in type 'Client' refers to a different member that cannot be accessed from within type 'Client'.deno-ts(2345)

Syncing the @mtkruto/mtkruto version fixes the issue.

@ArnabXD ArnabXD changed the title chore: bump mtkruto version and ts-morph to latest fix: ts issues while using parse with latest mtkruto Jul 22, 2025
@rojvv rojvv changed the title fix: ts issues while using parse with latest mtkruto Fix type errors with latest MTKruto Jul 22, 2025
@rojvv rojvv merged commit c217154 into MTKruto:main Jul 22, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants