mirror of
https://github.com/matrixgpt/matrix-chatgpt-bot.git
synced 2024-10-01 01:25:41 -04:00
ignore non-text messages
This commit is contained in:
parent
69c3560735
commit
3af7b88825
@ -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 (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 (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["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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user