A Discord bot built in Rust for substance search functionality.
The project is organized into the following modules:
substancesearch-core
: Core bot functionality and structuressubstancesearch-commands
: Command implementations
-
Install Rust and Cargo (if not already installed)
-
Clone this repository
-
Create a Discord application and bot at Discord Developer Portal
-
Configure the bot using one of these methods:
- Copy
config.example.toml
toconfig.toml
- Edit
config.toml
with your bot token and optional guild ID
[discord] token = "your-bot-token-here" # Optional: Guild ID for development # guild_id = "your-guild-id-here"
Set the following environment variables:
export BOT_DISCORD_TOKEN="your-bot-token" # Optional: For guild-specific command registration during development export BOT_DISCORD_GUILD_ID="your-guild-id"
You can also specify a custom config file path:
export CONFIG_PATH="/path/to/your/config.toml"
- Copy
cargo build
cargo run
/help
- Shows information about available commands
The bot supports both global and guild-specific command registration. For development, it's recommended to use guild-specific commands as they update instantly. Set the guild ID in your configuration to enable guild-specific command registration.
MIT