Skip to main content

📊 Constants Reference

All magic numbers and hardcoded values live in src/constants.js. Changing them there propagates throughout the codebase.


Time constants​

ConstantDefaultDescription
EPHEMERAL_MESSAGE_LIFETIME_MS12,000How long temp messages display before auto-delete (ms)
CHANNEL_DELETE_GRACE_PERIOD_MS3,000Pause before deleting a closed ticket channel (ms)
DEFAULT_SELECTION_TIMEOUT_MS60,000Default time for ticket type selection (ms)
DEFAULT_COOLDOWN_MS60,000Default per-user cooldown between tickets (ms)

Message fetching​

ConstantDefaultDescription
MESSAGE_BATCH_SIZE100Messages fetched per API call
MAX_TRANSCRIPT_MESSAGES500Maximum messages fetched for a transcript

Validation limits​

ConstantValueDescription
MAX_TICKET_TYPES9Maximum ticket types (limited by number emojis)
MAX_CHANNEL_NAME_LENGTH100Maximum channel name length
MAX_USERNAME_LENGTH20Maximum sanitized username in channel name
MIN_TYPE_ID_LENGTH2Minimum ticket type ID length
MAX_TYPE_ID_LENGTH32Maximum ticket type ID length

Embed colours​

ConstantHexUse
DEFAULT_COLOR0x5865F2Default blurple
ERROR_COLOR0xED4245Error embeds
WARNING_COLOR0xFEE75CWarning embeds
SUCCESS_COLOR0x57F287Success embeds

Snowflake constants​

ConstantValueDescription
FLUXER_EPOCH1420070400000nFluxer epoch (ms, as BigInt)
SNOWFLAKE_TIMESTAMP_SHIFT22nBits to shift for timestamp extraction
SNOWFLAKE_SHORT_ID_MASK0x3fffnMask for extracting 4-digit ticket number

Regular expressions​

ConstantPatternMatches
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​

ConstantValue
DEFAULT_API_BASE_URLhttps://api.fluxer.app/v1
USER_AGENTFluxerTicketBot/2.1.0
CDN_AVATAR_BASEhttps://fluxerusercontent.com/avatars
CDN_STATIC_BASEhttps://fluxerstatic.com/avatars