-
Notifications
You must be signed in to change notification settings - Fork 65
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
add typescript type declarations #60
Open
acran
wants to merge
7
commits into
mast:master
Choose a base branch
from
AcademyConsult:typings
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
although already used when setting up webhooks, the parameters allowed_updates and max_connections were actually never passed to the api.
The certificate and privateKey are required values since they're used unconditionally when using webhooks. The url and host are optional but at least one of them has to be defined and using '0.0.0.0' as a default value for host would cause an invalid url to be autogenerated otherwise.
reply_markup actually only accepts JSON-serialized objects. For user convenience simply JSON.stringify() passed objects on demand.
This adds type declarations to the library making it fully typed for TypeScript support
The request data was actually serialized as multipart/form-data instead of a JSON body. Passing JSON data with a boolean value then throw an error while serializing: bot.sendMessage({ chat_id: user.id, text: text, disable_web_page_preview: false, // throws an error }); // > TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string or Buffer. Received type boolean
acran
force-pushed
the
typings
branch
2 times, most recently
from
February 16, 2019 13:59
525cc20
to
b09a7e6
Compare
acran
added a commit
to acran/AcademyConsultBot
that referenced
this pull request
Feb 16, 2019
Die neuste Version enthält die nötigen type decalarations mit den type annotations für alle Funktionen der Library. siehe mast/telegram-bot-api#60
@mast: shamelessly pushing this PR again |
@mast Are you planning to add TypeScript support for this package? :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change set adds type declarations to allow using this package in TypeScript projects while having full support for autocompletion and integrated API documentation.
It also fixes some bugs I discovered along the way, mostly missing parameters/documentation in code comments.