Backend Configuration¶
Each backend requires specific configuration. This guide covers all configuration options for each supported platform.
Slack Configuration¶
Required Settings¶
from chatom.slack import SlackConfig
config = SlackConfig(
bot_token="xoxb-your-bot-token", # Required
)
All Options¶
from chatom.slack import SlackConfig
config = SlackConfig(
# Authentication (required)
bot_token="xoxb-your-bot-token",
# Socket Mode (for real-time events)
app_token="xapp-your-app-token",
socket_mode=True,
# Request verification
signing_secret="your-signing-secret",
# Workspace settings
team_id="T123456",
default_channel="C123456",
)
Configuration Reference¶
Option |
Type |
Required |
Description |
|---|---|---|---|
|
|
Yes |
Bot OAuth token (xoxb-…) |
|
|
No |
App token for Socket Mode (xapp-…) |
|
|
No |
Enable Socket Mode for events |
|
|
No |
For request verification |
|
|
No |
Workspace/team ID |
|
|
No |
Default channel for messages |
Environment Variables¶
export SLACK_BOT_TOKEN="xoxb-your-token"
export SLACK_APP_TOKEN="xapp-your-app-token"
export SLACK_SIGNING_SECRET="your-secret"
import os
from chatom.slack import SlackConfig
config = SlackConfig(
bot_token=os.environ["SLACK_BOT_TOKEN"],
app_token=os.environ.get("SLACK_APP_TOKEN", ""),
)
Getting Slack Credentials¶
Go to api.slack.com/apps
Create a new app or select existing
Navigate to OAuth & Permissions
Add required scopes:
channels:read- Read channel infochannels:history- Read messageschat:write- Send messagesreactions:read- Read reactionsreactions:write- Add reactionsusers:read- Read user info
Install to workspace
Copy the Bot User OAuth Token
For Socket Mode:
Navigate to Socket Mode
Enable Socket Mode
Copy the App-Level Token
Discord Configuration¶
Required Settings¶
from chatom.discord import DiscordConfig
config = DiscordConfig(
bot_token="your-bot-token", # Required
)
All Options¶
from chatom.discord import DiscordConfig
config = DiscordConfig(
# Authentication (required)
bot_token="your-bot-token",
# Application settings
application_id="123456789",
# Default guild
guild_id="987654321",
# Gateway intents
intents=["guilds", "guild_messages", "message_content"],
# Command prefix (for bot commands)
command_prefix="!",
# Sharding (for large bots)
shard_id=0,
shard_count=1,
)
Configuration Reference¶
Option |
Type |
Required |
Description |
|---|---|---|---|
|
|
Yes |
Bot token from Developer Portal |
|
|
No |
Discord application ID |
|
|
No |
Default guild/server ID |
|
|
No |
Gateway intents to request |
|
|
No |
Prefix for bot commands |
|
|
No |
Shard ID for sharding |
|
|
No |
Total shard count |
Available Intents¶
Intent |
Description |
|---|---|
|
Guild create/update/delete events |
|
Member join/leave/update (privileged) |
|
Message events in guilds |
|
Access message content (privileged) |
|
Direct message events |
|
Reaction events in guilds |
Environment Variables¶
export DISCORD_TOKEN="your-bot-token"
export DISCORD_GUILD_ID="your-guild-id"
import os
from chatom.discord import DiscordConfig
config = DiscordConfig(
bot_token=os.environ["DISCORD_TOKEN"],
guild_id=os.environ.get("DISCORD_GUILD_ID", ""),
)
Getting Discord Credentials¶
Create a new application
Navigate to Bot
Click Add Bot
Enable required intents:
Server Members Intent (for member lookups)
Message Content Intent (for reading message content)
Copy the Token
Navigate to OAuth2 > URL Generator
Select scopes:
bot,applications.commandsSelect permissions as needed
Use the generated URL to invite bot to your server
Symphony Configuration¶
Required Settings¶
from chatom.symphony import SymphonyConfig
config = SymphonyConfig(
host="mycompany.symphony.com",
bot_username="my-bot",
bot_private_key_path="/path/to/private-key.pem",
)
All Options¶
from chatom.symphony import SymphonyConfig
from pydantic import SecretStr
config = SymphonyConfig(
# Pod configuration (required)
host="mycompany.symphony.com",
port=443,
scheme="https",
# Bot authentication (one required)
bot_username="my-bot",
bot_private_key_path="/path/to/private-key.pem",
# OR
bot_private_key_content=SecretStr("-----BEGIN RSA PRIVATE KEY-----..."),
# OR (certificate auth)
bot_certificate_path="/path/to/cert.pem",
bot_certificate_content=SecretStr("-----BEGIN CERTIFICATE-----..."),
# Separate endpoint hosts (optional)
agent_host="agent.mycompany.symphony.com",
session_auth_host="session.mycompany.symphony.com",
key_manager_host="km.mycompany.symphony.com",
# Proxy configuration
proxy_host="proxy.mycompany.com",
proxy_port=8080,
proxy_username="user",
proxy_password=SecretStr("password"),
# Connection settings
timeout=30,
max_attempts=10,
# Error handling
error_room="error-room-stream-id",
inform_client=True,
# Datafeed version
datafeed_version="v2",
)
Configuration Reference¶
Option |
Type |
Required |
Description |
|---|---|---|---|
|
|
Yes |
Symphony pod hostname |
|
|
No |
Pod port (default: 443) |
|
|
Yes |
Bot service account username |
|
|
* |
Path to RSA private key |
|
|
* |
RSA key content |
|
|
* |
Path to certificate |
|
|
* |
Certificate content |
|
|
No |
Separate agent hostname |
|
|
No |
Separate session auth host |
|
|
No |
Separate key manager host |
|
|
No |
Request timeout (seconds) |
|
|
No |
“v1” or “v2” |
*One authentication method required
Environment Variables¶
export SYMPHONY_HOST="mycompany.symphony.com"
export SYMPHONY_BOT_USERNAME="my-bot"
export SYMPHONY_BOT_PRIVATE_KEY_PATH="/path/to/key.pem"
# OR
export SYMPHONY_BOT_PRIVATE_KEY_CONTENT="-----BEGIN RSA PRIVATE KEY-----..."
import os
from chatom.symphony import SymphonyConfig
config = SymphonyConfig(
host=os.environ["SYMPHONY_HOST"],
bot_username=os.environ["SYMPHONY_BOT_USERNAME"],
bot_private_key_path=os.environ.get("SYMPHONY_BOT_PRIVATE_KEY_PATH"),
)
Getting Symphony Credentials¶
Contact your Symphony pod administrator
Request a bot service account
Generate an RSA key pair:
openssl genrsa -out private-key.pem 4096 openssl rsa -in private-key.pem -pubout -out public-key.pem
Provide the public key to your administrator
Receive your bot username and pod hostname
Configuration from Files¶
All backends support loading tokens from files:
# Slack - token file
config = SlackConfig(
bot_token="/path/to/bot-token.txt", # File path works too
)
# Discord - token file
config = DiscordConfig(
bot_token="/path/to/discord-token.txt",
)
Configuration Validation¶
Configurations are validated on creation:
from pydantic import ValidationError
from chatom.slack import SlackConfig
try:
config = SlackConfig(bot_token="invalid") # Missing xoxb- prefix
except ValidationError as e:
print(f"Invalid config: {e}")