report_messages()

async Client.report_messages()

Report specific messages in a chat for rule violations.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat.

  • message_ids (int | Iterable of int) – A single message id or an iterable of message ids to report.

  • reason (ReportReason | str, optional) – The reason for reporting. Defaults to SPAM.

  • message (str, optional) – Additional explanatory text or details about the report. Defaults to “” (empty string).

  • option (bytes, optional) – Specific report option bytes, if known beforehand. Defaults to b””.

  • participant (int | str, optional) – Participant peer (user id or username) to report spam for in a channel/supergroup. When provided, uses channels.ReportSpam.

Returns:

bool – True on success.

Example

from pyrogram.enums import ReportReason

# Report a single message
await app.report_messages(chat_id, 12345, ReportReason.SPAM)

# Report multiple messages with comment
await app.report_messages(chat_id, [123, 124], ReportReason.VIOLENCE, "Threatening remarks")