zahmis пре 4 година
родитељ
комит
64eaf6bfac
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      packages/slackbot-proxy/src/services/RelationsService.ts

+ 2 - 2
packages/slackbot-proxy/src/services/RelationsService.ts

@@ -3,7 +3,7 @@ import { Inject, Service } from '@tsed/di';
 import axios from 'axios';
 import axios from 'axios';
 import { addHours } from 'date-fns';
 import { addHours } from 'date-fns';
 
 
-import { REQUEST_TIMEOUT_FOR_PTOG } from '@growi/slack';
+import { REQUEST_TIMEOUT_FOR_PTOG, getSupportedGrowiActionsRegExp } from '@growi/slack';
 import { Relation } from '~/entities/relation';
 import { Relation } from '~/entities/relation';
 import { RelationRepository } from '~/repositories/relation';
 import { RelationRepository } from '~/repositories/relation';
 
 
@@ -163,7 +163,7 @@ export class RelationsService {
     [...singleUse, ...broadCastUse].forEach(async(tempCommandName) => {
     [...singleUse, ...broadCastUse].forEach(async(tempCommandName) => {
 
 
       // ex. search OR search:handlerName
       // ex. search OR search:handlerName
-      const commandRegExp = new RegExp(`(^${tempCommandName}$)|(^${tempCommandName}:\\w+)`);
+      const commandRegExp = getSupportedGrowiActionsRegExp(tempCommandName);
       // skip this forEach loop if the requested command is not in permissionsForBroadcastUseCommands and permissionsForSingleUseCommands
       // skip this forEach loop if the requested command is not in permissionsForBroadcastUseCommands and permissionsForSingleUseCommands
       if (!commandRegExp.test(actionId) && !commandRegExp.test(callbackId)) {
       if (!commandRegExp.test(actionId) && !commandRegExp.test(callbackId)) {
         return;
         return;