Skip to content
Extraits de code Groupes Projets
Valider 966dbf90 rédigé par Travis Ralston's avatar Travis Ralston Validation de GitHub
Parcourir les fichiers

Update bot.ts

parent 96bae5bc
Branches
Étiquettes
Aucune requête de fusion associée trouvée
......@@ -9,6 +9,7 @@ import * as Bluebird from "bluebird";
import * as mime from "mime";
import * as marked from "marked";
import * as path from "path";
import * as escapeStringRegexp from "escape-string-regexp";
// Due to messages often arriving before we get a response from the send call,
// messages get delayed from discord.
......@@ -239,7 +240,7 @@ export class DiscordBot {
private HandleMentions(body: string, members: Discord.GuildMember[]): string {
for (const member of members) {
body = body.replace(new RegExp(member.displayName, "g"), `<@!${member.id}>`);
body = body.replace(new RegExp(escapeStringRegexp(member.displayName), "g"), `<@!${member.id}>`);
}
return body;
}
......
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