Skip to content

Maximum description length for image #15

@m0rg0t

Description

@m0rg0t

Hi! 👋

Firstly, thanks for your work on this project! 🙂

In documentation https://yandex.ru/dev/dialogs/alice/doc/response-card-bigimage.html at current moment max description value is 1024 symbols, and in current code description limited by 256 symbols.

I used patch-package to patch alice-renderer@1.5.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/alice-renderer/src/image.js b/node_modules/alice-renderer/src/image.js
index b64b7e8..c1f7883 100644
--- a/node_modules/alice-renderer/src/image.js
+++ b/node_modules/alice-renderer/src/image.js
@@ -4,7 +4,7 @@
 const {truncate} = require('./utils');
 
 const MAX_TITLE_LENGTH = 128;
-const MAX_DESCRIPTION_LENGTH = 256;
+const MAX_DESCRIPTION_LENGTH = 1024;
 
 // Use symbols to ignore these keys in JSON.stringify
 const hasInitialTitle = Symbol('hasInitialTitle');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions