Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#67125 node-telegram-bot-api InviteLink Met…
Browse files Browse the repository at this point in the history
…hods fix by @matvejs16

* node-telegram-bot-api fix

* version change

* version .9999 change

* revokeChatInviteLink fix

* added ts-expect-error to pass ts check

* ts error fix

* formatted fix
  • Loading branch information
matvejs16 committed Oct 20, 2023
1 parent d81f45a commit a2e605c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
20 changes: 12 additions & 8 deletions types/node-telegram-bot-api/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1634,19 +1634,23 @@ declare class TelegramBot extends EventEmitter<

createChatInviteLink(
chatId: TelegramBot.ChatId,
name?: string,
expire_date?: number,
member_limit?: number,
creates_join_request?: boolean,
options?: {
name?: string;
expire_date?: number;
member_limit?: number;
creates_join_request?: boolean;
},
): Promise<TelegramBot.ChatInviteLink>;

editChatInviteLink(
chatId: TelegramBot.ChatId,
inviteLink: string,
name?: string,
expire_date?: number,
member_limit?: number,
creates_join_request?: boolean,
options?: {
name?: string;
expire_date?: number;
member_limit?: number;
creates_join_request?: boolean;
},
): Promise<TelegramBot.ChatInviteLink>;

revokeChatInviteLink(chatId: TelegramBot.ChatId, inviteLink: string): Promise<TelegramBot.ChatInviteLink>;
Expand Down
14 changes: 12 additions & 2 deletions types/node-telegram-bot-api/node-telegram-bot-api-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,18 @@ MyTelegramBot.restrictChatMember(1234, 5678, {
});
MyTelegramBot.promoteChatMember(1234, 5678, { can_change_info: true });
MyTelegramBot.exportChatInviteLink(1234);
MyTelegramBot.createChatInviteLink(1234, "Foo", 1234, 1234, true);
MyTelegramBot.editChatInviteLink(1234, "", "", 1234, 1234, true);
MyTelegramBot.createChatInviteLink(1234, {
name: "Foo",
expire_date: 1234,
member_limit: 1234,
creates_join_request: true,
});
MyTelegramBot.editChatInviteLink(1234, "", {
name: "Foo",
expire_date: 1234,
member_limit: 1234,
creates_join_request: true,
});
MyTelegramBot.revokeChatInviteLink(1234, "");
MyTelegramBot.approveChatJoinRequest(1234, 5678);
MyTelegramBot.approveChatJoinRequest(1234, 5678, {});
Expand Down

0 comments on commit a2e605c

Please sign in to comment.