From d47a1673463ea49128b61ef615e173121a1e169f Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Mon, 28 Dec 2020 18:29:07 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20conversation.run=20behavio?= =?UTF-8?q?ur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- royalnet/engineer/command.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/royalnet/engineer/command.py b/royalnet/engineer/command.py index f1e5332d..939a0b0f 100644 --- a/royalnet/engineer/command.py +++ b/royalnet/engineer/command.py @@ -96,13 +96,12 @@ class Command: """ A conversation which runs the command. """ - log.debug(f"Getting a message from the queue...") - try: - msg: bullet.Message = (_sentry | wrench.Type(bullet.Message)).get_nowait() - except asyncio.QueueEmpty: - log.debug(f"No message found in the queue, returning...") - return + log.debug(f"Getting a bullet from the queue...") + b: bullet.Bullet = await _sentry + if not isinstance(b, bullet.Message): + log.debug(f"Bullet is not a message, returning...") + msg: bullet.Message = b log.debug(f"Getting text of {msg}...") text = await msg.text()