Skip to content

Plugin Ideas #110

@KnorpelSenf

Description

@KnorpelSenf

Here is a list of ideas that could be turned into plugins.

You can suggest new ideas in the comments or in the group chat, and we may add them here. Once someone publishes an official plugin in version 1.0, we will remove the idea from this list. You can also decide to start working on a third-party plugin. In that case, you also need to link it on https://grammy.dev. You should be able to demonstrate that your plugin is working.

grammy-dedupe

Deduplicates updates delivered via webhooks. If users follow https://grammy.dev/guide/deployment-types.html#how-to-use-webhooks then no duplicates should appear, but advanced use cases may still require this.

  • Maybe based on Redis, but also supports storing in RAM?
  • Store lower bound of update identifiers
  • Store set of currently handled updates larger than that with their promises
  • New update: if it is lower than bound: drop, if it is in set: drop but await stored promise, else store next()'s promise behind identifier

grammy-bulk

Helps sending messages to many people, or performing other bulk operations.

  • Must survive crashes and restarts while sending
  • Must stay without flood limits at all times, maybe even dynamically adjusting to the bot's organic load

grammy-telegraph

Helps sending long messages.

  • Covers the Telegraph API
  • Allows sending long text messages by automatically creating an article from them, and sending the link instead

awilix-grammy

Helps creating complex code bases.

grammy-test

Helps writing tests for bots.

UI components based on web apps

grammy-telemetry

  • collects basic usage data about the bot
  • exports markers that can be installed in the middleware tree to easily track feature usage
  • supports custom telemetry events though the context object
  • integrates with other services like Prometheus or InfluxDB
  • is able to use storage adapters for persistence

grammy-util

grammy-progress

  • lets you display the progress of something inside a message
  • as a core primitive, has a transformer that allows you to edit a message at any rate, and it will debounce the calls internally upon rate limits, so that only the most recent edit is performed
  • performs edits as fast as possible and as slow as necessary
  • works on a chat_id/message_id basis
  • supports all methods with this property (editMessageText, editMessageCaption, editMessageMedia, editMessageLiveLocation, editMessageReplyMarkup)
  • provides utilities for rendering progress bars, so you can do
    const progress = ctx.progress(chat_id, message_id, "style")
    await progress.set(0.3) // 30 %

grammy-replies

  • improves support for replies
  • helps with support for the following things:
    • Which entities does the message that is being replied to have?
    • Does the message that is being replied to have a /start command?
    • Is the message that is being replied to an image?
    • Does the message that is being replied to have a caption that matches a regular expression?

grammy-fsm

  • FSM code is hard to read
  • Ideally, we want to view a nice flow chart diagram
  • Diagrams sucks to create with a diagram editor
  • We need to solve the problem of writing code and reading diagrams
    • Create a state machine library
    • Create a VS Code extension that parses TS files that import this library
    • Take the code behind https://rtsys.informatik.uni-kiel.de/elklive/elkgraph.html
    • Put it into the extension, and provide a live preview of the FSM that updates in real time while people type their state machine
  • create a grammY plugin that can import such FSM code, and translate it into a conversational interface library

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions