> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit Message • AI Agent SDK

> edit_message: Edit an existing message.

# edit\_message

<div className="flex items-center gap-2">
  <Badge color="blue">Async</Badge>
  <Badge color="purple">Method</Badge>
</div>

> This is a method of the [**BotProtocol**](../classes/BotProtocol) class in the [**protocols**](../modules/protocols) module.

Edit an existing message.

## Signature

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
async def edit_message(channel_id: str, message_id: str, content: Union[str, Dict[str, Any]]) -> BotMessage
```

## Parameters

<ParamField query="channel_id" type="str" required={true}>
  Channel containing the message
</ParamField>

<ParamField query="message_id" type="str" required={true}>
  ID of message to edit
</ParamField>

<ParamField query="content" type="Union" required={true}>
  New message content
</ParamField>

### Returns

<ResponseField name="Returns" type="BotMessage">
  The edited message
</ResponseField>

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-agents/praisonaiagents/bots/protocols.py#L364">
  `praisonaiagents/bots/protocols.py` at line 364
</Card>
