Skip to content
Open
Changes from 1 commit
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.
Loading