def test1(self): event = Event.from_payload(self.payload) bot = SearchBot() self.assertTrue(bot.match(event, event.message)) result = call_async_func(bot.reply(event)) print(result) self.assertTrue(len(result) > 20)
def replace_event_msg(event: Event, msg: str): new_event = Event.from_payload(event) new_event["message"] = Message(msg) new_event["raw_message"] = msg return new_event