From 3309cc976dedb5fdaaafdd43b322c4f146aef3cb Mon Sep 17 00:00:00 2001 From: KnightNiwrem Date: Sat, 8 Oct 2022 21:50:10 +0800 Subject: [PATCH 01/18] Update Parse Mode plugin docs --- site/docs/plugins/parse-mode.md | 168 +++++++++++++++++++++++--------- 1 file changed, 124 insertions(+), 44 deletions(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index 34d6c05e7..c3d047f15 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -2,33 +2,117 @@ This plugin provides a transformer for setting default `parse_mode`, and a middleware for hydrating `Context` with familiar `reply` variant methods - i.e. `replyWithHTML`, `replyWithMarkdown`, etc. -## Usage +## Usage (Using format) ```ts -import { Bot } from "grammy"; -import { hydrateReply, parseMode } from "@grammyjs/parse-mode"; +import { Bot, Composer, Context } from 'grammy'; +import { bold, fmt, hydrateReply, italic } from '@grammyjs/parse-mode'; -import type { ParseModeContext } from "@grammyjs/parse-mode"; +import type { ParseModeFlavor } from '@grammyjs/parse-mode'; -const bot = new Bot(""); +const bot = new Bot>(''); -// Use the plugin. +// Install format reply variant to ctx +bot.use(hydrateReply); + +bot.command('demo', async ctx => { + await ctx.replyFmt(fmt`${bold('bold!')} +${bold(italic('bitalic!'))} +${bold(fmt`bold ${link('blink', 'example.com')} bold`)}`); + + // fmt can also be called like a regular function + await ctx.replyFmt(fmt(['', ' and ', ' and ', ''], fmt`${bold('bold')}`, fmt`${bold(italic('bitalic'))}`, fmt`${italic('italic')}`)); +}); + +bot.start(); +``` + + + + +```js +const { Bot, Composer, Context } = require("grammy"); +const { bold, fmt, hydrateReply, italic } = require("@grammyjs/parse-mode"); + +const bot = new Bot(""); + +// Install format reply variant to ctx +bot.use(hydrateReply); + +bot.command('demo', async ctx => { + await ctx.replyFmt(fmt`${bold('bold!')} +${bold(italic('bitalic!'))} +${bold(fmt`bold ${link('blink', 'example.com')} bold`)}`); + + // fmt can also be called like a regular function + await ctx.replyFmt(fmt(['', ' and ', ' and ', ''], fmt`${bold('bold')}`, fmt`${bold(italic('bitalic'))}`, fmt`${italic('italic')}`)); +}); + +bot.start(); +``` + + + + +```ts +import { Bot, Composer, Context } from "https://deno.land/x/grammy/mod.ts"; +import { + bold, + fmt, + hydrateReply, + italic, +} from "https://deno.land/x/grammy_parse_mode/mod.ts"; + +import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod.ts"; + +const bot = new Bot>(""); + +// Install format reply variant to ctx +bot.use(hydrateReply); + +bot.command('demo', async ctx => { + await ctx.replyFmt(fmt`${bold('bold!')} +${bold(italic('bitalic!'))} +${bold(fmt`bold ${link('blink', 'example.com')} bold`)}`); + + // fmt can also be called like a regular function + await ctx.replyFmt(fmt(['', ' and ', ' and ', ''], fmt`${bold('bold')}`, fmt`${bold(italic('bitalic'))}`, fmt`${italic('italic')}`)); +}); + +bot.start(); +``` + + + + +## Usage (Using default parse mode and utility reply methods) + + + + +```ts +import { Bot, Composer, Context } from 'grammy'; +import { hydrateReply, parseMode } from '@grammyjs/parse-mode'; + +import type { ParseModeFlavor } from '@grammyjs/parse-mode'; + +const bot = new Bot>(''); + +// Install familiar reply variants to ctx bot.use(hydrateReply); // Sets default parse_mode for ctx.reply -bot.api.config.use(parseMode("MarkdownV2")); - -bot.command("demo", async (ctx) => { - await ctx.reply("*This* reply uses _MarkdownV2_ as the default `formatting`"); - await ctx.replyWithHTML( - "This is withHTML formatting", - ); - await ctx.replyWithMarkdown("*This* is _withMarkdown_ `formatting`"); - await ctx.replyWithMarkdownV1("*This* is _withMarkdownV1_ `formatting`"); - await ctx.replyWithMarkdownV2("*This* is _withMarkdownV2_ `formatting`"); +bot.api.config.use(parseMode('MarkdownV2')); + +bot.command('demo', async ctx => { + await ctx.reply('*This* is _the_ default `formatting`'); + await ctx.replyWithHTML('This is withHTML formatting'); + await ctx.replyWithMarkdown('*This* is _withMarkdown_ `formatting`'); + await ctx.replyWithMarkdownV1('*This* is _withMarkdownV1_ `formatting`'); + await ctx.replyWithMarkdownV2('*This* is _withMarkdownV2_ `formatting`'); }); bot.start(); @@ -38,25 +122,23 @@ bot.start(); ```js -const { Bot } = require("grammy"); +const { Bot, Composer, Context } = require("grammy"); const { hydrateReply, parseMode } = require("@grammyjs/parse-mode"); const bot = new Bot(""); -// Use the plugin. +// Install familiar reply variants to ctx bot.use(hydrateReply); -// Set the default `parse_mode` of `ctx.reply`. -bot.api.config.use(parseMode("MarkdownV2")); - -bot.command("demo", async (ctx) => { - await ctx.reply("*This* reply uses _MarkdownV2_ as the default `formatting`"); - await ctx.replyWithHTML( - "This is withHTML formatting", - ); - await ctx.replyWithMarkdown("*This* is _withMarkdown_ `formatting`"); - await ctx.replyWithMarkdownV1("*This* is _withMarkdownV1_ `formatting`"); - await ctx.replyWithMarkdownV2("*This* is _withMarkdownV2_ `formatting`"); +// Sets default parse_mode for ctx.reply +bot.api.config.use(parseMode('MarkdownV2')); + +bot.command('demo', async ctx => { + await ctx.reply('*This* is _the_ default `formatting`'); + await ctx.replyWithHTML('This is withHTML formatting'); + await ctx.replyWithMarkdown('*This* is _withMarkdown_ `formatting`'); + await ctx.replyWithMarkdownV1('*This* is _withMarkdownV1_ `formatting`'); + await ctx.replyWithMarkdownV2('*This* is _withMarkdownV2_ `formatting`'); }); bot.start(); @@ -66,30 +148,28 @@ bot.start(); ```ts -import { Bot } from "https://deno.land/x/grammy/mod.ts"; +import { Bot, Composer, Context } from "https://deno.land/x/grammy/mod.ts"; import { hydrateReply, parseMode, } from "https://deno.land/x/grammy_parse_mode/mod.ts"; -import type { ParseModeContext } from "https://deno.land/x/grammy_parse_mode/mod.ts"; +import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod.ts"; -const bot = new Bot(""); +const bot = new Bot>(""); -// Use the plugin. +// Install familiar reply variants to ctx bot.use(hydrateReply); -// Set the default `parse_mode` of `ctx.reply`. -bot.api.config.use(parseMode("MarkdownV2")); - -bot.command("demo", async (ctx) => { - await ctx.reply("*This* reply uses _MarkdownV2_ as the default `formatting`"); - await ctx.replyWithHTML( - "This is withHTML formatting", - ); - await ctx.replyWithMarkdown("*This* is _withMarkdown_ `formatting`"); - await ctx.replyWithMarkdownV1("*This* is _withMarkdownV1_ `formatting`"); - await ctx.replyWithMarkdownV2("*This* is _withMarkdownV2_ `formatting`"); +// Sets default parse_mode for ctx.reply +bot.api.config.use(parseMode('MarkdownV2')); + +bot.command('demo', async ctx => { + await ctx.reply('*This* is _the_ default `formatting`'); + await ctx.replyWithHTML('This is withHTML formatting'); + await ctx.replyWithMarkdown('*This* is _withMarkdown_ `formatting`'); + await ctx.replyWithMarkdownV1('*This* is _withMarkdownV1_ `formatting`'); + await ctx.replyWithMarkdownV2('*This* is _withMarkdownV2_ `formatting`'); }); bot.start(); From 24cd3c96e4f41012d28ae09fc9c53bf124b31efd Mon Sep 17 00:00:00 2001 From: KnightNiwrem Date: Sat, 8 Oct 2022 21:51:28 +0800 Subject: [PATCH 02/18] Run docs:fmt --- site/docs/plugins/parse-mode.md | 121 +++++++++++++++++++------------- 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index c3d047f15..c17c02be0 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -8,23 +8,30 @@ This plugin provides a transformer for setting default `parse_mode`, and a middl ```ts -import { Bot, Composer, Context } from 'grammy'; -import { bold, fmt, hydrateReply, italic } from '@grammyjs/parse-mode'; +import { Bot, Composer, Context } from "grammy"; +import { bold, fmt, hydrateReply, italic } from "@grammyjs/parse-mode"; -import type { ParseModeFlavor } from '@grammyjs/parse-mode'; +import type { ParseModeFlavor } from "@grammyjs/parse-mode"; -const bot = new Bot>(''); +const bot = new Bot>(""); // Install format reply variant to ctx bot.use(hydrateReply); -bot.command('demo', async ctx => { - await ctx.replyFmt(fmt`${bold('bold!')} -${bold(italic('bitalic!'))} -${bold(fmt`bold ${link('blink', 'example.com')} bold`)}`); +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("bold!")} +${bold(italic("bitalic!"))} +${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); // fmt can also be called like a regular function - await ctx.replyFmt(fmt(['', ' and ', ' and ', ''], fmt`${bold('bold')}`, fmt`${bold(italic('bitalic'))}`, fmt`${italic('italic')}`)); + await ctx.replyFmt( + fmt( + ["", " and ", " and ", ""], + fmt`${bold("bold")}`, + fmt`${bold(italic("bitalic"))}`, + fmt`${italic("italic")}`, + ), + ); }); bot.start(); @@ -42,13 +49,20 @@ const bot = new Bot(""); // Install format reply variant to ctx bot.use(hydrateReply); -bot.command('demo', async ctx => { - await ctx.replyFmt(fmt`${bold('bold!')} -${bold(italic('bitalic!'))} -${bold(fmt`bold ${link('blink', 'example.com')} bold`)}`); +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("bold!")} +${bold(italic("bitalic!"))} +${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); // fmt can also be called like a regular function - await ctx.replyFmt(fmt(['', ' and ', ' and ', ''], fmt`${bold('bold')}`, fmt`${bold(italic('bitalic'))}`, fmt`${italic('italic')}`)); + await ctx.replyFmt( + fmt( + ["", " and ", " and ", ""], + fmt`${bold("bold")}`, + fmt`${bold(italic("bitalic"))}`, + fmt`${italic("italic")}`, + ), + ); }); bot.start(); @@ -73,13 +87,20 @@ const bot = new Bot>(""); // Install format reply variant to ctx bot.use(hydrateReply); -bot.command('demo', async ctx => { - await ctx.replyFmt(fmt`${bold('bold!')} -${bold(italic('bitalic!'))} -${bold(fmt`bold ${link('blink', 'example.com')} bold`)}`); +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("bold!")} +${bold(italic("bitalic!"))} +${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); // fmt can also be called like a regular function - await ctx.replyFmt(fmt(['', ' and ', ' and ', ''], fmt`${bold('bold')}`, fmt`${bold(italic('bitalic'))}`, fmt`${italic('italic')}`)); + await ctx.replyFmt( + fmt( + ["", " and ", " and ", ""], + fmt`${bold("bold")}`, + fmt`${bold(italic("bitalic"))}`, + fmt`${italic("italic")}`, + ), + ); }); bot.start(); @@ -94,25 +115,27 @@ bot.start(); ```ts -import { Bot, Composer, Context } from 'grammy'; -import { hydrateReply, parseMode } from '@grammyjs/parse-mode'; +import { Bot, Composer, Context } from "grammy"; +import { hydrateReply, parseMode } from "@grammyjs/parse-mode"; -import type { ParseModeFlavor } from '@grammyjs/parse-mode'; +import type { ParseModeFlavor } from "@grammyjs/parse-mode"; -const bot = new Bot>(''); +const bot = new Bot>(""); // Install familiar reply variants to ctx bot.use(hydrateReply); // Sets default parse_mode for ctx.reply -bot.api.config.use(parseMode('MarkdownV2')); - -bot.command('demo', async ctx => { - await ctx.reply('*This* is _the_ default `formatting`'); - await ctx.replyWithHTML('This is withHTML formatting'); - await ctx.replyWithMarkdown('*This* is _withMarkdown_ `formatting`'); - await ctx.replyWithMarkdownV1('*This* is _withMarkdownV1_ `formatting`'); - await ctx.replyWithMarkdownV2('*This* is _withMarkdownV2_ `formatting`'); +bot.api.config.use(parseMode("MarkdownV2")); + +bot.command("demo", async (ctx) => { + await ctx.reply("*This* is _the_ default `formatting`"); + await ctx.replyWithHTML( + "This is withHTML formatting", + ); + await ctx.replyWithMarkdown("*This* is _withMarkdown_ `formatting`"); + await ctx.replyWithMarkdownV1("*This* is _withMarkdownV1_ `formatting`"); + await ctx.replyWithMarkdownV2("*This* is _withMarkdownV2_ `formatting`"); }); bot.start(); @@ -131,14 +154,16 @@ const bot = new Bot(""); bot.use(hydrateReply); // Sets default parse_mode for ctx.reply -bot.api.config.use(parseMode('MarkdownV2')); - -bot.command('demo', async ctx => { - await ctx.reply('*This* is _the_ default `formatting`'); - await ctx.replyWithHTML('This is withHTML formatting'); - await ctx.replyWithMarkdown('*This* is _withMarkdown_ `formatting`'); - await ctx.replyWithMarkdownV1('*This* is _withMarkdownV1_ `formatting`'); - await ctx.replyWithMarkdownV2('*This* is _withMarkdownV2_ `formatting`'); +bot.api.config.use(parseMode("MarkdownV2")); + +bot.command("demo", async (ctx) => { + await ctx.reply("*This* is _the_ default `formatting`"); + await ctx.replyWithHTML( + "This is withHTML formatting", + ); + await ctx.replyWithMarkdown("*This* is _withMarkdown_ `formatting`"); + await ctx.replyWithMarkdownV1("*This* is _withMarkdownV1_ `formatting`"); + await ctx.replyWithMarkdownV2("*This* is _withMarkdownV2_ `formatting`"); }); bot.start(); @@ -162,14 +187,16 @@ const bot = new Bot>(""); bot.use(hydrateReply); // Sets default parse_mode for ctx.reply -bot.api.config.use(parseMode('MarkdownV2')); - -bot.command('demo', async ctx => { - await ctx.reply('*This* is _the_ default `formatting`'); - await ctx.replyWithHTML('This is withHTML formatting'); - await ctx.replyWithMarkdown('*This* is _withMarkdown_ `formatting`'); - await ctx.replyWithMarkdownV1('*This* is _withMarkdownV1_ `formatting`'); - await ctx.replyWithMarkdownV2('*This* is _withMarkdownV2_ `formatting`'); +bot.api.config.use(parseMode("MarkdownV2")); + +bot.command("demo", async (ctx) => { + await ctx.reply("*This* is _the_ default `formatting`"); + await ctx.replyWithHTML( + "This is withHTML formatting", + ); + await ctx.replyWithMarkdown("*This* is _withMarkdown_ `formatting`"); + await ctx.replyWithMarkdownV1("*This* is _withMarkdownV1_ `formatting`"); + await ctx.replyWithMarkdownV2("*This* is _withMarkdownV2_ `formatting`"); }); bot.start(); From 8b4ee764cd92a3f57f8796a8b2a221950e5563ee Mon Sep 17 00:00:00 2001 From: KnightNiwrem Date: Wed, 12 Oct 2022 19:16:26 +0800 Subject: [PATCH 03/18] Update site/docs/plugins/parse-mode.md Co-authored-by: Roj --- site/docs/plugins/parse-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index c17c02be0..25ed8bec2 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -23,7 +23,7 @@ bot.command("demo", async (ctx) => { ${bold(italic("bitalic!"))} ${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); - // fmt can also be called like a regular function + // fmt can also be called like any other function await ctx.replyFmt( fmt( ["", " and ", " and ", ""], From 287cf342d5e133527bb662177d1f5bc7e9d620a4 Mon Sep 17 00:00:00 2001 From: KnightNiwrem Date: Wed, 12 Oct 2022 19:16:32 +0800 Subject: [PATCH 04/18] Update site/docs/plugins/parse-mode.md Co-authored-by: Roj --- site/docs/plugins/parse-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index 25ed8bec2..fa5380949 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -54,7 +54,7 @@ bot.command("demo", async (ctx) => { ${bold(italic("bitalic!"))} ${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); - // fmt can also be called like a regular function + // fmt can also be called like any other function await ctx.replyFmt( fmt( ["", " and ", " and ", ""], From 1d920d3bfd6d36f5eea4e7dc89638324adc916b5 Mon Sep 17 00:00:00 2001 From: KnightNiwrem Date: Wed, 12 Oct 2022 19:16:38 +0800 Subject: [PATCH 05/18] Update site/docs/plugins/parse-mode.md Co-authored-by: Roj --- site/docs/plugins/parse-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index fa5380949..1b32c99c8 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -92,7 +92,7 @@ bot.command("demo", async (ctx) => { ${bold(italic("bitalic!"))} ${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); - // fmt can also be called like a regular function + // fmt can also be called like any other function await ctx.replyFmt( fmt( ["", " and ", " and ", ""], From cd0e0fb8297bb97b46c482955a38a67ae9e01696 Mon Sep 17 00:00:00 2001 From: Roj Date: Thu, 29 Dec 2022 17:12:02 +0300 Subject: [PATCH 06/18] Apply suggestions from code review --- site/docs/plugins/parse-mode.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index 1b32c99c8..b89ea7815 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -15,7 +15,7 @@ import type { ParseModeFlavor } from "@grammyjs/parse-mode"; const bot = new Bot>(""); -// Install format reply variant to ctx +// Install the plugin. bot.use(hydrateReply); bot.command("demo", async (ctx) => { @@ -23,7 +23,7 @@ bot.command("demo", async (ctx) => { ${bold(italic("bitalic!"))} ${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); - // fmt can also be called like any other function + // fmt can also be called like any other function. await ctx.replyFmt( fmt( ["", " and ", " and ", ""], @@ -46,7 +46,7 @@ const { bold, fmt, hydrateReply, italic } = require("@grammyjs/parse-mode"); const bot = new Bot(""); -// Install format reply variant to ctx +// Install the plugin. bot.use(hydrateReply); bot.command("demo", async (ctx) => { @@ -54,7 +54,7 @@ bot.command("demo", async (ctx) => { ${bold(italic("bitalic!"))} ${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); - // fmt can also be called like any other function + // fmt can also be called like any other function. await ctx.replyFmt( fmt( ["", " and ", " and ", ""], @@ -84,7 +84,7 @@ import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod. const bot = new Bot>(""); -// Install format reply variant to ctx +// Install the plugin. bot.use(hydrateReply); bot.command("demo", async (ctx) => { @@ -92,7 +92,7 @@ bot.command("demo", async (ctx) => { ${bold(italic("bitalic!"))} ${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); - // fmt can also be called like any other function + // fmt can also be called like any other function. await ctx.replyFmt( fmt( ["", " and ", " and ", ""], @@ -122,7 +122,7 @@ import type { ParseModeFlavor } from "@grammyjs/parse-mode"; const bot = new Bot>(""); -// Install familiar reply variants to ctx +// Install the plugin. bot.use(hydrateReply); // Sets default parse_mode for ctx.reply @@ -150,10 +150,10 @@ const { hydrateReply, parseMode } = require("@grammyjs/parse-mode"); const bot = new Bot(""); -// Install familiar reply variants to ctx +// Install the plugin. bot.use(hydrateReply); -// Sets default parse_mode for ctx.reply +// Set the default parse mode for ctx.reply. bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { @@ -183,10 +183,10 @@ import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod. const bot = new Bot>(""); -// Install familiar reply variants to ctx +// Install the plugin. bot.use(hydrateReply); -// Sets default parse_mode for ctx.reply +// Set the default parse mode for ctx.reply. bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { From 9c680108942adfe65a2e48db62e98023f7184536 Mon Sep 17 00:00:00 2001 From: Roj Date: Thu, 29 Dec 2022 17:18:10 +0300 Subject: [PATCH 07/18] Apply suggestions from code review --- site/docs/plugins/parse-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index b89ea7815..79fa196ee 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -2,7 +2,7 @@ This plugin provides a transformer for setting default `parse_mode`, and a middleware for hydrating `Context` with familiar `reply` variant methods - i.e. `replyWithHTML`, `replyWithMarkdown`, etc. -## Usage (Using format) +## Usage (Improving Formatting Experience) From c24e21eed0b93afdbd6a68ac35630ce81244177e Mon Sep 17 00:00:00 2001 From: Roj Date: Thu, 29 Dec 2022 17:18:31 +0300 Subject: [PATCH 08/18] Update site/docs/plugins/parse-mode.md --- site/docs/plugins/parse-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index 79fa196ee..a6eb83fbf 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -109,7 +109,7 @@ bot.start(); -## Usage (Using default parse mode and utility reply methods) +## Usage (Default Parse Mode and Reply Methods) From 0bd24a2c7c09c673056e995285cac6ac16d18c3a Mon Sep 17 00:00:00 2001 From: Roj Date: Fri, 30 Dec 2022 09:14:37 +0300 Subject: [PATCH 09/18] Apply suggestions from code review Co-authored-by: Ciki Momogi --- site/docs/plugins/parse-mode.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index a6eb83fbf..c74c2d468 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -8,8 +8,8 @@ This plugin provides a transformer for setting default `parse_mode`, and a middl ```ts -import { Bot, Composer, Context } from "grammy"; -import { bold, fmt, hydrateReply, italic } from "@grammyjs/parse-mode"; +import { Bot, Context } from "grammy"; +import { bold, fmt, hydrateReply, italic, link } from "@grammyjs/parse-mode"; import type { ParseModeFlavor } from "@grammyjs/parse-mode"; @@ -41,8 +41,8 @@ bot.start(); ```js -const { Bot, Composer, Context } = require("grammy"); -const { bold, fmt, hydrateReply, italic } = require("@grammyjs/parse-mode"); +const { Bot, Context } = require("grammy"); +const { bold, fmt, hydrateReply, italic, link } = require("@grammyjs/parse-mode"); const bot = new Bot(""); @@ -72,12 +72,13 @@ bot.start(); ```ts -import { Bot, Composer, Context } from "https://deno.land/x/grammy/mod.ts"; +import { Bot, Context } from "https://deno.land/x/grammy/mod.ts"; import { bold, fmt, hydrateReply, italic, + link, } from "https://deno.land/x/grammy_parse_mode/mod.ts"; import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod.ts"; From 0592ca8f38d0a6ee6181042223389edc8232d576 Mon Sep 17 00:00:00 2001 From: Ciki Momogi Date: Fri, 30 Dec 2022 22:55:01 +0700 Subject: [PATCH 10/18] Add `link` to import list --- site/docs/plugins/parse-mode.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index a90150620..d6d749783 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -42,7 +42,9 @@ bot.start(); ```js const { Bot, Context } = require("grammy"); -const { bold, fmt, hydrateReply, italic, link } = require("@grammyjs/parse-mode"); +const { bold, fmt, hydrateReply, italic, link } = require( + "@grammyjs/parse-mode", +); const bot = new Bot(""); @@ -116,7 +118,7 @@ bot.start(); ```ts -import { Bot, Composer, Context } from "grammy"; +import { Bot, Context } from "grammy"; import { hydrateReply, parseMode } from "@grammyjs/parse-mode"; import type { ParseModeFlavor } from "@grammyjs/parse-mode"; From f47f4bbd0009ec46286c99ac6fb0faebcead50e3 Mon Sep 17 00:00:00 2001 From: Ciki Momogi Date: Fri, 30 Dec 2022 22:55:16 +0700 Subject: [PATCH 11/18] Sync changes to Indonesian --- site/docs/id/plugins/parse-mode.md | 176 +++++++++++++++++++++++------ 1 file changed, 140 insertions(+), 36 deletions(-) diff --git a/site/docs/id/plugins/parse-mode.md b/site/docs/id/plugins/parse-mode.md index 23617029b..6e9cab411 100644 --- a/site/docs/id/plugins/parse-mode.md +++ b/site/docs/id/plugins/parse-mode.md @@ -1,41 +1,149 @@ # Plugin Parse Mode (`parse-mode`) -Plugin ini menyediakan sebuah transformer untuk mengatur setting-an bawaan `parse_mode` dan sebuah middleware untuk menghidrasi `Context` dengan varian method `reply` yang lebih familiar, contohnya: `replyWithHTML`, `replyWithMarkdown`, dll. +Plugin ini menyediakan sebuah transformer untuk menyetel pengaturan bawaan `parse_mode` dan sebuah middleware untuk menghidrasi `Context` dengan varian method `reply` yang lebih familiar, contohnya: `replyWithHTML`, `replyWithMarkdown`, dsb. -## Penggunaan +## Penggunaan (Melakukan Pemformatan dengan Mudah) ```ts -import { Bot } from "grammy"; +import { Bot, Context } from "grammy"; +import { bold, fmt, hydrateReply, italic, link } from "@grammyjs/parse-mode"; + +import type { ParseModeFlavor } from "@grammyjs/parse-mode"; + +const bot = new Bot>(""); + +// Instal plugin-nya. +bot.use(hydrateReply); + +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("bold!")} +${bold(italic("bitalic!"))} +${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); + + // fmt juga bisa dipanggil seperti function lainnya. + await ctx.replyFmt( + fmt( + ["", " dan ", " dan ", ""], + fmt`${bold("bold")}`, + fmt`${bold(italic("bitalic"))}`, + fmt`${italic("italic")}`, + ), + ); +}); + +bot.start(); +``` + + + + +```js +const { Bot, Context } = require("grammy"); +const { bold, fmt, hydrateReply, italic, link } = require( + "@grammyjs/parse-mode", +); + +const bot = new Bot(""); + +// Instal plugin-nya. +bot.use(hydrateReply); + +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("bold!")} +${bold(italic("bitalic!"))} +${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); + + // fmt juga bisa dipanggil seperti function lainnya. + await ctx.replyFmt( + fmt( + ["", " dan ", " dan ", ""], + fmt`${bold("bold")}`, + fmt`${bold(italic("bitalic"))}`, + fmt`${italic("italic")}`, + ), + ); +}); + +bot.start(); +``` + + + + +```ts +import { Bot, Context } from "https://deno.land/x/grammy/mod.ts"; +import { + bold, + fmt, + hydrateReply, + italic, + link, +} from "https://deno.land/x/grammy_parse_mode/mod.ts"; + +import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod.ts"; + +const bot = new Bot>(""); + +// Instal plugin-nya. +bot.use(hydrateReply); + +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("bold!")} +${bold(italic("bitalic!"))} +${bold(fmt`bold ${link("blink", "example.com")} bold`)}`); + + // fmt juga bisa dipanggil seperti function lainnya. + await ctx.replyFmt( + fmt( + ["", " dan ", " dan ", ""], + fmt`${bold("bold")}`, + fmt`${bold(italic("bitalic"))}`, + fmt`${italic("italic")}`, + ), + ); +}); + +bot.start(); +``` + + + + +## Usage (Parse Mode dan Method Reply Bawaan) + + + + +```ts +import { Bot, Context } from "grammy"; import { hydrateReply, parseMode } from "@grammyjs/parse-mode"; -import type { ParseModeContext } from "@grammyjs/parse-mode"; +import type { ParseModeFlavor } from "@grammyjs/parse-mode"; -const bot = new Bot(""); +const bot = new Bot>(""); -// Gunakan plugin-nya +// Instal plugin-nya bot.use(hydrateReply); -// Atur setting-an bawaan parse_mode untuk ctx.reply +// Atur parse_mode bawaan untuk ctx.reply bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { - await ctx.reply( - "*Reply* ini menggunakan _MarkdownV2_ sebagai `format` bawaannya", - ); + await ctx.reply("*Teks* ini _diformat_ menggunakan `format bawaan`"); await ctx.replyWithHTML( - "Reply ini menggunakan format withHTML", + "Teks ini diformat menggunakan withHTML", ); await ctx.replyWithMarkdown( - "*Reply* ini menggunakan `format` _withMarkdown_", + "*Teks* ini _diformat_ menggunakan `withMarkdown`", ); await ctx.replyWithMarkdownV1( - "*Reply* ini menggunakan `format` _withMarkdownV1_", + "*Teks* ini _diformat_ menggunakan `withMarkdownV1`", ); await ctx.replyWithMarkdownV2( - "*Reply* ini menggunakan `format` _withMarkdownV2_", + "*Teks* ini _diformat_ menggunakan `withMarkdownV2`", ); }); @@ -46,32 +154,30 @@ bot.start(); ```js -const { Bot } = require("grammy"); +const { Bot, Context } = require("grammy"); const { hydrateReply, parseMode } = require("@grammyjs/parse-mode"); const bot = new Bot(""); -// Gunakan plugin-nya +// Install plugin-nya. bot.use(hydrateReply); -// Atur setting-an bawaan parse_mode untuk ctx.reply +// Atur parse_mode bawaan untuk ctx.reply bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { - await ctx.reply( - "*Reply* ini menggunakan _MarkdownV2_ sebagai `format` bawaannya", - ); + await ctx.reply("*Teks* ini _diformat_ menggunakan `format bawaan`"); await ctx.replyWithHTML( - "Reply ini menggunakan format withHTML", + "Teks ini diformat menggunakan withHTML", ); await ctx.replyWithMarkdown( - "*Reply* ini menggunakan `format` _withMarkdown_", + "*Teks* ini _diformat_ menggunakan `withMarkdown`", ); await ctx.replyWithMarkdownV1( - "*Reply* ini menggunakan `format` _withMarkdownV1_", + "*Teks* ini _diformat_ menggunakan `withMarkdownV1`", ); await ctx.replyWithMarkdownV2( - "*Reply* ini menggunakan `format` _withMarkdownV2_", + "*Teks* ini _diformat_ menggunakan `withMarkdownV2`", ); }); @@ -82,37 +188,35 @@ bot.start(); ```ts -import { Bot } from "https://deno.land/x/grammy/mod.ts"; +import { Bot, Context } from "https://deno.land/x/grammy/mod.ts"; import { hydrateReply, parseMode, } from "https://deno.land/x/grammy_parse_mode/mod.ts"; -import type { ParseModeContext } from "https://deno.land/x/grammy_parse_mode/mod.ts"; +import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod.ts"; -const bot = new Bot(""); +const bot = new Bot>(""); -// Gunakan plugin-nya +// Install plugin-nya. bot.use(hydrateReply); -// Atur setting-an bawaan parse_mode untuk ctx.reply +// Atur parse_mode bawaan untuk ctx.reply bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { - await ctx.reply( - "*Reply* ini menggunakan _MarkdownV2_ sebagai `format` bawaannya", - ); + await ctx.reply("*Teks* ini _diformat_ menggunakan `format bawaan`"); await ctx.replyWithHTML( - "Reply ini menggunakan format withHTML", + "Teks ini diformat menggunakan withHTML", ); await ctx.replyWithMarkdown( - "*Reply* ini menggunakan `format` _withMarkdown_", + "*Teks* ini _diformat_ menggunakan `withMarkdown`", ); await ctx.replyWithMarkdownV1( - "*Reply* ini menggunakan `format` _withMarkdownV1_", + "*Teks* ini _diformat_ menggunakan `withMarkdownV1`", ); await ctx.replyWithMarkdownV2( - "*Reply* ini menggunakan `format` _withMarkdownV2_", + "*Teks* ini _diformat_ menggunakan `withMarkdownV2`", ); }); From c12a523bbe3dcee99b31f8a5683eef5172f5758f Mon Sep 17 00:00:00 2001 From: Ciki Momogi Date: Fri, 30 Dec 2022 22:58:08 +0700 Subject: [PATCH 12/18] Remove `composer` from import list --- site/docs/plugins/parse-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index d6d749783..6237f69d2 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -148,7 +148,7 @@ bot.start(); ```js -const { Bot, Composer, Context } = require("grammy"); +const { Bot, Context } = require("grammy"); const { hydrateReply, parseMode } = require("@grammyjs/parse-mode"); const bot = new Bot(""); @@ -176,7 +176,7 @@ bot.start(); ```ts -import { Bot, Composer, Context } from "https://deno.land/x/grammy/mod.ts"; +import { Bot, Context } from "https://deno.land/x/grammy/mod.ts"; import { hydrateReply, parseMode, From 91c3c258dfacfbeba7db7e58868200b1d97fee58 Mon Sep 17 00:00:00 2001 From: Habemuscode Date: Fri, 30 Dec 2022 16:59:18 +0100 Subject: [PATCH 13/18] Add Spanish --- site/docs/es/plugins/parse-mode.md | 144 +++++++++++++++++++++++++---- 1 file changed, 127 insertions(+), 17 deletions(-) diff --git a/site/docs/es/plugins/parse-mode.md b/site/docs/es/plugins/parse-mode.md index c7026aee9..91f397ec2 100644 --- a/site/docs/es/plugins/parse-mode.md +++ b/site/docs/es/plugins/parse-mode.md @@ -2,28 +2,138 @@ Este plugin proporciona un transformador para establecer el `parse_mode` por defecto, y un middleware para hidratar el `Context` con los métodos variantes familiares de `reply` - es decir, `replyWithHTML`, `replyWithMarkdown`, etc. -## Uso +## Uso (Mejorar la experiencia de formateo) ```ts -import { Bot } from "grammy"; +import { Bot, Context } from "grammy"; +import { bold, fmt, hydrateReply, italic, link } from "@grammyjs/parse-mode"; + +import type { ParseModeFlavor } from "@grammyjs/parse-mode"; + +const bot = new Bot>(""); + +// Instalar el plugin. +bot.use(hydrateReply); + +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("negrita!")} +${bold(italic("ambas!"))} +${bold(fmt`negrita ${link("blink", "example.com")} negrita`)}`); + + // fmt también puede ser llamada como cualquier otra función. + await ctx.replyFmt( + fmt( + ["", " and ", " and ", ""], + fmt`${bold("negrita")}`, + fmt`${bold(italic("ambas"))}`, + fmt`${italic("cursiva")}`, + ), + ); +}); + +bot.start(); +``` + + + + +```js +const { Bot, Context } = require("grammy"); +const { bold, fmt, hydrateReply, italic, link } = require( + "@grammyjs/parse-mode", +); + +const bot = new Bot(""); + +// Instalar el plugin. +bot.use(hydrateReply); + +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("negrita!")} +${bold(italic("ambas!"))} +${bold(fmt`negrita ${link("blink", "example.com")} negrita`)}`); + + // fmt también puede ser llamada como cualquier otra función. + await ctx.replyFmt( + fmt( + ["", " and ", " and ", ""], + fmt`${bold("negrita")}`, + fmt`${bold(italic("ambas"))}`, + fmt`${italic("cursiva")}`, + ), + ); +}); + +bot.start(); +``` + + + + +```ts +import { Bot, Context } from "https://deno.land/x/grammy/mod.ts"; +import { + bold, + fmt, + hydrateReply, + italic, + link, +} from "https://deno.land/x/grammy_parse_mode/mod.ts"; + +import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod.ts"; + +const bot = new Bot>(""); + +// Instalar el plugin. +bot.use(hydrateReply); + +bot.command("demo", async (ctx) => { + await ctx.replyFmt(fmt`${bold("negrita!")} +${bold(italic("ambas!"))} +${bold(fmt`negrita ${link("blink", "example.com")} negrita`)}`); + + // fmt también puede ser llamada como cualquier otra función. + await ctx.replyFmt( + fmt( + ["", " and ", " and ", ""], + fmt`${bold("negrita")}`, + fmt`${bold(italic("ambas"))}`, + fmt`${italic("cursiva")}`, + ), + ); +}); + +bot.start(); +``` + + + + +## Uso (modo de análisis sintáctico por defecto y métodos de respuesta) + + + + +```ts +import { Bot, Composer, Context } from "grammy"; import { hydrateReply, parseMode } from "@grammyjs/parse-mode"; -import type { ParseModeContext } from "@grammyjs/parse-mode"; +import type { ParseModeFlavor } from "@grammyjs/parse-mode"; -const bot = new Bot(""); +const bot = new Bot>(""); -// Usa el plugin. +// Instalar el plugin. bot.use(hydrateReply); -// Establece el parse_mode por defecto para ctx.reply +// Establece el modo de formateo por defecto de `ctx.reply`. bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { await ctx.reply( - "*Esta* respuesta utiliza _MarkdownV2_ como `formato` por defecto", + "*Este* es _el_ `formato` por defecto", ); await ctx.replyWithHTML( "Este es el formato conHTML", @@ -40,20 +150,20 @@ bot.start(); ```js -const { Bot } = require("grammy"); +const { Bot, Composer, Context } = require("grammy"); const { hydrateReply, parseMode } = require("@grammyjs/parse-mode"); const bot = new Bot(""); -// Usa el plugin. +// Instalar el plugin. bot.use(hydrateReply); -// Establece el `parse_mode` por defecto de `ctx.reply`. +// Establece el modo de formateo por defecto de `ctx.reply`. bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { await ctx.reply( - "*Esta* respuesta utiliza _MarkdownV2_ como `formato` por defecto", + "*Este* es _el_ `formato` por defecto", ); await ctx.replyWithHTML( "Este es el formato conHTML", @@ -70,25 +180,25 @@ bot.start(); ```ts -import { Bot } from "https://deno.land/x/grammy/mod.ts"; +import { Bot, Composer, Context } from "https://deno.land/x/grammy/mod.ts"; import { hydrateReply, parseMode, } from "https://deno.land/x/grammy_parse_mode/mod.ts"; -import type { ParseModeContext } from "https://deno.land/x/grammy_parse_mode/mod.ts"; +import type { ParseModeFlavor } from "https://deno.land/x/grammy_parse_mode/mod.ts"; -const bot = new Bot(""); +const bot = new Bot>(""); -// Usa el plugin. +// Instalar el plugin. bot.use(hydrateReply); -// Establece el `parse_mode` por defecto de `ctx.reply`. +// Establece el modo de formateo por defecto de `ctx.reply`. bot.api.config.use(parseMode("MarkdownV2")); bot.command("demo", async (ctx) => { await ctx.reply( - "*Esta* respuesta utiliza _MarkdownV2_ como `formato` por defecto", + "*Este* es _el_ `formato` por defecto", ); await ctx.replyWithHTML( "Este es el formato conHTML", From 1ec703b390c0779b460b45d3f0a08d3ceb65b2fa Mon Sep 17 00:00:00 2001 From: Habemuscode Date: Fri, 30 Dec 2022 16:59:31 +0100 Subject: [PATCH 14/18] Format English --- site/docs/plugins/parse-mode.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/docs/plugins/parse-mode.md b/site/docs/plugins/parse-mode.md index a90150620..8bc925275 100644 --- a/site/docs/plugins/parse-mode.md +++ b/site/docs/plugins/parse-mode.md @@ -42,7 +42,9 @@ bot.start(); ```js const { Bot, Context } = require("grammy"); -const { bold, fmt, hydrateReply, italic, link } = require("@grammyjs/parse-mode"); +const { bold, fmt, hydrateReply, italic, link } = require( + "@grammyjs/parse-mode", +); const bot = new Bot(""); From 413932b43dfdf250c9d08985b78443c38269ffae Mon Sep 17 00:00:00 2001 From: Habemuscode Date: Fri, 30 Dec 2022 17:35:39 +0100 Subject: [PATCH 15/18] Update site/docs/es/plugins/parse-mode.md Co-authored-by: Ciki Momogi --- site/docs/es/plugins/parse-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/es/plugins/parse-mode.md b/site/docs/es/plugins/parse-mode.md index 91f397ec2..96ee85c24 100644 --- a/site/docs/es/plugins/parse-mode.md +++ b/site/docs/es/plugins/parse-mode.md @@ -26,7 +26,7 @@ ${bold(fmt`negrita ${link("blink", "example.com")} negrita`)}`); // fmt también puede ser llamada como cualquier otra función. await ctx.replyFmt( fmt( - ["", " and ", " and ", ""], + ["", " y ", " y ", ""], fmt`${bold("negrita")}`, fmt`${bold(italic("ambas"))}`, fmt`${italic("cursiva")}`, From 3d49b7584cf70a1f4aa5d03e676ae41ce59c3a69 Mon Sep 17 00:00:00 2001 From: Habemuscode Date: Fri, 30 Dec 2022 17:38:23 +0100 Subject: [PATCH 16/18] Update site/docs/es/plugins/parse-mode.md Co-authored-by: Ciki Momogi --- site/docs/es/plugins/parse-mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/docs/es/plugins/parse-mode.md b/site/docs/es/plugins/parse-mode.md index 96ee85c24..3d9a34121 100644 --- a/site/docs/es/plugins/parse-mode.md +++ b/site/docs/es/plugins/parse-mode.md @@ -118,7 +118,7 @@ bot.start(); ```ts -import { Bot, Composer, Context } from "grammy"; +import { Bot, Context } from "grammy"; import { hydrateReply, parseMode } from "@grammyjs/parse-mode"; import type { ParseModeFlavor } from "@grammyjs/parse-mode"; From 91cde470c52eb5b657b884fa5ae1af52a9359deb Mon Sep 17 00:00:00 2001 From: Habemuscode Date: Fri, 30 Dec 2022 17:40:56 +0100 Subject: [PATCH 17/18] Remove Composer from dependencies --- site/docs/es/plugins/parse-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/docs/es/plugins/parse-mode.md b/site/docs/es/plugins/parse-mode.md index 3d9a34121..cd7b173ef 100644 --- a/site/docs/es/plugins/parse-mode.md +++ b/site/docs/es/plugins/parse-mode.md @@ -150,7 +150,7 @@ bot.start(); ```js -const { Bot, Composer, Context } = require("grammy"); +const { Bot, Context } = require("grammy"); const { hydrateReply, parseMode } = require("@grammyjs/parse-mode"); const bot = new Bot(""); @@ -180,7 +180,7 @@ bot.start(); ```ts -import { Bot, Composer, Context } from "https://deno.land/x/grammy/mod.ts"; +import { Bot, Context } from "https://deno.land/x/grammy/mod.ts"; import { hydrateReply, parseMode, From ec8833075a6688fcd0ffe6633bf2ea84f255d0f8 Mon Sep 17 00:00:00 2001 From: Habemuscode Date: Fri, 30 Dec 2022 17:42:20 +0100 Subject: [PATCH 18/18] Fix and to y --- site/docs/es/plugins/parse-mode.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/docs/es/plugins/parse-mode.md b/site/docs/es/plugins/parse-mode.md index cd7b173ef..3b86370e5 100644 --- a/site/docs/es/plugins/parse-mode.md +++ b/site/docs/es/plugins/parse-mode.md @@ -59,7 +59,7 @@ ${bold(fmt`negrita ${link("blink", "example.com")} negrita`)}`); // fmt también puede ser llamada como cualquier otra función. await ctx.replyFmt( fmt( - ["", " and ", " and ", ""], + ["", " y ", " y ", ""], fmt`${bold("negrita")}`, fmt`${bold(italic("ambas"))}`, fmt`${italic("cursiva")}`, @@ -98,7 +98,7 @@ ${bold(fmt`negrita ${link("blink", "example.com")} negrita`)}`); // fmt también puede ser llamada como cualquier otra función. await ctx.replyFmt( fmt( - ["", " and ", " and ", ""], + ["", " y ", " y ", ""], fmt`${bold("negrita")}`, fmt`${bold(italic("ambas"))}`, fmt`${italic("cursiva")}`,