Skip to content
Extraits de code Groupes Projets
Valider 2d08b0e2 rédigé par eeeeeta's avatar eeeeeta
Parcourir les fichiers

insert attachment messages into the store as well

parent 002418d2
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -579,13 +579,26 @@ export class DiscordBot { ...@@ -579,13 +579,26 @@ export class DiscordBot {
info.h = attachment.height; info.h = attachment.height;
} }
rooms.forEach((room) => { rooms.forEach((room) => {
intent.sendMessage(room, { let prom = intent.sendMessage(room, {
body: attachment.filename, body: attachment.filename,
info, info,
msgtype, msgtype,
url: content.mxcUrl, url: content.mxcUrl,
external_url: attachment.url, external_url: attachment.url,
}); });
prom.then((res) => {
const evt = new DbEvent();
evt.MatrixId = res.event_id + ";" + room;
evt.DiscordId = msg.id;
evt.ChannelId = msg.channel.id;
if (msg.guild) {
evt.GuildId = msg.guild.id;
}
else {
evt.GuildId = "dm";
}
this.store.Insert(evt);
});
}); });
}); });
}); });
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter