|
@@ -74,21 +74,6 @@ class BoltService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
init() {
|
|
init() {
|
|
|
- // Example of listening for event
|
|
|
|
|
- // See. https://github.com/slackapi/bolt-js#listening-for-events
|
|
|
|
|
- // or https://slack.dev/bolt-js/concepts#basic
|
|
|
|
|
- this.bolt.command('/growi-bot', async({ command, ack, say }) => { // demo
|
|
|
|
|
- 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}`);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
this.bolt.command('/growi', async({
|
|
this.bolt.command('/growi', async({
|
|
|
command, client, body, ack,
|
|
command, client, body, ack,
|
|
|
}) => {
|
|
}) => {
|
|
@@ -204,7 +189,7 @@ class BoltService {
|
|
|
this.generateMarkdownSectionBlock('`-tag:wiki` \n Exclude pages with wiki tag'),
|
|
this.generateMarkdownSectionBlock('`-tag:wiki` \n Exclude pages with wiki tag'),
|
|
|
],
|
|
],
|
|
|
});
|
|
});
|
|
|
- return;
|
|
|
|
|
|
|
+ return { resultPaths: [] };
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const resultPaths = results.data.map((data) => {
|
|
const resultPaths = results.data.map((data) => {
|
|
@@ -223,9 +208,10 @@ class BoltService {
|
|
|
|
|
|
|
|
const keywords = this.getKeywords(args);
|
|
const keywords = this.getKeywords(args);
|
|
|
|
|
|
|
|
- if (resultPaths == null) {
|
|
|
|
|
|
|
+ if (resultPaths.length === 0) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
const base = this.crowi.appService.getSiteUrl();
|
|
const base = this.crowi.appService.getSiteUrl();
|
|
|
|
|
|
|
|
const urls = resultPaths.map((path) => {
|
|
const urls = resultPaths.map((path) => {
|
|
@@ -271,7 +257,7 @@ class BoltService {
|
|
|
};
|
|
};
|
|
|
// show "Next" button if next page exists
|
|
// show "Next" button if next page exists
|
|
|
if (resultsTotal > offset + PAGINGLIMIT) {
|
|
if (resultsTotal > offset + PAGINGLIMIT) {
|
|
|
- actionBlocks.elements.push(
|
|
|
|
|
|
|
+ actionBlocks.elements.unshift(
|
|
|
{
|
|
{
|
|
|
type: 'button',
|
|
type: 'button',
|
|
|
text: {
|
|
text: {
|