#aiomultiprocess + pycord?

1 messages · Page 1 of 1 (latest)

soft quartz
#

How can I use asynchronous parallelism with pycord in Python?
I wanna run the bot with client.run(token) and create several processes to send requests to API even when server is proceeding other request from my bot. I hope it's possible.

The code (should change colors really fast, beyond the limit of API with parallel requests to server):

@client.event
async def on_ready():
    guild = client.get_guild(guild_id)
    legend_role = guild.get_role(role_id)

    async with amp.Pool(os.cpu_count()) as pool:
        async for color in asyncgen_color_seq
            await pool.apply(legend_role.edit, kwds={"colour": color})
soft quartz
soft quartz
lean vine
#

I suggest rather than doing this with a discord bot instance, you rather do it with a web client like aiohttp and make requests to the discord http api with different bot tokens

lean vine
#

@soft quartz ^

#

It would be much more easily vertically scalable

soft quartz
#

K, thx dude