[Snyk] Upgrade telegraf from 4.12.2 to 4.13.1 #77
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 PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade telegraf from 4.12.2 to 4.13.1.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: telegraf
👞👟🥾 Multi-session and custom session property
👞👟🥾 Multi-session and custom session property
This update brings us the ability to have multiple session keys. This is achieved simply by passing
property
in session options:bot.use(session({
property: "chatSession",
getSessionKey: ctx => ctx.chat && String(ctx.chat.id),
store: Redis({ url: "redis://127.0.0.1:6379" });
})); // creates ctx.chatSession backed by a Redis store
Thanks to @ Evertt for making the case for this feature.
📨 Command parser
📨 Command parser
It's an often requested feature to be able to parse command arguments.
As of this release,
ctx.command
,ctx.payload
, andctx.args
are available for this usecase. It's only available inbot.command
handlers.ctx.command
is the matched command (even if you used RegExp), and it does not include the botname if it was included in the user's command.ctx.payload
is the unparsed text part excluding the command.ctx.args
is a parsed list of arguments passed to it. Have a look at the example:bot.command("warn", async ctx => {
ctx.args; // [ "--delete", "Offtopic chat" ]
ctx.command; // "warn"
ctx.payload; // "--delete "Offtopic chat""
});
ctx.args
is still considered unstable, and the parser is subject to fine-tuning and improvements based on user feedback.The more generic
ctx.payload
for all commands causesctx.startPayload
inbot.start
to be redundant, and hence the latter is now deprecated.You can also play with this feature by importing the parser directly:
// do not include the /command part!
argsParser('--delete "Offtopic chat"'); // [ "--delete", "Offtopic chat" ]
New types package
New types package
We have now forked Typegram to maintain types more in line with Telegraf.
Most of you will be unaffected, because Telegraf just switched its internal import to
@ telegraf/types
. If you have a direct dependency ontypegram
for any reason, you might want to consider switching that over.typegram
will continue to be maintained as well.Remember that all of these types are available through Telegraf without installing any additional library:
This new package is
@ telegraf/types
, available on Deno/x and npm with our ongoing effort to make Telegraf more platform independent.⬆️ Bot API 6.6, 6.7, and 6.8 support
⬆️ Bot API 6.6, 6.7, and 6.8 support
We're a little delayed this time, but we've got them all ready for you now:
API 6.6
setMyDescription
,getMyDescription
,setMyShortDescription
,getMyShortDescription
,setCustomEmojiStickerSetThumbnail
,setStickerSetTitle
,deleteStickerSet
,setStickerEmojiList
,setStickerKeywords
,setStickerMaskPosition
setStickerSetThumb
->setStickerSetThumbnail
API 6.7
setMyName
,getMyName
API 6.8
unpinAllGeneralForumTopicMessages
More exciting updates coming soon!
Commit messages
Package name: telegraf
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs