Skip to content

Commit d7d3bd6

Browse files
authored
Match IRC-style mentions at beginning of message
1 parent 3087661 commit d7d3bd6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/bot.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ class Bot {
476476
if (user) return user;
477477

478478
return match;
479-
}).replace(/@([^\s]+)/g, (match, reference) => {
479+
}).replace(/^([^@\s:,]+)[:,]|@([^\s]+)/g, (match, startRef, atRef) => {
480+
const reference = startRef || atRef;
481+
480482
// this preliminary stuff is ultimately unnecessary
481483
// but might save time over later more complicated calculations
482484
// @nickname => mention, case insensitively

0 commit comments

Comments
 (0)