Ignore short path on messages mentioning the bot directly.

This commit is contained in:
OK
2023-03-27 18:38:56 +02:00
parent 2ee2b092d6
commit a503ee405c
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -88,11 +88,11 @@ class TestFunctionality(TestBotBase):
with patch.object(openai.ChatCompletion, 'acreate', new=acreate):
await self.bot.on_message(message)
self.assertEqual(self.bot.airesponder.history[-1]["content"],
'{"user": "madeup_name", "message": "Hello, how are you?", "channel": "some_channel"}')
'{"user": "madeup_name", "message": "Hello, how are you?", "channel": "some_channel", "direct": false}')
message.author.name = 'different_name'
await self.bot.on_message(message)
self.assertEqual(self.bot.airesponder.history[-2]["content"],
'{"user": "different_name", "message": "Hello, how are you?", "channel": "some_channel"}')
'{"user": "different_name", "message": "Hello, how are you?", "channel": "some_channel", "direct": false}')
message.channel.send.assert_called_once_with("Hello!", suppress_embeds=True)
async def test_on_message_event2(self) -> None: