This guide explains how to configure the Axion-Slack integration to send notifications to a new Slack channel using a bot.
First, you need to create a Slack App and a bot user within your Slack workspace.
chat:write: To send messages.files:write: To upload files.channels:read: To get a list of public channels.groups:read: To get a list of private channels.conversations:history: To read channel messages.xoxb-. Copy this token; you will need it in the next step.The Slack integration is configured in the config.yaml file at the root of the project.
Open config.yaml: Locate and open the config.yaml file in the project's root directory.
Find the slack section: Look for the slack: block in the file. It will look similar to this:
# Slack is a messaging app for business.
slack:
appid: A08NH6UNN5T
clientid: 104060942197.8765232770197
clientsecret: 6efefcc7a155038e5bdf8ca7a2cce798
signingsecret: 3efcab2bcfbbf2b80e45e86cd1613ec9
verificationtoken: xIVwCAQJnSX0MBUxm6BvSsVS
bottoken: xoxb-104060942197-8781485286689-Nx0SBbqSbmo7vukW7j9gRvQA
channel: monitor
Update the configuration:
bottoken with the new token you copied from the Slack API page.channel to the name of the channel you want the bot to post messages to (e.g., alerts, general). Make sure the channel name is correct and does not include the # prefix.Your updated section should look like this:
slack:
# ... other keys
bottoken: xoxb-YOUR-NEW-BOT-TOKEN-HERE
channel: your-new-channel-name
The bot must be a member of the channel it needs to post in.
/invite @your-bot-name (e.g., /invite @Axion Notifier) and send the message.For the changes to take effect, you must restart any running Axion services that handle notifications, such as ServeNotify or other related services.
Once restarted, the application will use the new bot token and send notifications to the newly configured channel.