commit 55d789e837df1bfbae360750ee7e1cf3b3cca0ca
parent e2661e3217e75e28de37f4ee5dfac09b980f91e2
Author: MTRNord <mtrnord1@gmail.com>
Date: Tue, 17 Aug 2021 02:19:54 +0200
Ignore audio events that are not typed as voice
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/maubot_audio_preventer/bot.py b/maubot_audio_preventer/bot.py
@@ -41,6 +41,8 @@ class MaubotAudioPreventer(Plugin):
async def audio_event_handler(self, evt: MessageEvent) -> None:
if evt.content.msgtype != MessageType.AUDIO or evt.sender in self.config['whitelist']:
return
+ if evt.get("m.voice") is None:
+ return
await self.client.redact(evt.room_id, evt.event_id, "Voice messages are not allowed")