diff --git a/d2m/actions/add-reaction.js b/d2m/actions/add-reaction.js index b8fb38e..a08d584 100644 --- a/d2m/actions/add-reaction.js +++ b/d2m/actions/add-reaction.js @@ -17,7 +17,7 @@ const createRoom = sync.require("../actions/create-room") async function addReaction(data) { const user = data.member?.user assert.ok(user && user.username) - const parentID = select("event_message", "event_id", "WHERE message = ? AND part = 0").pluck().get(data.message_id) // 0 = primary + const parentID = select("event_message", "event_id", "WHERE message_id = ? AND part = 0").pluck().get(data.message_id) // 0 = primary if (!parentID) return // Nothing can be done if the parent message was never bridged. assert.equal(typeof parentID, "string") const roomID = await createRoom.ensureRoom(data.channel_id) diff --git a/d2m/event-dispatcher.js b/d2m/event-dispatcher.js index f7ff6a3..93f7468 100644 --- a/d2m/event-dispatcher.js +++ b/d2m/event-dispatcher.js @@ -181,7 +181,7 @@ module.exports = { */ async onMessageUpdate(client, data) { if (data.webhook_id) { - const row = select("webhook", "1", "WHERE webhook_id = ?").pluck().get(message.webhook_id) + const row = select("webhook", "webhook_id", "WHERE webhook_id = ?").pluck().get(data.webhook_id) if (row) { // The update was sent by the bridge's own webhook on discord. We don't want to reflect this back, so just drop it. return