grammyjs / parse-mode Goto Github PK
View Code? Open in Web Editor NEWSafely format messages and keep their source code maintainable.
License: MIT License
Safely format messages and keep their source code maintainable.
License: MIT License
Here is my code:
await ctx.editMessageMedia(
{
media: new InputFile('file-location.png'),
type: 'photo',
caption: "<code>Test code here</code>",
},
{ message_id: messageId },
);
It looks default parse-mode does not seem to work for this. I haven't tested with other edit method but it's not working with editMessageMedia for me.
It works fine if I set parse_mode explicitly.
await ctx.editMessageMedia(
{
media: new InputFile('file-location.png'),
type: 'photo',
caption: "<code>Test code here</code>",
parse_mode: 'HTML'
},
{ message_id: messageId },
);
Currently, there are some limitations when using fmt with media messages in grammY:
It would be great to have a consistent way to use fmt for formatting text across all message types, including media captions. This would make the migration process from Telegraf to grammY smoother and provide a more intuitive formatting experience for developers.
Kindly are there any plans to add support for using fmt in media captions? If not, are there any recommended tricky workarounds?
Perhaps we should add some JSDoc in order to have some actual content on https://doc.deno.land/https://deno.land/x/grammy_parse_mode/mod.ts?
Would be cool to have something like https://github.com/EdJoPaTo/telegram-format#escapetext built-in.
Should also support tagged templates (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates) so that we can do
ctx.escape`<b>Hello ${username}!</b>`
Requested by @KnorpelSenf (that's me) in https://t.me/grammyjs/26853
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.