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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum description length for image #15

Open
m0rg0t opened this issue Apr 2, 2023 · 1 comment
Open

Maximum description length for image #15

m0rg0t opened this issue Apr 2, 2023 · 1 comment

Comments

@m0rg0t
Copy link

m0rg0t commented Apr 2, 2023

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');
@vitalets
Copy link
Owner

vitalets commented Apr 3, 2023

Hi! Good point. Could you create pull request for that?

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

No branches or pull requests

2 participants