Skip to content
Extraits de code Groupes Projets
Valider c779990e rédigé par Deurstann's avatar Deurstann
Parcourir les fichiers

Fix regex error

parent 019e0e9c
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!2Fix matrix reply on modified message for discord
......@@ -337,17 +337,17 @@ export class MatrixEventProcessor {
if (profile) {
params.displayname = profile.displayname;
}
let formattedBodyRegex = new RegExp("<br \/>(.*)<\/blockquote>")
let bodyRegex = new RegExp("> <@[^\.>]*:[^\.>]*\.[^\.>]*> (.*)");
let formattedBodyRegex = new RegExp("<br \/>(.*)<\/blockquote>",'g');
let bodyRegex = new RegExp("> <@[^\.>]*:[^\.>]*\.[^\.>]*> (.*)",'g');
let body: string = "";
if (event.type !== "m.sticker") {
const replyContent = repliedEvent.content;
const baseContent = event.content;
if(replyContent && baseContent && replyContent["body"] && baseContent["body"]){
replyContent["body"] = baseContent["body"].matchAll(bodyRegex)[0]
replyContent["body"] = [...baseContent["body"].matchAll(bodyRegex)][0][1]
}
if(replyContent && baseContent && replyContent["formatted_body"] && baseContent["formatted_body"]){
replyContent["formatted_body"] = baseContent["formatted_body"].matchAll(formattedBodyRegex)[0]
replyContent["formatted_body"] = [...baseContent["formatted_body"].matchAll(formattedBodyRegex)][0][1]
}
body = await this.matrixMsgProcessor.FormatMessage(replyContent as IMatrixMessage, channel.guild, params);
}
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter