Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions site/docs/guide/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,19 @@ bot.command("start", async (ctx) => {
});
});
```

## Editing Messages

You can edit a message sent by your bot like this:

```ts
bot.command("think", async (ctx) => {
const msg = await ctx.reply("Thinking...");

const newText = await getSomeNewText();

await ctx.api.editMessageText(ctx.chatId, msg.message_id, newText);
});
```

> Consider using the [hydrate plugin](../plugins/hydrate) which simplifies message editing.
14 changes: 14 additions & 0 deletions site/docs/id/guide/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,17 @@ bot.command("start", async (ctx) => {
);
});
```
## Edit Pesan
Kamu dapat mengedit pesan yang dikirim oleh bot milikmu seperti ini:

```ts
bot.command("think", async (ctx) => {
const msg = await ctx.reply("Berpikir...");

const newText = await getSomeNewText();

await ctx.api.editMessageText(ctx.chatId, msg.message_id, newText);
});
```

> Pertimbangkan untuk menggunakan [plugin hydrate](../plugins/hydrate), yang memudahkan pengeditan pesan.
16 changes: 16 additions & 0 deletions site/docs/uk/guide/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,19 @@ bot.command("start", async (ctx) => {
);
});
```

## Редагування повідомлень

Ви можете відредагувати повідомлення, надіслане вашим ботом, наступним чином:

```ts
bot.command("think", async (ctx) => {
const msg = await ctx.reply("Думаю...");

const newText = await getSomeNewText();

await ctx.api.editMessageText(ctx.chatId, msg.message_id, newText);
});
```

> Рекомендуємо використати [плагін hydrate](../plugins/hydrate), який спрощує редагування повідомлень.
16 changes: 16 additions & 0 deletions site/docs/zh/guide/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,19 @@ bot.command("start", async (ctx) => {
});
});
```

## 编辑信息

你可以像这样编辑你的 bot 发送的信息:

```ts
bot.command("think", async (ctx) => {
const msg = await ctx.reply("深度思考中……");

const newText = await getSomeNewText();

await ctx.api.editMessageText(ctx.chatId, msg.message_id, newText);
});
```

> 考虑使用 [hydrate 插件](../plugins/hydrate),它可以简化信息编辑。
Loading