File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,5 +49,11 @@ export default async function (msg: Message) {
4949 return ;
5050 }
5151
52- await msg . reply ( text ) ;
52+ const mentionIdRegExp : RegExp = / @ ( [ ^ \s ] + ) / g
53+ const mentions : string [ ] = [ ...text . matchAll ( mentionIdRegExp ) ] . map ( matchId => {
54+ if ( / ^ \+ ? \d + $ / . test ( matchId [ 1 ] ) ) return ( matchId [ 0 ] + "c.us" )
55+ return matchId [ 0 ]
56+ } ) ;
57+
58+ await msg . reply ( text , undefined , { mentions } ) ;
5359}
Original file line number Diff line number Diff line change @@ -60,5 +60,11 @@ export default async function (msg: Message) {
6060 return ;
6161 }
6262
63- await msg . reply ( text ) ;
63+ const mentionIdRegExp : RegExp = / @ ( [ ^ \s ] + ) / g
64+ const mentions : string [ ] = [ ...text . matchAll ( mentionIdRegExp ) ] . map ( matchId => {
65+ if ( / ^ \+ ? \d + $ / . test ( matchId [ 1 ] ) ) return ( matchId [ 0 ] + "c.us" )
66+ return matchId [ 0 ]
67+ } ) ;
68+
69+ await msg . reply ( text , undefined , { mentions } ) ;
6470}
Original file line number Diff line number Diff line change @@ -64,5 +64,11 @@ export default async function (msg: Message) {
6464 return ;
6565 }
6666
67- await msg . reply ( text ) ;
67+ const mentionIdRegExp : RegExp = / @ ( [ ^ \s ] + ) / g
68+ const mentions : string [ ] = [ ...text . matchAll ( mentionIdRegExp ) ] . map ( matchId => {
69+ if ( / ^ \+ ? \d + $ / . test ( matchId [ 1 ] ) ) return ( matchId [ 0 ] + "c.us" )
70+ return matchId [ 0 ]
71+ } ) ;
72+
73+ await msg . reply ( text , undefined , { mentions } ) ;
6874}
Original file line number Diff line number Diff line change @@ -50,5 +50,11 @@ export default async function (msg: Message) {
5050 return ;
5151 }
5252
53- await msg . reply ( text ) ;
53+ const mentionIdRegExp : RegExp = / @ ( [ ^ \s ] + ) / g
54+ const mentions : string [ ] = [ ...text . matchAll ( mentionIdRegExp ) ] . map ( matchId => {
55+ if ( / ^ \+ ? \d + $ / . test ( matchId [ 1 ] ) ) return ( matchId [ 0 ] + "c.us" )
56+ return matchId [ 0 ]
57+ } ) ;
58+
59+ await msg . reply ( text , undefined , { mentions } ) ;
5460}
You can’t perform that action at this time.
0 commit comments