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

Format messages properly for telegram in the tg bot starter kit. #177

Open
The-x-35 opened this issue Jan 9, 2025 · 4 comments
Open

Format messages properly for telegram in the tg bot starter kit. #177

The-x-35 opened this issue Jan 9, 2025 · 4 comments
Labels
good first issue Good for newcomers

Comments

@The-x-35
Copy link
Contributor

The-x-35 commented Jan 9, 2025

Is your feature request related to a problem? Please describe.
The telegram bot sends a markdown file directly to the chat from the agent kit, but we need to have styles the way telegram has it.

Describe the solution you'd like
You can use this package
https://www.npmjs.com/package/telegramify-markdown

Describe alternatives you've considered
NA

Additional context
NA

@thearyanag thearyanag added the good first issue Good for newcomers label Jan 9, 2025
@user-64bit
Copy link

Hello @The-x-35

I did try to implement this locally using telegramify-markdown as you suggested but the reply content is being changed even after using this package.
image

code changes:
image

can you guide me if i'm doing anything wrong? 😅
cc: @thearyanag

@The-x-35
Copy link
Contributor Author

@user-64bit Umm looks fine, do some debugging, try with sample md data and see how it executes in a normal ts file.

@user-64bit
Copy link

Okay 👍

I got the issue. the problem is that, the prompt is generating markdown something like => ``` {output} ```
but the telegramifyMarkdown can't affect the text inside it because telegram take it as code block and there won't be any bold or italic in code block.

even if telegramifyMarkdown covernts # to ** it won't affect in code block. and there are certain things which doesn't work too. like the library doesn't convert [link](https://google.com) to telegram compatible link.

I think this(as shown in attached image) is the closest we can get markdown data. and for that we don't need to use telegramifyMarkdown.

So what do you think? 🤔 @The-x-35
image

CC: @thearyanag

@The-x-35
Copy link
Contributor Author

@user-64bit i dont think this is what we want.
we gave that node package as an example, if you can, write the thing to improve the output's styles by writing a function yourself.
or maybe find a workaround using anything else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants