Skip to content

Instantly share code, notes, and snippets.

@waptik
Created March 24, 2023 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waptik/7b6b0c019d553bb1f2df16c28a49cadd to your computer and use it in GitHub Desktop.
Save waptik/7b6b0c019d553bb1f2df16c28a49cadd to your computer and use it in GitHub Desktop.
type error when using grammy@1.15.3 with current version of gramm_chat_members plugin
When i hover `chatMembers`, i get:
```
Argument of type 'Composer<ChatMembersContext>' is not assignable to parameter of type 'Middleware<GrammyContext>'.
Type 'Composer<ChatMembersContext>' is not assignable to type 'MiddlewareObj<GrammyContext>'.
The types returned by 'middleware()' are incompatible between these types.
Type 'MiddlewareFn<ChatMembersContext>' is not assignable to type 'MiddlewareFn<GrammyContext>'.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type 'GrammyContext' is not assignable to type 'ChatMembersContext'.
Type 'SessionFlavor<GrammySession> & { conversation: ConversationControls; } & SessionFlavor<ConversationSessionData> & ChatMembersFlavor & Context & { ...; }' is not assignable to type 'ChatMembersContext'.
Type 'SessionFlavor<GrammySession> & { conversation: ConversationControls; } & SessionFlavor<ConversationSessionData> & ChatMembersFlavor & Context & { ...; }' is not assignable to type 'Context'.
The types of 'update.message' are incompatible between these types.
Type '(Message & NonChannel) | undefined' is not assignable to type '(Message & New & NonChannel) | undefined'.
Type 'Message & NonChannel' is not assignable to type '(Message & New & NonChannel) | undefined'.
Type 'Message & NonChannel' is not assignable to type 'Message & New & NonChannel'.
Type 'Message & NonChannel' is not assignable to type 'New'.
Types of property 'edit_date' are incompatible.
Type 'number | undefined' is not assignable to type 'undefined'.
Type 'number' is not assignable to type 'undefined'.deno-ts(2345)
````
When i hover `adapter`, i get
```sh
Argument of type 'Composer<ChatMembersContext>' is not assignable to parameter of type 'Middleware<GrammyContext>'.
Type 'Composer<ChatMembersContext>' is not assignable to type 'MiddlewareObj<GrammyContext>'.
The types returned by 'middleware()' are incompatible between these types.
Type 'MiddlewareFn<ChatMembersContext>' is not assignable to type 'MiddlewareFn<GrammyContext>'.
Types of parameters 'ctx' and 'ctx' are incompatible.
Type 'GrammyContext' is not assignable to type 'ChatMembersContext'.
Type 'SessionFlavor<GrammySession> & { conversation: ConversationControls; } & SessionFlavor<ConversationSessionData> & ChatMembersFlavor & Context & { ...; }' is not assignable to type 'ChatMembersContext'.
Type 'SessionFlavor<GrammySession> & { conversation: ConversationControls; } & SessionFlavor<ConversationSessionData> & ChatMembersFlavor & Context & { ...; }' is not assignable to type 'Context'.
The types of 'update.message' are incompatible between these types.
Type '(Message & NonChannel) | undefined' is not assignable to type '(Message & New & NonChannel) | undefined'.
Type 'Message & NonChannel' is not assignable to type '(Message & New & NonChannel) | undefined'.
Type 'Message & NonChannel' is not assignable to type 'Message & New & NonChannel'.
Type 'Message & NonChannel' is not assignable to type 'New'.
Types of property 'edit_date' are incompatible.
Type 'number | undefined' is not assignable to type 'undefined'.
Type 'number' is not assignable to type 'undefined'.deno-ts(2345)
Argument of type 'MemorySessionStorage<ChatMember>' is not assignable to parameter of type 'StorageAdapter<ChatMember>'.
The types returned by 'read(...)' are incompatible between these types.
Type 'ChatMember | undefined' is not assignable to type 'MaybePromise<ChatMember | undefined>'.
Type 'ChatMemberRestricted' is not assignable to type 'MaybePromise<ChatMember | undefined>'.
Property 'can_send_media_messages' is missing in type 'import("https://deno.land/x/grammy_types@v3.0.3/manage").ChatMemberRestricted' but required in type 'import("https://esm.sh/v112/@grammyjs/types@2.11.0/manage").ChatMemberRestricted'.deno-ts(2345)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment