📊 Constants Reference
All magic numbers and hardcoded values live in src/constants.js. Changing them there propagates throughout the codebase.
Time constants​
| Constant | Default | Description |
|---|---|---|
EPHEMERAL_MESSAGE_LIFETIME_MS | 12,000 | How long temp messages display before auto-delete (ms) |
CHANNEL_DELETE_GRACE_PERIOD_MS | 3,000 | Pause before deleting a closed ticket channel (ms) |
DEFAULT_SELECTION_TIMEOUT_MS | 60,000 | Default time for ticket type selection (ms) |
DEFAULT_COOLDOWN_MS | 60,000 | Default per-user cooldown between tickets (ms) |
Message fetching​
| Constant | Default | Description |
|---|---|---|
MESSAGE_BATCH_SIZE | 100 | Messages fetched per API call |
MAX_TRANSCRIPT_MESSAGES | 500 | Maximum messages fetched for a transcript |
Validation limits​
| Constant | Value | Description |
|---|---|---|
MAX_TICKET_TYPES | 9 | Maximum ticket types (limited by number emojis) |
MAX_CHANNEL_NAME_LENGTH | 100 | Maximum channel name length |
MAX_USERNAME_LENGTH | 20 | Maximum sanitized username in channel name |
MIN_TYPE_ID_LENGTH | 2 | Minimum ticket type ID length |
MAX_TYPE_ID_LENGTH | 32 | Maximum ticket type ID length |
Embed colours​
| Constant | Hex | Use |
|---|---|---|
DEFAULT_COLOR | 0x5865F2 | Default blurple |
ERROR_COLOR | 0xED4245 | Error embeds |
WARNING_COLOR | 0xFEE75C | Warning embeds |
SUCCESS_COLOR | 0x57F287 | Success embeds |
Snowflake constants​
| Constant | Value | Description |
|---|---|---|
FLUXER_EPOCH | 1420070400000n | Fluxer epoch (ms, as BigInt) |
SNOWFLAKE_TIMESTAMP_SHIFT | 22n | Bits to shift for timestamp extraction |
SNOWFLAKE_SHORT_ID_MASK | 0x3fffn | Mask for extracting 4-digit ticket number |
Regular expressions​
| Constant | Pattern | Matches |
|---|---|---|
TICKET_ID_PATTERN | /^[a-z0-9-]+$/ | Valid ticket type IDs |
SNOWFLAKE_PATTERN | /^\d{17,20}$/ | Fluxer snowflake IDs |
HEX_COLOR_PATTERN | /^[0-9a-fA-F]{6}$/ | 6-char hex colours |
BOT_TOKEN_PATTERN | /^[\w.-]{30,}$/ | Bot token format |
CDN & API​
| Constant | Value |
|---|---|
DEFAULT_API_BASE_URL | https://api.fluxer.app/v1 |
USER_AGENT | FluxerTicketBot/2.1.0 |
CDN_AVATAR_BASE | https://fluxerusercontent.com/avatars |
CDN_STATIC_BASE | https://fluxerstatic.com/avatars |