JoSend uses slash command to send requests to the backend, and the backend takes care of all the functionalities, such as creating wallets, sending SOLs, etc. Therefore, this article will focus on how to create a slack slash command app.
Follow the official tutorial, Getting started, from Creating a Slack app to Installing your app.
Pay attention to Requesting scopes. We need 2 Bot Token Scopes:
-
chat:write
: enable the backend to send the responses to slack -
commands
: enable slash command.
Since we work on local machine, Slack doesn't know the IP address of your device. We need a proxy, ngrok. Let's install it.
Once you start your local JoSend, you can start ngrok.
ngrok http 3030
Following addresses will appear in the console. You can choose either of them (https is recommended) as the root URL.
Now, we can add slash commands. For example, let's create a /send-sol
command. The request URL is:
https://665a-176-158-55-131.ngrok.io/slack/send-sol
The full endpoints are shown in http://localhost:3030/api/#/slack.