Scenes now live in their own namespace called Scenes
Allow cancelling requests via AbortController
Add attachmentAgent option to provide an agent that is used for fetching files from the web before they are sent to Telegram (previously done through the same agent as used to connect to Telegram itself)
Apart from updating Telegraf to full Telegram Bot API 5.0 support, the most significant improvement is that we now have a code base that is written 100 % in TypeScript, which more or less required a rewrite of the complete library.
Previously, the library was written in JavaScript and had a few type annotations to the side, but they were often incorrect or missing.
In working on the 4.0 release, we created type coverage of the complete Telegram Bot API.
The benefit is that your editor can now autocomplete accross every single field in every single method or entity.
Those who ever tried it out can confirm that this improves the development experience by an order of magnitude.
Note that this update brings 9 months worth of improvements, so while we did our best to summarise all important changes, it's possible that we forgot some!
Remove Composer.catchAll and Composer.safePassThru
Catch errors of both branches of Composer.fork
Listen to forwards using on('forward_date'), no longer on('forward')
Context
Make ctx.botInfo required, i.e. is is always available
Make ctx.statereadonly
Add ctx.senderChat, ctx.unpinAllChatMessages, and ctx.copyMessage
ctx.deleteMessage no longer works for edited messages, channel posts, or edited channel posts
Remove ctx.updateSubTypes
Extra
Extra is removed entirely, see #1076.
You can now just specify any options directly, without having to create an Extra instance before.
Markup
Markup is largely reworked.
Please check out the new documentation about Markup, this is much easier than trying to understand the differences between the old and the new version.
The TypeScript autocompletion should help you a lot in case you have to change something about your code.
The main thing to watch out for is that all buttons (keyboard buttons and inline buttons) are now created via Markup.button.url and its siblings, no longer via Markup.urlButton.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps telegraf from 3.38.0 to 4.0.2.
Release notes
Sourced from telegraf's releases.
... (truncated)
Commits
f70c41c
4.0.2e60d242
Rewrite docs (#1305)bf5a787
Fix #13202bb7e62
Fix #13144fce2d5
Removehusky
, see #12400a059ad
Fix wizard example and add example of custom scene property (#1307)a012854
Fix fastify-webhook-bot example (#1311)2fcffb2
RemoveMessageSubTypes
(#1300)a57dbcd
ExportTelegramError
; fixes #1289740757c
Tighten eslintDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)