Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect return value type for sendMessage #736

Open
PurpleTape opened this issue Oct 20, 2024 · 0 comments
Open

Incorrect return value type for sendMessage #736

PurpleTape opened this issue Oct 20, 2024 · 0 comments

Comments

@PurpleTape
Copy link

Hello!

For the TelegramClient.sendMessage message sending function, the return type is specified as Promise<Api.Message>. Despite this, an array containing one element of the message object is returned: Promise<[Api.Message]>.

Thus, the description of the type of the returned value does not actually correspond to the returned value

Example:

const client = new TelegramClient(/*...*/);
const result = client.sendMessage(/*...*/);

console.log(Array.isArray(result)); // should be false but true

Version: "telegram": "^2.25.15"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant