Slack Bot Mention Edge Function
The Slack Bot Mention Edge Function allows you to process mentions in Slack and respond accordingly.
Configuring Slack apps
For your bot to seamlessly interact with Slack, you'll need to configure Slack Apps:
- Navigate to the Slack Apps page.
- Under "Event Subscriptions," add the URL of the
slack-bot-mention
function and click to verify the URL. - The Edge function will respond, confirming that everything is set up correctly.
- Add
app-mention
in the events the bot will subscribe to.
Creating the Edge Function
Deploy the following code as an Edge function using the CLI:
_10supabase --project-ref nacho_slacker secrets \_10set SLACK_TOKEN=<xoxb-0000000000-0000000000-01010101010nacho101010>
Here's the code of the Edge Function, you can change the response to handle the text received: