diff --git a/neon_utils/message_utils.py b/neon_utils/message_utils.py index b3c59c91..3bc7b003 100644 --- a/neon_utils/message_utils.py +++ b/neon_utils/message_utils.py @@ -294,4 +294,7 @@ def neon_must_respond(message: Message = None) -> bool: else: # Solo Private return True + if message.context.get("client") in ("mana", "mq_api"): + # API requests should always return a response + return True return False diff --git a/tests/message_util_tests.py b/tests/message_util_tests.py index 0573ccc3..77f86d99 100644 --- a/tests/message_util_tests.py +++ b/tests/message_util_tests.py @@ -277,12 +277,17 @@ def test_neon_must_respond(self): "conversation with Neon"}, {"klat_data": { "title": "!PRIVATE:user"}}) + mq_api_message = Message("", {}, {"client": "mq_api"}) + mana_api_message = Message("", {}, {"client": "mana"}) + self.assertFalse(neon_must_respond()) self.assertTrue(neon_must_respond(private_message_solo)) self.assertTrue(neon_must_respond(private_message_neon)) self.assertFalse(neon_must_respond(private_message_neon_plus)) self.assertFalse(neon_must_respond(public_message)) self.assertFalse(neon_must_respond(first_message)) + self.assertTrue(neon_must_respond(mq_api_message)) + self.assertTrue(neon_must_respond(mana_api_message)) if __name__ == '__main__':