I have constraint type mismatch on grammy 1.15.3 and menu 1.1.3 with sessions
Example:
import { Bot, session, type SessionFlavor } from "https://deno.land/x/grammy@v1.15.3/mod.ts";
import { Menu } from "https://deno.land/x/grammy_menu@v1.1.3/mod.ts";
type SessionData = {
message_to_delete: number;
};
type SessionContext = Context & SessionFlavor<SessionData>;
const bot = new Bot<SessionContext>("TOKEN");
bot.use(session({
initial: () => ({
message_to_delete: 0,
})
}));
const menu = new Menu<SessionContext>("my-menu") // error on <SessionContext>
.text("one").row()
.text("two").row();
bot.use(menu)
bot.start()
Error message:
Type 'SessionContext' does not satisfy the constraint 'Context'.
The types of 'update.my_chat_member' are incompatible between these types.
Type 'import("https://deno.land/x/grammy_types@v3.0.3/manage").ChatMemberUpdated | undefined' is not assignable to type 'import("https://esm.sh/v99/@grammyjs/types@2.10.0/manage").ChatMemberUpdated | undefined'.
Type 'import("https://deno.land/x/grammy_types@v3.0.3/manage").ChatMemberUpdated' is not assignable to type 'import("https://esm.sh/v99/@grammyjs/types@2.10.0/manage").ChatMemberUpdated'.
Types of property 'old_chat_member' are incompatible.
Type 'import("https://deno.land/x/grammy_types@v3.0.3/manage").ChatMember' is not assignable to type 'import("https://esm.sh/v99/@grammyjs/types@2.10.0/manage").ChatMember'.
Type 'ChatMemberRestricted' is not assignable to type 'ChatMember'.
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/v99/@grammyjs/types@2.10.0/manage").ChatMemberRestricted'.
I have constraint type mismatch on grammy 1.15.3 and menu 1.1.3 with sessions
Example:
Error message: