Edits a message. Parameters ---------- channel_id: :class:`str` The id of the channel. message_id: :class:`str` The id of the message. content: Optional[:class:`str`] The content of the message. embeds: Opt
(
self,
channel_id: str,
message_id: str,
*,
content: Optional[str],
embeds: Optional[List[Union[SendableEmbedPayload, SendableEmbed]]] = None,
)
| 495 | return await self.request("GET", f"channels/{channel_id}/messages/{message_id}") |
| 496 | |
| 497 | async def edit_message( |
| 498 | self, |
| 499 | channel_id: str, |
| 500 | message_id: str, |
| 501 | *, |
| 502 | content: Optional[str], |
| 503 | embeds: Optional[List[Union[SendableEmbedPayload, SendableEmbed]]] = None, |
| 504 | ) -> MessagePayload: |
| 505 | """ |
| 506 | Edits a message. |
| 507 | |
| 508 | Parameters |
| 509 | ---------- |
| 510 | channel_id: :class:`str` |
| 511 | The id of the channel. |
| 512 | message_id: :class:`str` |
| 513 | The id of the message. |
| 514 | content: Optional[:class:`str`] |
| 515 | The content of the message. |
| 516 | embeds: Optional[List[Union[:class:`SendableEmbedPayload`, :class:`SendableEmbed`]]] |
| 517 | The embeds of the message. |
| 518 | """ |
| 519 | data: Dict[str, Any] = {} |
| 520 | if content: |
| 521 | data["content"] = content |
| 522 | if embeds: |
| 523 | data["embeds"] = await gather(*[self.handle_embed(embed) for embed in embeds]) |
| 524 | return await self.request("PATCH", f"channels/{channel_id}/messages/{message_id}", json=data) |
| 525 | |
| 526 | async def delete_message(self, channel_id: str, message_id: str): |
| 527 | """ |
no test coverage detected