Skip to content

Commit

Permalink
fix: change regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-se committed Aug 18, 2021
1 parent 99df8fe commit 41a61c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shujinosuke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ const getListen = (client: SlackClient, event: SlackEvent) => {
case 'app_mention':
return (command: string, callback: (client: SlackClient, event: AppMentionEvent) => void) => {
const messageContent = event.text;
const commandRegExp = new RegExp(`<@\\w+>\\s+${command}`);
const commandRegExp = new RegExp(`<@\\w+>\\s+${command}($|\\s+)`);
console.log(commandRegExp);
if (messageContent.match(commandRegExp)) {
callback(client, event as AppMentionEvent);
Expand Down

0 comments on commit 41a61c8

Please sign in to comment.