1,
2,
3
Выжимка:
from pyrogram.raw.functions.account import ReportPeer
from pyrogram.raw.types import *
# Edited. Forgot to replace types2 classes you've putted in your code
def get_report_reason(text):
if text == "Report for child abuse.":
return InputReportReasonChildAbuse()
elif text == "Report for impersonation.":
return InputReportReasonFake()
elif text == "Report for copyrighted content.":
return InputReportReasonCopyright()
elif text == "Report an irrelevant geogroup.":
return InputReportReasonGeoIrrelevant()
elif text == "Other.":
return InputReportReasonOther()
peer = app.resolve_peer("@test")
peer_id = peer["channel_id"]
access_hash = peer["access_hash"]
# Also you have to determine here what type of peer is that.
# Lets take channel.
channel = InputPeerChannel(channel_id=peer_id, access_hash=access_hash)
reason = get_report_reason(report_reason)
report_peer = ReportPeer(
peer=channel,
reason=reason,
message="text"
)
report = app.send(report_peer)