Skip to content

Commit

Permalink
chore: bump
Browse files Browse the repository at this point in the history
  • Loading branch information
kravetsone committed May 20, 2024
1 parent 95efe65 commit ea0e1c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gramio/format",
"version": "0.1.1",
"version": "0.1.2",
"description": "Library for formatting text for Telegram Bot API",
"homepage": "https://gramio.dev/formatting.html",
"repository": {
Expand Down
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,18 @@ export type Stringable =

/** Class-helper for work with formattable [entities](https://core.telegram.org/bots/api#messageentity) */
export class FormattableString {
/** Text of FormattableString (auto covert to it if entities is unsupported)*/
text: string;
/** Entities of FormattableString */
entities: TelegramMessageEntity[];

/** Create new FormattableString */
constructor(text: string, entities: TelegramMessageEntity[]) {
this.text = text;
this.entities = entities;
}

/** Create new FormattableString */
static from(text: string, entities: TelegramMessageEntity[]) {
return new FormattableString(text, entities);
}
Expand Down

0 comments on commit ea0e1c2

Please sign in to comment.