Skip to content

.delete() method doesn't work on business messages. #4867

@jainamoswal

Description

@jainamoswal

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

I would like to have a shortcut method to delete a business message.

await update.business_message.delete()

This doesn't work and raises message to be deleted not found error.

Describe the solution you'd like

Currently .delete() method doesn't support business_connection_id like other shortcut methods support it. (like .pin(), .unpin(), .reply_text(), .reply_photo() and other methods)

Describe alternatives you've considered

This can be working alternative to the issue.

await app.bot.delete_business_messages(
    business_connection_id=update.business_message.business_connection_id,
    message_ids=[update.business_message.id]
)

Additional context

No response

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions