2
0
zahmis 5 жил өмнө
parent
commit
8286f2f778

+ 2 - 2
packages/slack/src/utils/slash-command-parser.ts

@@ -1,7 +1,7 @@
 import { SlashCommand } from '@slack/bolt';
 import { SlashCommand } from '@slack/bolt';
 
 
-import { GrowiCommand } from '~/interfaces/growi-command';
-import { InvalidGrowiCommandError } from '~/models/errors';
+import { GrowiCommand } from '../interfaces/growi-command';
+import { InvalidGrowiCommandError } from '../models/errors';
 
 
 export const parse = (slashCommand: SlashCommand): GrowiCommand => {
 export const parse = (slashCommand: SlashCommand): GrowiCommand => {
   const splitted = slashCommand.text.split(' ');
   const splitted = slashCommand.text.split(' ');

+ 3 - 1
packages/slackbot-proxy/src/services/RecieveService.ts

@@ -1,11 +1,13 @@
 import { Service } from '@tsed/di';
 import { Service } from '@tsed/di';
 import { SlashCommand } from '@slack/bolt';
 import { SlashCommand } from '@slack/bolt';
+import { parse } from '../../../slack/src/utils/slash-command-parser';
 
 
 @Service()
 @Service()
 export class ReceiveService {
 export class ReceiveService {
 
 
   receiveContentsFromSlack(body:SlashCommand) : string {
   receiveContentsFromSlack(body:SlashCommand) : string {
-    if (body.text === 'register') {
+    const parseBody = parse(body);
+    if (parseBody.growiCommandType === 'register') {
       console.log('register action occured');
       console.log('register action occured');
       return 'register action occurd';
       return 'register action occurd';
     }
     }