node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

SetWebHookOptions missing ip_address

Open mynote opened this issue 2 years ago • 2 comments

It seems like that SetWebHookOptions is missing the flag ip_address which might be important since Telegram doesnt update DNS very often.

    interface SetWebHookOptions {
        url?: string | undefined;
        certificate?: string | Stream | undefined;
        max_connections?: number | undefined;
        allowed_updates?: string[] | undefined;
        secret_token?: string | undefined;
    }

should be

    interface SetWebHookOptions {
        url?: string | undefined;
        certificate?: string | Stream | undefined;
        max_connections?: number | undefined;
        allowed_updates?: string[] | undefined;
        secret_token?: string | undefined;
       ip_address?:string | undefined
    }
 

mynote avatar Jul 09 '24 16:07 mynote

hii @mynote is this issue still open, can i work on it?

sainikhil-0521 avatar Nov 25 '24 04:11 sainikhil-0521

This is supported in the current TypeScript rewrite (v1.1.0+). setWebhook's options are typed as Omit<SetWebhookParams, "url">, and the generated SetWebhookParams includes ip_address:

bot.setWebhook(url, { ip_address: "1.2.3.4", max_connections: 40 });

The gap you hit was in the separate @types/node-telegram-bot-api (DefinitelyTyped) package used with the old 0.x release. The rewritten library ships its own types generated from the Bot API docs, so ip_address (and the rest of setWebhook's documented params) are present. Closing as resolved.

yagop avatar Jun 14 '26 14:06 yagop