Configuring a Discord Bot
This guide explains how to setup and configure a Discord bot for the Bharat SahAIyak platform.
Getting Credentials
A discord bot requires a simple webhook as a credential. To get this webhook you need to create a server and a channel or have access to manage a channel.
Once you have that, you need to go to the settings of that channel (Gear Icon towards the extreme right).
In the settings menu, click on
Integrations
and selectCreate Webhook
.Select
New Webhook
and copy the webhook url.Set this webhook url as a secret with the key
webhookUrl
. See Setting Secret Credentials for details.
Here is a sample curl to set the secret:
curl --location 'UCI_API_BASE_URL/admin/secret' \
--header 'Authorization: YOUR_JWT_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"variableName": "YOUR_VARIABLE_NAME",
"secretBody": {
"webhookUrl": "YOUR_WEBHOOK_URL"
}
}'