ignore non-text messages

This commit is contained in:
Max Kammler 2023-02-07 10:05:32 +01:00
parent 69c3560735
commit 3af7b88825

View File

@ -35,6 +35,7 @@ export default class CommandHandler {
if (MATRIX_WHITELIST && !MATRIX_WHITELIST.split(" ").find(w => event.sender.endsWith(w))) return true; // Ignore if not on whitelist if set
if (Date.now() - event.origin_server_ts > 10000) return true; // Ignore old messages
if (event.content["m.relates_to"]?.["rel_type"] === "m.replace") return true; // Ignore edits
if (event.content.msgtype !== "m.text") return true; // Ignore everything which is not text
return false;
}