telegraf / telegraf

Modern Telegram Bot Framework for Node.js
https://telegraf.js.org
MIT License
8.29k stars 932 forks source link

InputMedia* in typegram is different from same type in telegraf/src/core/types/typegram #1568

Closed AuroraDysis closed 2 years ago

AuroraDysis commented 2 years ago

Context

for example, in telegraf/src/core/types/typegram

type InputMediaDocument = {
    type: "document";
    media: string | InputFile;
    thumb?: InputFile | undefined;
    caption?: string | undefined;
    parse_mode?: ParseMode | undefined;
    caption_entities?: MessageEntity[] | undefined;
    disable_content_type_detection?: boolean | undefined;
}

but in typegram, it looks like

type InputMediaDocument = {
    type: "document";
    media: string;
    thumb?: undefined;
    caption?: string | undefined;
    parse_mode?: ParseMode | undefined;
    caption_entities?: MessageEntity[] | undefined;
    disable_content_type_detection?: boolean | undefined;
}

At least the following types have the same problem:

Expected Behavior

same types should have the same definitions.

Current Behavior

same types have different definitions.

MKRhere commented 2 years ago

Would this be solved for you by exposing the types from Telegraf?

Edit: typegram is now available to be imported as telegraf/types.