Skip to main content

constants

Props

NameTypeDescription
ChannelTypesRecord<string, string | number>Channel types
ColorGeneratorColorGeneratorUtility module containing functions useful for generating colors from a given saturation
CSSVariablesRecord<string, string>CSS variables
EndpointsRecord<string, unknown>Endpoints
GuildFeaturesRecord<string, string>Guild features
MessageFlagsRecord<string, string>Message flags
PathsRecord<string, string>Web routes
PermissionsRecord<string, bigint>Permissions
rawRecord<string, unknown>Raw module with all constants; check out its contents with Discord DevTools
RoutesRecord<string, unknown>Routes
RPCCommandsRecord<string, string>RPC commands
RPCErrorsRecord<string, string | number>RPC close codes
RPCEventsRecord<string, string>RPC events
ScopesRecord<string, string>OAuth 2.0 scopes
StatusRecord<string, string>User statuses
ThemesRecord<string, string>Client themes; alias of constants.ColorGenerator.themes
UserFlagsRecord<string, number>User flags

Types

ColorGenerator

Example:

In the following example we will generate a color based on the original value of the BACKGROUND_PRIMARY variable but with the saturation multiplied by 2.

import { common } from "replugged";
const { constants } = common;
const { ColorGenerator, Themes } = constants;

ColorGenerator.colors.BACKGROUND_PRIMARY.resolve({ theme: Themes.DARK, saturation: 2 });

Props:

NameTypeDescription
colorsRecord<string, Color>Contains all CSS variables with the corresponding function to generate a color based on a given saturation
radiiRecord<string, number>Contains border-radius values
shadowsRecord<string, ShadowColor>Contains all CSS variables for shadows with the corresponding function to get specific information
spacingRecord<string, string>Contains spacing values
themesRecord<string, string>Client themes
unsafe_rawColorsRecord<string, UnsafeRawColor>Contains all CSS variables for specific colors with the corresponding function to generate a color based on a given saturation