Преглед изворни кода

apply sendNotPermittedMessage

zahmis пре 4 година
родитељ
комит
225d1c1af8
1 измењених фајлова са 1 додато и 13 уклоњено
  1. 1 13
      packages/slackbot-proxy/src/controllers/slack.ts

+ 1 - 13
packages/slackbot-proxy/src/controllers/slack.ts

@@ -246,19 +246,7 @@ export class SlackCtrl {
       console.log('hoge');
 
 
-      // send postEphemral message for not permitted
-      const botToken = relations[0].installation?.data.bot?.token;
-
-      // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
-      const client = generateWebClient(botToken!);
-      await client.chat.postEphemeral({
-        text: 'Error occured.',
-        channel: body.channel_id,
-        user: body.user_id,
-        blocks: [
-          markdownSectionBlock(`It is not allowed to run *'${growiCommand.growiCommandType}'* command to this GROWI.`),
-        ],
-      });
+      await this.sendNotPermissionMessage(body, relations, growiCommand.growiCommandType);
     }
   }