EdJoPaTo / grammy-inline-menu

Inline Menus for Telegram made simple. Successor of telegraf-inline-menu.
MIT License
357 stars 44 forks source link

feat(body): add entities formatting support #250

Closed BubuMVX closed 1 month ago

BubuMVX commented 1 month ago

Hi !

This pull request adds the support to entities on text messages sent. This allows:

Example

import { bold, fmt, underline } from '@grammyjs/parse-mode';
import { MenuTemplate } from 'grammy-inline-menu';

const menu = new MenuTemplate<MyContext>(async () => {
    const message = fmt`${bold(underline('Hello world!'))}`

    return {
        text: message.text,
        entities: message.entities,
    };
});
BubuMVX commented 1 month ago

Hi @EdJoPaTo !

Sorry, but I struggle to fix this @typescript-eslint/prefer-readonly-parameter-types error. I tried Readonly<>, ReadonlyArray<> and stuff like that, without success.

Can you help me or point me in the right direction? Thanks.

BubuMVX commented 1 month ago

Tests added, I hope they're in line with your standards.

BubuMVX commented 1 month ago

Thanks a lot for your feedback, I updated the documentation

BubuMVX commented 1 month ago

Wanted to hit the approve and merge, but I have more nitpicks… Sorry for that! 😇

Hahaha! Don't hesitate! Corrections added

EdJoPaTo commented 1 month ago

Thank you for the addition!

It's released as 9.1.0 :sparkles:

BubuMVX commented 1 month ago

Nice! Thank you so much for your library. It's one of the best for Telegram bots I've encountered so far.