# Custom bot with proxy settings
【Diagram】
To deploy a custom bot without proxy in your Slack workspace, you need to create and edit it on the Slack app. The steps are below.
# Create a Custom bot with proxy
- Go to the App Page (opens new window) of the Slack API and click Create An App button.
- Click From an app manifest.
- Select the workspace where you want to install the app and click Next.
- Paste the following App Manifest into the [YAML] tab, and click Next.
_metadata:
major_version: 1
minor_version: 1
display_information:
name: GROWI BOT
features:
bot_user:
display_name: GROWI BOT
always_online: false
slash_commands:
- command: /growi
url: https://{Slackbot Proxy domain name}/slack/commands
description: Test Bot
should_escape: false
unfurl_domains:
- {GROWI domain name}
oauth_config:
redirect_urls:
- https://{Slackbot Proxy domain name}/slack/oauth_redirect
scopes:
bot:
- channels:history
- channels:join
- chat:write
- chat:write.public
- commands
- groups:history
- im:history
- links:read
- links:write
- mpim:history
- team:read
settings:
event_subscriptions:
request_url: https://{Slackbot Proxy domain name}/slack/events
bot_events:
- link_shared
interactivity:
is_enabled: true
request_url: https://{Slackbot Proxy domain name}/slack/interactions
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false
- After reviewing the app overview, click Create to create the app.
# Start Slackbot Proxy
- Create a new file
.env.development.local
underpackages/slackbot-proxy
. - Please input any environment variable
SERVER_URI
into the created file above.
e.g. SERVER_URI=http://localhost:8080
- Additionally, select the bot you created from the App Page (opens new window) and check the items
Basic Information
>App Credentials
.
Add Client ID
, Client Secret
, Signing Secret
, .env.development.local
like below:
SERVER_URI={ URI Proxy }
SLACK_CLIENT_ID={ Client ID }
SLACK_CLIENT_SECRET={ Client Secret }
SLACK_SIGNING_SECRET={ Signing Secret }
Start both the GROWI main server and the proxy server(
slackbot-proxy
).
You can start the proxy server withyarn
andyarn dev
commands.Select Custom bot with proxy from the Slack Integration section of the admin panel.
# Install Custom bot with proxy in your Slack workspace
In the Slack App you have just created, go to Settings and click Manage distribution.
When all four items in Share Your App with Other Workspaces are checked, press Activate Public Distribution.
Click the Add to Slack button on the Embeddable Slack Button.
In the destination screen, click Allow.
If the message Congratulations! is displayed, the installation is complete.
Invite the GROWI bot to the channel you want to use by using @example.
WARNING
If the message Illegal state, try it again.
is displayed, press Go to install page, and then click Add to Slack button to install again.
Or, if the message GROWI Bot installation failed..
is displayed, press retry from the Add to Slack button.
# Register a Custom Bot with Proxy Service
Open the registration for the GROWI Custom Bot with proxy service. You will see that two access tokens have been generated for the various tokens in the Generate Access Token section. Access tokens can be reissued if necessary.
On Slack, type
/growi register
.Save the URL of the target GROWI in the GROWI URL of the displayed modal.
Enter the Access Token Proxy into GROWI and the Access Token GROWI to the Proxy issued above, then click the Submit button.
If successful, the URL of the proxy server will be displayed.
Enter the URL of the proxy server you obtained above into the Proxy URL of Custom Bot With Proxy Integration and update it.
# Run Connectivity Test of Custom Bot with Proxy
Click Test connection and input the Slack channel to which GROWI-Bot was invited.
Click on the Test button.
In case of success Successfully sent to Slack workspace. will be displayed in Logs. Green checkmarks will appear in red circles. Check the channel to which your GROWI-Bot was invited.
GROWI side
Slack side
In case of failure
See Error logs for connectivity test
Once you are all set up, see what you can do with a GROWI-bot