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
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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.
Veuillez vous inscrire ou vous pour commenter