0
from pyrogram.raw.functions.messages import Report


from pyrogram.raw.functions.channels import GetChannels
from pyrogram.raw.types import InputPeerChannel, InputReportReasonSpam
from pyrogram.raw import functions, types

@app.on_message(filters.command('start') & filters.private)
async def start_bot(cleint, mesage):
    print('start command')
    await mesage.reply_text('hello welcome to my bot', reply_markup=buttons.start())

    chat = await app.get_chat('example')
    peer = await app.resolve_peer(chat.id)
    result = await app.invoke(GetChannels(id=[peer])) 


    for channel in result.chats:
        channel_id =channel.id
        access_hash =channel.access_hash

    peer = InputPeerChannel(channel_id=channel_id, access_hash=access_hash)
    try:
        async with Client(":memory:",session_string='session strig ') as bot:

            result = await bot.invoke(
                functions.messages.Report(
                    peer = peer,
                    id=[8409],
                    reason = InputReportReasonSpam(),
                    message='hi'
                )
            )
            print(result)
    except Exception as e :
        print(e)

I also used the option instead of the reason, but it didn't work Has anyone had this problem before? If you have a solution, give an example. Thank youReport.init() got an unexpected keyword argument 'reason'‍‍‍‍‍

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.