Fis messages being double-redacted
This commit is contained in:
parent
69c93ca9d9
commit
d629e666db
1 changed files with 1 additions and 1 deletions
|
@ -13,7 +13,7 @@ const utils = sync.require("../converters/utils")
|
||||||
*/
|
*/
|
||||||
async function deleteMessage(event) {
|
async function deleteMessage(event) {
|
||||||
const rows = from("event_message").join("message_channel", "message_id").select("channel_id", "message_id").where({event_id: event.redacts}).all()
|
const rows = from("event_message").join("message_channel", "message_id").select("channel_id", "message_id").where({event_id: event.redacts}).all()
|
||||||
db.prepare("DELETE FROM event_message WHERE event_id = ?").run(event.event_id)
|
db.prepare("DELETE FROM event_message WHERE event_id = ?").run(event.redacts)
|
||||||
for (const row of rows) {
|
for (const row of rows) {
|
||||||
db.prepare("DELETE FROM message_channel WHERE message_id = ?").run(row.message_id)
|
db.prepare("DELETE FROM message_channel WHERE message_id = ?").run(row.message_id)
|
||||||
await discord.snow.channel.deleteMessage(row.channel_id, row.message_id, event.content.reason)
|
await discord.snow.channel.deleteMessage(row.channel_id, row.message_id, event.content.reason)
|
||||||
|
|
Loading…
Reference in a new issue