1

Am trying to run an async telethon function under multiprocessing but i don't know how to blend the two together. i have Googled, search and ask but it seems like there is no topic like this on the internet

import multiprocessing as mp
.......
.......

# Convert___________________________
@client.on(events.NewMessage)
async def handler(event):
    who = event.sender_id
    state = conversation_state.get(who)
    if state is  None:
        if "/convert" in event.text:                                                                async def conv():
                await client.send_message(event.chat_id, 'Choose Encoder Type //', butto
ns=[
                    Button.text('[1] > H264', resize=True, single_use=True),
                    Button.text('[2] > libx265', resize=True, single_use=True),
                    ])
            await conv()
            conversation_state[who] = State.WAIT_DIGITS

'''


i want to run conv() in a a process like this
a1 = await mp.Process(target=conv)

here is the other part

if __name__=='__main__':
#    a1.start()
#    a1.join()
    client.start(bot_token=bot_token)
    client.run_until_disconnected()


please how do run the con() function in multiprocess, howdoi make this work
kruz
  • 21
  • 3

0 Answers0