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
async def delete_message(chat_id: Any, message_id: str) -> boolParameters
ParamField
AnyNo description available.
ParamField
strNo description available.
Returns
ResponseField
boolThe result of the operation.
Uses
NotImplementedError
Source
View on GitHubpraisonaiagents/bots/base.py at line 793