fix bugs from orm migration
This commit is contained in:
		| @@ -17,7 +17,7 @@ const createRoom = sync.require("../actions/create-room") | |||||||
| async function addReaction(data) { | async function addReaction(data) { | ||||||
| 	const user = data.member?.user | 	const user = data.member?.user | ||||||
| 	assert.ok(user && user.username) | 	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. | 	if (!parentID) return // Nothing can be done if the parent message was never bridged. | ||||||
| 	assert.equal(typeof parentID, "string") | 	assert.equal(typeof parentID, "string") | ||||||
| 	const roomID = await createRoom.ensureRoom(data.channel_id) | 	const roomID = await createRoom.ensureRoom(data.channel_id) | ||||||
|   | |||||||
| @@ -181,7 +181,7 @@ module.exports = { | |||||||
| 	 */ | 	 */ | ||||||
| 	async onMessageUpdate(client, data) { | 	async onMessageUpdate(client, data) { | ||||||
| 		if (data.webhook_id) { | 		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) { | 			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. | 				// 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 | 				return | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Cadence Ember
					Cadence Ember