Delete Message • AI Agent SDK

delete_message: Delete a previously sent message.

delete_message

Async

Method

</div>

This is a method of the BasePlatformAdapter class in the base module.

Delete a previously sent message.

Default behaviour is capability-gated for parity with :meth:edit_message: when `supports_delete is False the platform genuinely cannot delete, so this returns False (unsupported). When an adapter declares supports_delete=True it MUST override this — the default then raises so the broken promise is caught rather than silently no-opping. :func:verify_capability_contract` catches this mismatch at registration time, before any live turn.

Signature

python
async def delete_message(chat_id: Any, message_id: str) -> bool

Parameters

ParamField Any

No description available.

ParamField str

No description available.

Returns

ResponseField bool

The result of the operation.

Uses

  • NotImplementedError

Source

View on GitHub

praisonaiagents/bots/base.py at line 793