Skip to content
This repository was archived by the owner on Aug 28, 2021. It is now read-only.

'Await' statement blocking further code execution when run via ipcΒ #52

@Pianoplayer1

Description

@Pianoplayer1

Description

In a function I have that sends messages to a specific channel, there is (obviously) an await channel.send(...) line to actually send the message. Whenever this function is run via the ipc server though, the code past this line never gets executed - the message itself is sent without a problem, but the execution stops at the await and seemingly never returns from that statement.
I am pretty sure this problem is caused by the ipc module, because when I transform the function into a regular discord bot command, everything works fine and as expected.

Behavior

The message gets sent to the specified channel, but code after that sending operation is completely ignored and never runs. With that, it is also impossible to run the function again, as it is still stuck in that instance.
There are no errors whatsoever, just nothing happens.

Reproduction Steps

Here is the server code:

class Bot(commands.Bot):
    self.ipc = ipc.Server(self, secret_key="abc")
    ...

bot = Bot()
bot.ipc.start()
bot.run()

@Bot.ipc.route()
async def send_message(channel_id):
    await client.get_channel(channel_id).send('hi')
    print('hi')

And the client:

ipc_client = ipc.Client(secret_key='abc')

async def request():
    await ipc_client.request('send_message', channel_id=...)

First, I started the server (which went fine and without errors), then ran the client function a few times with the above described results - the 'hi' never gets printed.

System Information

Python 3.9.4
discord.py 1.7.3
discord-ext-ipc 2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions