Ignore short path on messages mentioning the bot directly.
This commit is contained in:
+2
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user