Ver código fonte

add echo command

kaori 5 anos atrás
pai
commit
d1fc20bf0e
1 arquivos alterados com 8 adições e 0 exclusões
  1. 8 0
      src/server/service/bolt.js

+ 8 - 0
src/server/service/bolt.js

@@ -66,6 +66,14 @@ class BoltService {
     this.bolt.command('/growi-bot', async({ command, ack, say }) => { // demo
     this.bolt.command('/growi-bot', async({ command, ack, say }) => { // demo
       await say('Hello');
       await say('Hello');
     });
     });
+
+    // The echo command simply echoes on command
+    this.bolt.command('/echo', async({ command, ack, say }) => {
+      // Acknowledge command request
+      await ack();
+
+      await say(`${command.text}`);
+    });
   }
   }
 
 
 }
 }