From d39d82f362e17a092145bf5cb11b0abe34cf8a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E5=9D=82=E9=9B=85?= <23130178+ShadowRZ@users.noreply.github.com> Date: Tue, 11 Oct 2022 14:19:14 +0800 Subject: [PATCH] Update --- nyx_bot/bot_commands.py | 6 ++++-- nyx_bot/chat_functions.py | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nyx_bot/bot_commands.py b/nyx_bot/bot_commands.py index dcc8e55..b51e11c 100644 --- a/nyx_bot/bot_commands.py +++ b/nyx_bot/bot_commands.py @@ -134,14 +134,16 @@ class Command: if avatar_url != prev_avatar_url: i -= 1 avatar_http = await self.client.mxc_to_http(avatar_url) - send_text += f"{i}: Changed to {avatar_http} ({change.datetime.isoformat()})\n" + send_text += ( + f"{i}: Changed to {avatar_http} ({change.datetime.isoformat()})\n" + ) if i < -3: break await self.client.room_typing(self.room.room_id, False) await send_text_to_room( self.client, self.room.room_id, - send_text, + send_text.rstrip(), notice=False, markdown_convert=False, reply_to_event_id=self.event.event_id, diff --git a/nyx_bot/chat_functions.py b/nyx_bot/chat_functions.py index 24748e0..ca05a3a 100644 --- a/nyx_bot/chat_functions.py +++ b/nyx_bot/chat_functions.py @@ -243,6 +243,8 @@ async def send_jerryxiao( target_event = await client.room_get_event(room.room_id, reply_to) to_sender = target_event.event.sender action = reference_text[len(prefix) :] + if action.isascii(): + return if action != "": if reversed_senders: # Swap from and to