Compare commits

..

No commits in common. "1f5865b0d8a14ba56b07cc1d4f94c5e57ed058c4" and "5f0e765934bbd1dd3e5765e19d9624f0356ae9e6" have entirely different histories.

3 changed files with 1 additions and 14 deletions

View file

@ -244,8 +244,6 @@ module.exports = {
if (row) return // The message was sent by the bridge's own webhook on discord. We don't want to reflect this back, so just drop it. if (row) return // The message was sent by the bridge's own webhook on discord. We don't want to reflect this back, so just drop it.
} }
if (dUtils.isEphemeralMessage(message)) return // Ephemeral messages are for the eyes of the receiver only!
const {affected, row} = await speedbump.maybeDoSpeedbump(message.channel_id, message.id) const {affected, row} = await speedbump.maybeDoSpeedbump(message.channel_id, message.id)
if (affected) return if (affected) return
@ -264,8 +262,6 @@ module.exports = {
if (row) return // The message was sent by the bridge's own webhook on discord. We don't want to reflect this back, so just drop it. if (row) return // The message was sent by the bridge's own webhook on discord. We don't want to reflect this back, so just drop it.
} }
if (dUtils.isEphemeralMessage(data)) return // Ephemeral messages are for the eyes of the receiver only!
// Edits need to go through the speedbump as well. If the message is delayed but the edit isn't, we don't have anything to edit from. // Edits need to go through the speedbump as well. If the message is delayed but the edit isn't, we don't have anything to edit from.
const {affected, row} = await speedbump.maybeDoSpeedbump(data.channel_id, data.id) const {affected, row} = await speedbump.maybeDoSpeedbump(data.channel_id, data.id)
if (affected) return if (affected) return

View file

@ -101,14 +101,6 @@ function isWebhookMessage(message) {
return message.webhook_id && !isInteractionResponse return message.webhook_id && !isInteractionResponse
} }
/**
* Ephemeral messages can be generated if a slash command is attached to the same bot that OOYE is running on
* @param {DiscordTypes.APIMessage} message
*/
function isEphemeralMessage(message) {
return message.flags & (1 << 6);
}
/** @param {string} snowflake */ /** @param {string} snowflake */
function snowflakeToTimestampExact(snowflake) { function snowflakeToTimestampExact(snowflake) {
return Number(BigInt(snowflake) >> 22n) + EPOCH return Number(BigInt(snowflake) >> 22n) + EPOCH
@ -124,6 +116,5 @@ module.exports.hasPermission = hasPermission
module.exports.hasSomePermissions = hasSomePermissions module.exports.hasSomePermissions = hasSomePermissions
module.exports.hasAllPermissions = hasAllPermissions module.exports.hasAllPermissions = hasAllPermissions
module.exports.isWebhookMessage = isWebhookMessage module.exports.isWebhookMessage = isWebhookMessage
module.exports.isEphemeralMessage = isEphemeralMessage
module.exports.snowflakeToTimestampExact = snowflakeToTimestampExact module.exports.snowflakeToTimestampExact = snowflakeToTimestampExact
module.exports.timestampToSnowflakeInexact = timestampToSnowflakeInexact module.exports.timestampToSnowflakeInexact = timestampToSnowflakeInexact

View file

@ -16,7 +16,7 @@ async function deleteMessage(event) {
db.prepare("DELETE FROM event_message WHERE event_id = ?").run(event.event_id) db.prepare("DELETE FROM event_message WHERE event_id = ?").run(event.event_id)
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) discord.snow.channel.deleteMessage(row.channel_id, row.message_id, event.content.reason)
} }
} }