forked from cadence/out-of-your-element
Fix all rooms being affected by speedbump
This commit is contained in:
parent
11864f80cf
commit
6a06dc14ce
3 changed files with 13 additions and 10 deletions
|
@ -11,7 +11,7 @@ const speedbump = sync.require("./speedbump")
|
|||
* @param {import("discord-api-types/v10").GatewayMessageDeleteDispatchData} data
|
||||
*/
|
||||
async function deleteMessage(data) {
|
||||
const row = select("channel_room", ["room_id", "speedbump_id", "speedbump_checked"], {channel_id: data.channel_id}).get()
|
||||
const row = select("channel_room", ["room_id", "speedbump_checked"], {channel_id: data.channel_id}).get()
|
||||
if (!row) return
|
||||
|
||||
const eventsToRedact = select("event_message", "event_id", {message_id: data.id}).pluck().all()
|
||||
|
@ -22,7 +22,7 @@ async function deleteMessage(data) {
|
|||
await api.redactEvent(row.room_id, eventID)
|
||||
}
|
||||
|
||||
speedbump.updateCache(data.channel_id, row.speedbump_id, row.speedbump_checked)
|
||||
speedbump.updateCache(data.channel_id, row.speedbump_checked)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue