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

Default parse-mode does not work for ctx.editMessageMedia #7

Closed
binamralamsal opened this issue May 5, 2022 · 3 comments
Closed

Default parse-mode does not work for ctx.editMessageMedia #7

binamralamsal opened this issue May 5, 2022 · 3 comments
Labels
hacktoberfest Good issue for hacktoberfest contributors :)
Projects

Comments

@binamralamsal
Copy link

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 },
);
@KnightNiwrem
Copy link
Collaborator

KnightNiwrem commented May 6, 2022

This was (is?) somewhat intentional. The original purpose of the plugin was to ease migration from telegraf to grammy, and since there is no such support for edit in telegraf, there was no need to add it here either.

PQ to add to edit methods are welcomed, but I'd recommend adding code so that fmt can be used here instead.

@KnorpelSenf KnorpelSenf added this to To do in Coding May 19, 2022
@roziscoding roziscoding added the hacktoberfest Good issue for hacktoberfest contributors :) label Oct 8, 2022
@KnorpelSenf
Copy link
Member

Can this be closed since #14 is merged now?

@binamralamsal
Copy link
Author

That's great to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Good issue for hacktoberfest contributors :)
Projects
Status: Done
Development

No branches or pull requests

4 participants