reversed the bot, delete messages that start with prefix instead

This commit is contained in:
array-in-a-matrix 2023-02-09 09:13:58 -05:00
parent fa4bfb1720
commit 4f8826fda7
1 changed files with 1 additions and 1 deletions

View File

@ -20,7 +20,7 @@ client.on("room.message", (roomId, event) => {
["Message", event["content"]["body"]]
]
if (event["sender"] === config.user) {
if (event["content"]["body"].startsWith(config.key)) return; //? if message starts with the key do NOT delete that message
if (!event["content"]["body"].startsWith(config.key)) return; //? if message starts with the key do NOT delete that message
console.warn(`The message "${table[1][1]}" in room ${table[0][1]} will be deleted.`)
function redactMessage() {
console.table(table)