alt-text-slack-bot
aims to encourage accessible image sharing in a Slack workspace. When configured and added to a workspace, this Slack bot will detect when an image file has been shared in a channel without alternative text. It will send a friendly reminder that can only be seen by the user who posted the image along with instructions on how to add the alternative text.
This repo contains the code for the bot setup and should be customized to fit your workspace needs. For a comprehensive guide on the process of setting up a Slack app and installing it in a workspace, check out a fantastic tutorial by @lukeocodes
at DEV: Guy's Bot - Inclusive Language in Slack.
The alt text feature in Slack is relatively new and hidden so a lot of people don't know about it or forget to use it. This bot was created to ensure that images are accessible to everyone, including channel members who are blind or have low-vision. This bot eliminates the potential burden of individual members having to remind people to add alt text.
- messages:channels: allows subscription to receive events of messages that are posted to the channel.
- chat:write: send messages as your configured Slack bot.
Fetch the following tokens on the admin panel of your newly created Slack app page:
SLACK_TOKEN
: fetchBot User OAuth Token
in the OAuth and Permissions tab.SLACK_SIGNING_SECRET
: fetchSigning secret
in the Basic Information tab.
- If you prefer not to experiment with a Slack app in an active workspace, you can create a free test workspace.
- Customize the bot message by updating
utils.ts
.