zahmis 5 лет назад
Родитель
Сommit
89117495ac
1 измененных файлов с 7 добавлено и 6 удалено
  1. 7 6
      packages/slack/src/utils/slash-command-parser.ts

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

@@ -1,17 +1,18 @@
 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 => {
-  const splitted = slashCommand.text.split(' ');
-  if (splitted.length < 2) {
+  console.log(slashCommand);
+  const splitted = slashCommand.command.split(' ');
+  if (splitted.length < 1) {
     throw new InvalidGrowiCommandError('The SlashCommand.text does not specify GrowiCommand type');
   }
 
   return {
     text: slashCommand.text,
-    growiCommandType: splitted[0],
-    growiCommandArgs: splitted.slice(1),
+    growiCommandType: 'hoge',
+    growiCommandArgs: ['fugo'],
   };
 };