zahmis 5 ani în urmă
părinte
comite
667671b2a0
1 a modificat fișierele cu 7 adăugiri și 7 ștergeri
  1. 7 7
      src/server/service/bolt.js

+ 7 - 7
src/server/service/bolt.js

@@ -84,12 +84,12 @@ class BoltService {
 
 
     this.bolt.command('/growi', async({ command, ack }) => {
     this.bolt.command('/growi', async({ command, ack }) => {
       await ack();
       await ack();
-      const inputSlack = command.text.split(' ');
-      const firstArg = inputSlack[0];
+      const args = command.text.split(' ');
+      const firstArg = args[0];
 
 
       switch (firstArg) {
       switch (firstArg) {
         case 'search':
         case 'search':
-          this.searchResults(command, inputSlack);
+          this.searchResults(command, args);
           break;
           break;
 
 
         default:
         default:
@@ -112,11 +112,11 @@ class BoltService {
 
 
   }
   }
 
 
-  async searchResults(command, inputSlack) {
-    const keyword = inputSlack[1];
+  async searchResults(command, args) {
+    const keyword = args[1];
     // remove leading 'search'.
     // remove leading 'search'.
-    inputSlack.shift();
-    const replacedCommandText = inputSlack.join(' ');
+    args.shift();
+    const replacedCommandText = args.join(' ');
     if (keyword == null) {
     if (keyword == null) {
       return this.client.chat.postEphemeral({
       return this.client.chat.postEphemeral({
         channel: command.channel_id,
         channel: command.channel_id,