Compare commits
No commits in common. "0ed3ef68f17155892ab259415a3a321e492e3237" and "64369f1054818189747fb1a6ae3a5c6f3e125964" have entirely different histories.
0ed3ef68f1
...
64369f1054
3 changed files with 4 additions and 4 deletions
|
|
@ -259,7 +259,6 @@ async function pollToEvent(poll) {
|
|||
* @returns {Promise<{$type: string, $sender?: string, [x: string]: any}[]>}
|
||||
*/
|
||||
async function messageToEvent(message, guild, options = {}, di) {
|
||||
message = {...message}
|
||||
const events = []
|
||||
|
||||
/* c8 ignore next 7 */
|
||||
|
|
@ -326,7 +325,8 @@ async function messageToEvent(message, guild, options = {}, di) {
|
|||
let content = message.content
|
||||
if (content) content = `\n${content}`
|
||||
else if ((message.flags || 0) & DiscordTypes.MessageFlags.Loading) content = " — interaction loading..."
|
||||
message.content = `> ↪️ <@${interaction.user.id}> used \`/${interaction.name}\`${content}`
|
||||
content = `> ↪️ <@${interaction.user.id}> used \`/${interaction.name}\`${content}`
|
||||
message = {...message, content} // editToChanges reuses the object so we can't mutate it. have to clone it
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -307,7 +307,7 @@ module.exports = {
|
|||
*/
|
||||
async MESSAGE_REACTION_ADD(client, data) {
|
||||
if (data.user_id === client.user.id) return // m2d reactions are added by the discord bot user - do not reflect them back to matrix.
|
||||
if (data.emoji.name === "❓" && select("event_message", "message_id", {message_id: data.message_id, source: 0, part: 0}).get()) { // source 0 = matrix
|
||||
if (data.emoji.name === "❓" && select("event_message", "message_id", {message_id: data.message_id, source: 0})) {
|
||||
const guild_id = data.guild_id ?? client.channels.get(data.channel_id)["guild_id"]
|
||||
await Promise.all([
|
||||
client.snow.channel.deleteReaction(data.channel_id, data.message_id, data.emoji.name).catch(() => {}),
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ const webGuild = sync.require("../../web/routes/guild")
|
|||
*/
|
||||
async function _interact({guild_id, data}, {api}) {
|
||||
const message = from("event_message").join("message_room", "message_id").join("historical_channel_room", "historical_room_index")
|
||||
.select("source", "reference_channel_id", "room_id", "event_id").where({message_id: data.target_id}).and("ORDER BY part").get()
|
||||
.select("source", "reference_channel_id", "room_id", "event_id").where({message_id: data.target_id, part: 0}).get()
|
||||
|
||||
if (!message) {
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue