| Crates.io | factorion-bot-discord |
| lib.rs | factorion-bot-discord |
| version | 2.1.11 |
| created_at | 2025-10-19 22:28:16.115822+00 |
| updated_at | 2026-01-22 15:11:34.902615+00 |
| description | factorion-bot (for factorials and related) on Discord |
| homepage | |
| repository | https://github.com/tolik518/factorion-bot/ |
| max_upload_size | |
| id | 1891015 |
| size | 99,883 |
A Discord bot that automatically calculates factorials, subfactorials, and termials in messages.
This bot is part of the factorion-bot project and uses the shared factorion-lib for mathematical calculations.
5!, 10!)!5, !10)[termial] command)(3!)!)botcd factorion-bot
cargo build --release -p factorion-bot-discord
# The binary will be in target/release/factorion-bot-discord
Create a .env file in the project root (or in the factorion-bot-discord directory) with the following variables:
# Required
DISCORD_TOKEN=<your_discord_bot_token>
# Logging (recommended to reduce verbosity from serenity)
RUST_LOG=info,serenity=warn,tracing=warn
# Optional (with defaults shown)
FLOAT_PRECISION=1000
UPPER_CALCULATION_LIMIT=3000
UPPER_APPROXIMATION_LIMIT=1000000
UPPER_SUBFACTORIAL_LIMIT=100000
UPPER_TERMIAL_LIMIT=100000
UPPER_TERMIAL_APPROXIMATION_LIMIT=1000000
INTEGER_CONSTRUCTION_LIMIT=100000
NUMBER_DECIMALS_SCIENTIFIC=5
LOCALES_DIR=<directory_containing_locale_json_files>
INFLUXDB_HOST=localhost:8889
INFLUXDB_BUCKET=factorion-test
INFLUXDB_TOKEN=<token>
Run the bot with:
# If built from workspace
./target/release/factorion-bot-discord
# Or with cargo run
cargo run --release -p factorion-bot-discord
The bot will connect to Discord and start processing messages in servers where it has been invited.
The bot supports inline commands within messages:
[short] or [shorten] - Use scientific notation for shorter numbers[steps] or [all] - Show all intermediate calculation steps[termial] or [triangle] - Enable termial/triangular number calculations[no note] or [no_note] - Disable the footer note!short, !shorten, !steps, etc. - Alternative command formatYou can also use commands to disable features:
[long] - Disable shortening[no steps] or [no_steps] - Hide intermediate steps[no termial] or [no_termial] - Disable termial calculations[note] - Show the footer noteServer administrators with 'Manage Channels' permission can configure default settings per channel:
!factorion config - Show current channel configuration!factorion config shorten on/off - Enable/disable default shortening for the channel!factorion config no_note on/off - Enable/disable default no_note for the channelThese settings apply to all calculations in the channel unless overridden by inline commands in individual messages. Configuration is saved to channel_config.json and persists across bot restarts.
Message:
What is 5!?
Bot Reply:
5! = 120
Message:
Calculate 100!
Bot Reply:
100! = 9.3326 × 10^157
Message:
What about (3!)!?
Bot Reply:
(3!)! = 720
Message:
[steps] (3!)!
Bot Reply:
3! = 6
(3!)! = 6! = 720
Message:
What is !5?
Bot Reply:
!5 = 44
Message:
[termial] 10?
Bot Reply:
10? = 55
The bot listens to all messages in channels where it has access. When it detects a message containing factorial notation:
The bot will not respond to:
See the main CONTRIBUTING.md file in the repository root.
This project is licensed under the MIT License - see the LICENSE file for details.