Customizing Your Bot
Customizing Your Bot
config/bot.yml
will house the configurations specific to your bot. The below config is for a bot named mybot.
name: mybot
# chat applications
chat_application: slack
# Slack chat application specific fields.
# required
slack_token: ${SLACK_TOKEN}
slack_signing_secret: ${SLACK_SIGNING_SECRET}
# Discord chat application specific fields.
# required
discord_token: ${DISCORD_TOKEN}
# system
cli: true
# true: enables ability to turn on CLI mode.
# false: disables ability to turn on CLI mode.
scheduler: false
# true: enables rule scheduling
# false: disables rule scheduling
debug: true
# true: enable logging to console
# false: disable logging
metrics: true
# true: enable metrics collection through prometheus
# false: disable metrics collection through prometheus
custom_help_text: "Sorry, I didn't get that. Try sending me one of the following commands: \n `cats` \n `today`"
# set this field to set custom fallback help text for your bot, if it is unset it will send a generic help message with rules and their usage.
- name - (optional string) - the username of your bot. This is just used for logging purposes.
- chat_application (required string) - denotes the chat application we're using, so far we only support Slack and Discord.
- slack_token (required string) - is a placeholder that the flottbot binary will parse to read in the
SLACK_TOKEN
environment variable when the bot runs. This token can be found on the bot user configuration page and usually starts withxoxb
- slack_signing_secret (optional string) - required if you are using your bot with the Events API.
- Set up your integration as a Custom Slack Application, add the Bot integration to the app and you will receive a token for your bot in the "Bot User OAuth Access Token" section and a token for your workspace in the "OAuth Access Token" section.
- discord_token (optional string) is a placeholder that the flottbot binary will parse to read in the
DISCORD_TOKEN
environment variable when the bot runs. You will likely set that variable using a Kubernetes secret. - cli (optional boolean) - if this flag is set to true, the bot can be interacted in command line / terminal (useful for testing rules).
- scheduler (optional boolean) - if this flag is set to true, the bot will enable scheduled messages to be sent to specific channels/users.
- debug (optional boolean) - if this flag is set to true, the bot to log with more verbosity.
- metrics (optional string) - if this flag is set to true, the bot will expose metrics on rule executions on a local prometheus server endpoint.
- custom_help_text (optional string) - this is a global help text. Caution, if this field is set it will override all
help_text
fields set in your rules.