Explorar o código

implement togetterCommand

itizawa %!s(int64=4) %!d(string=hai) anos
pai
achega
bd07338c90
Modificáronse 1 ficheiros con 18 adicións e 0 borrados
  1. 18 0
      src/server/service/slackbot.js

+ 18 - 0
src/server/service/slackbot.js

@@ -93,6 +93,24 @@ class SlackBotService extends S2sMessageHandlable {
     return;
   }
 
+  async togetterCommand(client, body, args, limit = 10) {
+    const reusult = await client.conversations.history({
+      channel: body.channel_id,
+      limit,
+    });
+    console.log(reusult);
+    const message = '*togetterCommand*';
+    client.chat.postEphemeral({
+      channel: body.channel_id,
+      user: body.user_id,
+      text: 'togetter',
+      blocks: [
+        this.generateMarkdownSectionBlock(message),
+      ],
+    });
+    return;
+  }
+
   getKeywords(args) {
     const keywordsArr = args.slice(1);
     const keywords = keywordsArr.join(' ');