|
@@ -45,6 +45,7 @@ class BoltReciever {
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ console.log(event);
|
|
|
await this.bolt.processEvent(event);
|
|
await this.bolt.processEvent(event);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -119,18 +120,20 @@ class BoltService {
|
|
|
return this.createPageInGrowi(view);
|
|
return this.createPageInGrowi(view);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- this.bolt.action('button_click', async({ body, ack, say }) => {
|
|
|
|
|
|
|
+ this.bolt.action('button_click', async({
|
|
|
|
|
+ body, ack, say, respond, action,
|
|
|
|
|
+ }) => {
|
|
|
await ack();
|
|
await ack();
|
|
|
- this.shareSeachResults(say);
|
|
|
|
|
|
|
+ // await say('clicked the button');
|
|
|
|
|
+ console.log('action', action);
|
|
|
|
|
+ await respond({
|
|
|
|
|
+ response_type: 'in_channel',
|
|
|
|
|
+ text: action.value,
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async shareSeachResults(say) {
|
|
|
|
|
- await say('clicked the button');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
notCommand(command) {
|
|
notCommand(command) {
|
|
|
logger.error('Input first arguments');
|
|
logger.error('Input first arguments');
|
|
|
return this.client.chat.postEphemeral({
|
|
return this.client.chat.postEphemeral({
|
|
@@ -143,7 +146,7 @@ class BoltService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async searchResults(command, args) {
|
|
|
|
|
|
|
+ async getSearchResultPaths(command, args) {
|
|
|
const firstKeyword = args[1];
|
|
const firstKeyword = args[1];
|
|
|
if (firstKeyword == null) {
|
|
if (firstKeyword == null) {
|
|
|
return this.client.chat.postEphemeral({
|
|
return this.client.chat.postEphemeral({
|
|
@@ -177,6 +180,12 @@ class BoltService {
|
|
|
return data._source.path;
|
|
return data._source.path;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ return resultPaths;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ async searchResults(command, args) {
|
|
|
|
|
+ const resultPaths = await this.getSearchResultPaths(command, args);
|
|
|
|
|
+
|
|
|
try {
|
|
try {
|
|
|
await this.client.chat.postEphemeral({
|
|
await this.client.chat.postEphemeral({
|
|
|
channel: command.channel_id,
|
|
channel: command.channel_id,
|
|
@@ -195,6 +204,7 @@ class BoltService {
|
|
|
},
|
|
},
|
|
|
style: 'primary',
|
|
style: 'primary',
|
|
|
action_id: 'button_click',
|
|
action_id: 'button_click',
|
|
|
|
|
+ value: 'aaaa',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|