generated from array-in-a-matrix/matrix-bot-template
reversed the bot, delete messages that start with prefix instead
This commit is contained in:
parent
fa4bfb1720
commit
4f8826fda7
2
index.js
2
index.js
|
@ -20,7 +20,7 @@ client.on("room.message", (roomId, event) => {
|
||||||
["Message", event["content"]["body"]]
|
["Message", event["content"]["body"]]
|
||||||
]
|
]
|
||||||
if (event["sender"] === config.user) {
|
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.`)
|
console.warn(`The message "${table[1][1]}" in room ${table[0][1]} will be deleted.`)
|
||||||
function redactMessage() {
|
function redactMessage() {
|
||||||
console.table(table)
|
console.table(table)
|
||||||
|
|
Loading…
Reference in New Issue