@@ -13,15 +13,18 @@ The plugin is compatible with both Deno and Node.js, and is designed to work as
13
13
14
14
``` ts
15
15
import { Bot } from " grammy" ;
16
- import { fmt , b , u } from " @grammyjs/parse-mode" ;
16
+ import { b , fmt , u } from " @grammyjs/parse-mode" ;
17
17
18
18
const bot = new Bot (" " );
19
19
20
20
bot .command (" demo" , async (ctx ) => {
21
- // Using return values of fmt
22
- const combined = fmt ` ${b }bolded${b } ${ctx .msg .text } ${u }underlined${u } ` ;
23
- await ctx .reply (combined .text , { entities: combined .entities });
24
- await ctx .replyWithPhoto (photo , { caption: combined .caption , caption_entities: combined .caption_entities });
21
+ // Using return values of fmt
22
+ const combined = fmt ` ${b }bolded${b } ${ctx .msg .text } ${u }underlined${u } ` ;
23
+ await ctx .reply (combined .text , { entities: combined .entities });
24
+ await ctx .replyWithPhoto (photo , {
25
+ caption: combined .caption ,
26
+ caption_entities: combined .caption_entities ,
27
+ });
25
28
});
26
29
27
30
bot .start ();
@@ -36,10 +39,15 @@ import { FormattedString } from "@grammyjs/parse-mode";
36
39
const bot = new Bot (" " );
37
40
38
41
bot .command (" demo" , async (ctx ) => {
39
- // Using return values of Fmt
40
- const combined = FormattedString .b (" bolded" ).plain (ctx .msg .text ).u (" underlined" );
41
- await ctx .reply (combined .text , { entities: combined .entities });
42
- await ctx .replyWithPhoto (photo , { caption: combined .caption , caption_entities: combined .caption_entities });
42
+ // Using return values of Fmt
43
+ const combined = FormattedString .b (" bolded" ).plain (ctx .msg .text ).u (
44
+ " underlined" ,
45
+ );
46
+ await ctx .reply (combined .text , { entities: combined .entities });
47
+ await ctx .replyWithPhoto (photo , {
48
+ caption: combined .caption ,
49
+ caption_entities: combined .caption_entities ,
50
+ });
43
51
});
44
52
45
53
bot .start ();
0 commit comments