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

[Snyk] Upgrade telegraf from 4.12.2 to 4.13.1 #77

Merged
merged 1 commit into from
Sep 23, 2023

Conversation

jlenon7
Copy link
Member

@jlenon7 jlenon7 commented Sep 23, 2023

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.


  • The recommended version is 3 versions ahead of your current version.
  • The recommended version was released 21 days ago, on 2023-09-02.
Release notes
Package name: telegraf
  • 4.13.1 - 2023-09-02
    • Fix README to mention API 6.8
  • 4.13.0 - 2023-09-02
    👞👟🥾 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()); // creates ctx.session backed by an in-memory store

    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, and ctx.args are available for this usecase. It's only available in bot.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:

    // User sends /warn --delete "Offtopic chat"

    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 causes ctx.startPayload in bot.start to be redundant, and hence the latter is now deprecated.

    bot.start(ctx => {
    - console.log(ctx.startPayload);
    + console.log(ctx.payload);
    });

    You can also play with this feature by importing the parser directly:

    import { argsParser } from "telegraf/utils";

    // 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 on typegram 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:

    import type { Update } from "telegraf/types";

    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

    • New methods setMyDescription, getMyDescription, setMyShortDescription, getMyShortDescription, setCustomEmojiStickerSetThumbnail, setStickerSetTitle, deleteStickerSet, setStickerEmojiList, setStickerKeywords, setStickerMaskPosition
    • Renamed setStickerSetThumb -> setStickerSetThumbnail
    • Renamed thumb to thumbnail throughout the API
    • Various other minor changes, refer to Bot API 6.6

    API 6.7

    • New methods setMyName, getMyName
    • Various other minor changes, refer to Bot API 6.7

    API 6.8

    • New methods unpinAllGeneralForumTopicMessages
    • Various other minor changes, refer to Bot API 6.8

    More exciting updates coming soon!

  • 4.12.3-canary.1 - 2023-04-01
  • 4.12.2 - 2023-03-09
    • Fix: session reference counter had defaulted to 0, therefore permanently being cached and never being cleaned up — this has been fixed.
from telegraf GitHub release notes
Commit messages
Package name: telegraf
  • 0ce050b ver: v4.13.1
  • 974aa45 chore: update README to 6.8
  • c38d89b ver: v4.13.0
  • e5c6f78 chore: update release-notes
  • e4c0383 chore: move util -> core/helpers
  • 779e80e chore: comply with our Prettier overlords
  • 684c51a chore: expose telegraf/utils
  • 612be8f feat: ctx.payload for all commands
  • b164cd9 chore: rename argParser -> argsParser
  • 1d2a054 fix: argParser gets incorrect offset
  • a091176 feat: ctx.command and fix argParser call
  • be124d9 fix: various internal type issues in Composer
  • ef91be0 chore: update packages
  • b62a4f7 chore: rename vars for consistency
  • 95ca7aa feat: ctx.args for bot.command
  • eb2d1fd merge: #1862 from hypernova7/telegram-v6.6-and-v6.7
  • 703a4fb merge: #1870 from feat/custom-sessions
  • 71e195f feat: API 6.8
  • 826a5fa fix: WrapCaption mustn't add message_thread_id
  • 890e082 feat: missing API 6.7 APIs
  • 09cc2cb feat: missing API 6.6 APIs
  • 58a8113 ci: stop testing Node 14, do Node 20 instead
  • 1727dd5 ci: stop testing Node 12, do Node 18 instead
  • 1e57606 chore: update typescript

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

@jlenon7 jlenon7 merged commit a29a3cc into develop Sep 23, 2023
4 checks passed
@jlenon7 jlenon7 deleted the snyk-upgrade-da8b6441d0405ec1825939fa28b2b101 branch September 23, 2023 19:34
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

Successfully merging this pull request may close these issues.

2 participants