initial commit

This commit is contained in:
Hampus Kraft
2026-01-01 20:42:59 +00:00
commit 2f557eda8c
9029 changed files with 1490197 additions and 0 deletions

View File

@@ -0,0 +1,285 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export const API_CODE_VERSION = 1;
export const APIErrorCodes = {
GENERAL_ERROR: 'GENERAL_ERROR',
UNKNOWN_CHANNEL: 'UNKNOWN_CHANNEL',
UNKNOWN_GUILD: 'UNKNOWN_GUILD',
UNKNOWN_INVITE: 'UNKNOWN_INVITE',
UNKNOWN_MEMBER: 'UNKNOWN_MEMBER',
UNKNOWN_MESSAGE: 'UNKNOWN_MESSAGE',
UNKNOWN_ROLE: 'UNKNOWN_ROLE',
UNKNOWN_USER: 'UNKNOWN_USER',
UNKNOWN_EMOJI: 'UNKNOWN_EMOJI',
UNKNOWN_PACK: 'UNKNOWN_PACK',
UNKNOWN_STICKER: 'UNKNOWN_STICKER',
UNKNOWN_WEBHOOK: 'UNKNOWN_WEBHOOK',
UNKNOWN_BETA_CODE: 'UNKNOWN_BETA_CODE',
UNKNOWN_FAVORITE_MEME: 'UNKNOWN_FAVORITE_MEME',
EXPLICIT_CONTENT_CANNOT_BE_SENT: 'EXPLICIT_CONTENT_CANNOT_BE_SENT',
MAX_GUILDS: 'MAX_GUILDS',
MAX_FRIENDS: 'MAX_FRIENDS',
MAX_PINS_PER_CHANNEL: 'MAX_PINS_PER_CHANNEL',
MAX_GUILD_ROLES: 'MAX_GUILD_ROLES',
MAX_WEBHOOKS: 'MAX_WEBHOOKS',
MAX_EMOJIS: 'MAX_EMOJIS',
MAX_STICKERS: 'MAX_STICKERS',
MAX_PACKS: 'MAX_PACKS',
MAX_REACTIONS: 'MAX_REACTIONS',
MAX_GUILD_CHANNELS: 'MAX_GUILD_CHANNELS',
MAX_CATEGORY_CHANNELS: 'MAX_CATEGORY_CHANNELS',
MAX_INVITES: 'MAX_INVITES',
MAX_ANIMATED_EMOJIS: 'MAX_ANIMATED_EMOJIS',
MAX_GUILD_MEMBERS: 'MAX_GUILD_MEMBERS',
MAX_WEBHOOKS_PER_GUILD: 'MAX_WEBHOOKS_PER_GUILD',
MAX_BETA_CODES_REACHED: 'MAX_BETA_CODES_REACHED',
RATE_LIMITED: 'RATE_LIMITED',
SLOWMODE_RATE_LIMITED: 'SLOWMODE_RATE_LIMITED',
CAPTCHA_REQUIRED: 'CAPTCHA_REQUIRED',
INVALID_CAPTCHA: 'INVALID_CAPTCHA',
UNAUTHORIZED: 'UNAUTHORIZED',
USER_BANNED_FROM_GUILD: 'USER_BANNED_FROM_GUILD',
USER_IP_BANNED_FROM_GUILD: 'USER_IP_BANNED_FROM_GUILD',
MISSING_ACCESS: 'MISSING_ACCESS',
CANNOT_EXECUTE_ON_DM: 'CANNOT_EXECUTE_ON_DM',
CANNOT_EDIT_OTHER_USER_MESSAGE: 'CANNOT_EDIT_OTHER_USER_MESSAGE',
CANNOT_SEND_EMPTY_MESSAGE: 'CANNOT_SEND_EMPTY_MESSAGE',
CANNOT_SEND_MESSAGES_TO_USER: 'CANNOT_SEND_MESSAGES_TO_USER',
CANNOT_SEND_MESSAGES_IN_NON_TEXT_CHANNEL: 'CANNOT_SEND_MESSAGES_IN_NON_TEXT_CHANNEL',
COMMUNICATION_DISABLED: 'COMMUNICATION_DISABLED',
MISSING_PERMISSIONS: 'MISSING_PERMISSIONS',
INVALID_FORM_BODY: 'INVALID_FORM_BODY',
CANNOT_MODIFY_SYSTEM_WEBHOOK: 'CANNOT_MODIFY_SYSTEM_WEBHOOK',
TWO_FACTOR_REQUIRED: 'TWO_FACTOR_REQUIRED',
FRIEND_REQUEST_BLOCKED: 'FRIEND_REQUEST_BLOCKED',
CANNOT_SEND_FRIEND_REQUEST_TO_BLOCKED_USER: 'CANNOT_SEND_FRIEND_REQUEST_TO_BLOCKED_USER',
BOTS_CANNOT_HAVE_FRIENDS: 'BOTS_CANNOT_HAVE_FRIENDS',
CANNOT_SEND_FRIEND_REQUEST_TO_SELF: 'CANNOT_SEND_FRIEND_REQUEST_TO_SELF',
NO_USERS_WITH_FLUXERTAG_EXIST: 'NO_USERS_WITH_FLUXERTAG_EXIST',
ALREADY_FRIENDS: 'ALREADY_FRIENDS',
DISCRIMINATOR_REQUIRED: 'DISCRIMINATOR_REQUIRED',
TWO_FA_NOT_ENABLED: 'TWO_FA_NOT_ENABLED',
MISSING_ACL: 'MISSING_ACL',
IP_BANNED: 'IP_BANNED',
IP_AUTHORIZATION_REQUIRED: 'IP_AUTHORIZATION_REQUIRED',
USER_NOT_IN_VOICE: 'USER_NOT_IN_VOICE',
CANNOT_MODIFY_VOICE_STATE: 'CANNOT_MODIFY_VOICE_STATE',
VOICE_CHANNEL_FULL: 'VOICE_CHANNEL_FULL',
ACCOUNT_DISABLED: 'ACCOUNT_DISABLED',
ACCOUNT_SCHEDULED_FOR_DELETION: 'ACCOUNT_SCHEDULED_FOR_DELETION',
TAG_ALREADY_TAKEN: 'TAG_ALREADY_TAKEN',
INVALID_PHONE_NUMBER: 'INVALID_PHONE_NUMBER',
PHONE_ALREADY_USED: 'PHONE_ALREADY_USED',
PHONE_VERIFICATION_REQUIRED: 'PHONE_VERIFICATION_REQUIRED',
INVALID_PHONE_VERIFICATION_CODE: 'INVALID_PHONE_VERIFICATION_CODE',
PHONE_RATE_LIMIT_EXCEEDED: 'PHONE_RATE_LIMIT_EXCEEDED',
SMS_MFA_NOT_ENABLED: 'SMS_MFA_NOT_ENABLED',
SMS_MFA_REQUIRES_TOTP: 'SMS_MFA_REQUIRES_TOTP',
PHONE_REQUIRED_FOR_SMS_MFA: 'PHONE_REQUIRED_FOR_SMS_MFA',
INVALID_WEBAUTHN_CREDENTIAL: 'INVALID_WEBAUTHN_CREDENTIAL',
WEBAUTHN_CREDENTIAL_LIMIT_REACHED: 'WEBAUTHN_CREDENTIAL_LIMIT_REACHED',
UNKNOWN_WEBAUTHN_CREDENTIAL: 'UNKNOWN_WEBAUTHN_CREDENTIAL',
PASSKEY_AUTHENTICATION_FAILED: 'PASSKEY_AUTHENTICATION_FAILED',
PASSKEYS_DISABLED: 'PASSKEYS_DISABLED',
GUILD_VERIFICATION_REQUIRED: 'GUILD_VERIFICATION_REQUIRED',
ACCOUNT_SUSPICIOUS_ACTIVITY: 'ACCOUNT_SUSPICIOUS_ACTIVITY',
PREMIUM_PURCHASE_BLOCKED: 'PREMIUM_PURCHASE_BLOCKED',
PREMIUM_REQUIRED: 'PREMIUM_REQUIRED',
HARVEST_ON_COOLDOWN: 'HARVEST_ON_COOLDOWN',
HARVEST_EXPIRED: 'HARVEST_EXPIRED',
HARVEST_FAILED: 'HARVEST_FAILED',
HARVEST_NOT_READY: 'HARVEST_NOT_READY',
UNKNOWN_HARVEST: 'UNKNOWN_HARVEST',
CHANNEL_INDEXING: 'CHANNEL_INDEXING',
AUDIT_LOG_INDEXING: 'AUDIT_LOG_INDEXING',
UNKNOWN_GIFT_CODE: 'UNKNOWN_GIFT_CODE',
GIFT_CODE_ALREADY_REDEEMED: 'GIFT_CODE_ALREADY_REDEEMED',
STRIPE_ERROR: 'STRIPE_ERROR',
STRIPE_WEBHOOK_SIGNATURE_MISSING: 'STRIPE_WEBHOOK_SIGNATURE_MISSING',
STRIPE_WEBHOOK_SIGNATURE_INVALID: 'STRIPE_WEBHOOK_SIGNATURE_INVALID',
USER_OWNS_GUILDS: 'USER_OWNS_GUILDS',
FEATURE_TEMPORARILY_DISABLED: 'FEATURE_TEMPORARILY_DISABLED',
INVITES_DISABLED: 'INVITES_DISABLED',
GUILD_DISALLOWS_UNCLAIMED_ACCOUNTS: 'GUILD_DISALLOWS_UNCLAIMED_ACCOUNTS',
TEMPORARY_INVITE_REQUIRES_PRESENCE: 'TEMPORARY_INVITE_REQUIRES_PRESENCE',
MAX_GROUP_DM_RECIPIENTS: 'MAX_GROUP_DM_RECIPIENTS',
MAX_GROUP_DMS: 'MAX_GROUP_DMS',
NOT_FRIENDS_WITH_USER: 'NOT_FRIENDS_WITH_USER',
INVALID_CHANNEL_TYPE: 'INVALID_CHANNEL_TYPE',
NSFW_CONTENT_AGE_RESTRICTED: 'NSFW_CONTENT_AGE_RESTRICTED',
FILE_SIZE_TOO_LARGE: 'FILE_SIZE_TOO_LARGE',
CANNOT_REPORT_OWN_MESSAGE: 'CANNOT_REPORT_OWN_MESSAGE',
CANNOT_REPORT_YOURSELF: 'CANNOT_REPORT_YOURSELF',
CANNOT_REPORT_OWN_GUILD: 'CANNOT_REPORT_OWN_GUILD',
REPORT_BANNED: 'REPORT_BANNED',
MAX_BOOKMARKS: 'MAX_BOOKMARKS',
MAX_PACK_EXPRESSIONS: 'MAX_PACK_EXPRESSIONS',
MAX_FAVORITE_MEMES: 'MAX_FAVORITE_MEMES',
CANNOT_REDEEM_PLUTONIUM_WITH_VISIONARY: 'CANNOT_REDEEM_PLUTONIUM_WITH_VISIONARY',
NO_VISIONARY_SLOTS_AVAILABLE: 'NO_VISIONARY_SLOTS_AVAILABLE',
CANNOT_SHRINK_RESERVED_SLOTS: 'CANNOT_SHRINK_RESERVED_SLOTS',
MEDIA_METADATA_ERROR: 'MEDIA_METADATA_ERROR',
NO_ACTIVE_CALL: 'NO_ACTIVE_CALL',
CALL_ALREADY_EXISTS: 'CALL_ALREADY_EXISTS',
INVALID_CHANNEL_TYPE_FOR_CALL: 'INVALID_CHANNEL_TYPE_FOR_CALL',
UNCLAIMED_ACCOUNT_RESTRICTED: 'UNCLAIMED_ACCOUNT_RESTRICTED',
INVALID_CLIENT: 'INVALID_CLIENT',
INVALID_REQUEST: 'INVALID_REQUEST',
INVALID_SCOPE: 'INVALID_SCOPE',
UNSUPPORTED_RESPONSE_TYPE: 'UNSUPPORTED_RESPONSE_TYPE',
INVALID_GRANT: 'INVALID_GRANT',
ACCESS_DENIED: 'ACCESS_DENIED',
INVALID_TOKEN: 'INVALID_TOKEN',
SUDO_MODE_REQUIRED: 'SUDO_MODE_REQUIRED',
INVALID_SUDO_TOKEN: 'INVALID_SUDO_TOKEN',
INSTANCE_VERSION_MISMATCH: 'INSTANCE_VERSION_MISMATCH',
INVALID_HANDOFF_CODE: 'INVALID_HANDOFF_CODE',
HANDOFF_CODE_EXPIRED: 'HANDOFF_CODE_EXPIRED',
NO_ACTIVE_SUBSCRIPTION: 'NO_ACTIVE_SUBSCRIPTION',
UNKNOWN_VOICE_REGION: 'UNKNOWN_VOICE_REGION',
UNKNOWN_VOICE_SERVER: 'UNKNOWN_VOICE_SERVER',
UNKNOWN_REPORT: 'UNKNOWN_REPORT',
REPORT_ALREADY_RESOLVED: 'REPORT_ALREADY_RESOLVED',
TEST_HARNESS_DISABLED: 'TEST_HARNESS_DISABLED',
TEST_HARNESS_FORBIDDEN: 'TEST_HARNESS_FORBIDDEN',
EMAIL_SERVICE_NOT_TESTABLE: 'EMAIL_SERVICE_NOT_TESTABLE',
INVALID_FLAGS_FORMAT: 'INVALID_FLAGS_FORMAT',
INVALID_ACLS_FORMAT: 'INVALID_ACLS_FORMAT',
ACLS_MUST_BE_NON_EMPTY: 'ACLS_MUST_BE_NON_EMPTY',
UNKNOWN_USER_FLAG: 'UNKNOWN_USER_FLAG',
UNKNOWN_SUSPICIOUS_FLAG: 'UNKNOWN_SUSPICIOUS_FLAG',
INVALID_SUSPICIOUS_FLAGS_FORMAT: 'INVALID_SUSPICIOUS_FLAGS_FORMAT',
NO_PENDING_DELETION: 'NO_PENDING_DELETION',
INVALID_TIMESTAMP: 'INVALID_TIMESTAMP',
INVALID_BOT_FLAG: 'INVALID_BOT_FLAG',
INVALID_SYSTEM_FLAG: 'INVALID_SYSTEM_FLAG',
MISSING_OAUTH_FIELDS: 'MISSING_OAUTH_FIELDS',
DELETION_FAILED: 'DELETION_FAILED',
PROCESSING_FAILED: 'PROCESSING_FAILED',
UPDATE_FAILED: 'UPDATE_FAILED',
CREATION_FAILED: 'CREATION_FAILED',
INVALID_DSA_REPORT_TARGET: 'INVALID_DSA_REPORT_TARGET',
INVALID_DSA_TICKET: 'INVALID_DSA_TICKET',
INVALID_DSA_VERIFICATION_CODE: 'INVALID_DSA_VERIFICATION_CODE',
PACK_ACCESS_DENIED: 'PACK_ACCESS_DENIED',
INVALID_PACK_TYPE: 'INVALID_PACK_TYPE',
} as const;
export const AdminACLs = {
WILDCARD: '*',
AUTHENTICATE: 'admin:authenticate',
GATEWAY_MEMORY_STATS: 'gateway:memory_stats',
GATEWAY_RELOAD_ALL: 'gateway:reload_all',
USER_LOOKUP: 'user:lookup',
USER_LIST_SESSIONS: 'user:list:sessions',
USER_LIST_GUILDS: 'user:list:guilds',
USER_TERMINATE_SESSIONS: 'user:terminate:sessions',
USER_UPDATE_MFA: 'user:update:mfa',
USER_UPDATE_AVATAR: 'user:update:avatar',
USER_UPDATE_BANNER: 'user:update:banner',
USER_UPDATE_PROFILE: 'user:update:profile',
USER_UPDATE_BOT_STATUS: 'user:update:bot_status',
USER_UPDATE_EMAIL: 'user:update:email',
USER_UPDATE_PHONE: 'user:update:phone',
USER_UPDATE_DOB: 'user:update:dob',
USER_UPDATE_USERNAME: 'user:update:username',
USER_UPDATE_FLAGS: 'user:update:flags',
USER_UPDATE_SUSPICIOUS_ACTIVITY: 'user:update:suspicious_activity',
USER_TEMP_BAN: 'user:temp_ban',
USER_DISABLE_SUSPICIOUS: 'user:disable:suspicious',
USER_DELETE: 'user:delete',
USER_CANCEL_BULK_MESSAGE_DELETION: 'user:cancel:bulk_message_deletion',
BETA_CODES_GENERATE: 'beta_codes:generate',
GIFT_CODES_GENERATE: 'gift_codes:generate',
GUILD_LOOKUP: 'guild:lookup',
GUILD_LIST_MEMBERS: 'guild:list:members',
GUILD_RELOAD: 'guild:reload',
GUILD_SHUTDOWN: 'guild:shutdown',
GUILD_DELETE: 'guild:delete',
GUILD_UPDATE_NAME: 'guild:update:name',
GUILD_UPDATE_ICON: 'guild:update:icon',
GUILD_UPDATE_BANNER: 'guild:update:banner',
GUILD_UPDATE_SPLASH: 'guild:update:splash',
GUILD_UPDATE_VANITY: 'guild:update:vanity',
GUILD_UPDATE_FEATURES: 'guild:update:features',
GUILD_UPDATE_SETTINGS: 'guild:update:settings',
GUILD_TRANSFER_OWNERSHIP: 'guild:transfer_ownership',
GUILD_FORCE_ADD_MEMBER: 'guild:force_add_member',
ASSET_PURGE: 'asset:purge',
MESSAGE_LOOKUP: 'message:lookup',
MESSAGE_DELETE: 'message:delete',
MESSAGE_SHRED: 'message:shred',
MESSAGE_DELETE_ALL: 'message:delete_all',
BAN_IP_CHECK: 'ban:ip:check',
BAN_IP_ADD: 'ban:ip:add',
BAN_IP_REMOVE: 'ban:ip:remove',
BAN_EMAIL_CHECK: 'ban:email:check',
BAN_EMAIL_ADD: 'ban:email:add',
BAN_EMAIL_REMOVE: 'ban:email:remove',
BAN_PHONE_CHECK: 'ban:phone:check',
BAN_PHONE_ADD: 'ban:phone:add',
BAN_PHONE_REMOVE: 'ban:phone:remove',
BULK_UPDATE_USER_FLAGS: 'bulk:update:user_flags',
BULK_UPDATE_GUILD_FEATURES: 'bulk:update:guild_features',
BULK_ADD_GUILD_MEMBERS: 'bulk:add:guild_members',
ARCHIVE_VIEW_ALL: 'archive:view_all',
ARCHIVE_TRIGGER_USER: 'archive:trigger:user',
ARCHIVE_TRIGGER_GUILD: 'archive:trigger:guild',
BULK_DELETE_USERS: 'bulk:delete:users',
AUDIT_LOG_VIEW: 'audit_log:view',
REPORT_VIEW: 'report:view',
REPORT_RESOLVE: 'report:resolve',
VOICE_REGION_LIST: 'voice:region:list',
VOICE_REGION_CREATE: 'voice:region:create',
VOICE_REGION_UPDATE: 'voice:region:update',
VOICE_REGION_DELETE: 'voice:region:delete',
VOICE_SERVER_LIST: 'voice:server:list',
VOICE_SERVER_CREATE: 'voice:server:create',
VOICE_SERVER_UPDATE: 'voice:server:update',
VOICE_SERVER_DELETE: 'voice:server:delete',
ACL_SET_USER: 'acl:set:user',
INSTANCE_CONFIG_VIEW: 'instance:config:view',
INSTANCE_CONFIG_UPDATE: 'instance:config:update',
METRICS_VIEW: 'metrics:view',
FEATURE_FLAG_VIEW: 'feature_flag:view',
FEATURE_FLAG_MANAGE: 'feature_flag:manage',
} as const;

View File

@@ -0,0 +1,64 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export enum AuditLogActionType {
GUILD_UPDATE = 1,
CHANNEL_CREATE = 10,
CHANNEL_UPDATE = 11,
CHANNEL_DELETE = 12,
CHANNEL_OVERWRITE_CREATE = 13,
CHANNEL_OVERWRITE_UPDATE = 14,
CHANNEL_OVERWRITE_DELETE = 15,
MEMBER_KICK = 20,
MEMBER_PRUNE = 21,
MEMBER_BAN_ADD = 22,
MEMBER_BAN_REMOVE = 23,
MEMBER_UPDATE = 24,
MEMBER_ROLE_UPDATE = 25,
MEMBER_MOVE = 26,
MEMBER_DISCONNECT = 27,
BOT_ADD = 28,
ROLE_CREATE = 30,
ROLE_UPDATE = 31,
ROLE_DELETE = 32,
INVITE_CREATE = 40,
INVITE_UPDATE = 41,
INVITE_DELETE = 42,
WEBHOOK_CREATE = 50,
WEBHOOK_UPDATE = 51,
WEBHOOK_DELETE = 52,
EMOJI_CREATE = 60,
EMOJI_UPDATE = 61,
EMOJI_DELETE = 62,
MESSAGE_DELETE = 72,
MESSAGE_BULK_DELETE = 73,
MESSAGE_PIN = 74,
MESSAGE_UNPIN = 75,
STICKER_CREATE = 90,
STICKER_UPDATE = 91,
STICKER_DELETE = 92,
}

View File

@@ -0,0 +1,149 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export const ChannelTypes = {
GUILD_TEXT: 0,
DM: 1,
GUILD_VOICE: 2,
GROUP_DM: 3,
GUILD_CATEGORY: 4,
GUILD_LINK: 998,
DM_PERSONAL_NOTES: 999,
} as const;
export const TEXT_BASED_CHANNEL_TYPES = new Set<number>([
ChannelTypes.GUILD_TEXT,
ChannelTypes.DM,
ChannelTypes.DM_PERSONAL_NOTES,
ChannelTypes.GROUP_DM,
]);
export const InviteTypes = {
GUILD: 0,
GROUP_DM: 1,
EMOJI_PACK: 2,
STICKER_PACK: 3,
} as const;
export const MessageTypes = {
DEFAULT: 0,
RECIPIENT_ADD: 1,
RECIPIENT_REMOVE: 2,
CALL: 3,
CHANNEL_NAME_CHANGE: 4,
CHANNEL_ICON_CHANGE: 5,
CHANNEL_PINNED_MESSAGE: 6,
USER_JOIN: 7,
REPLY: 19,
} as const;
type MessageTypeValue = (typeof MessageTypes)[keyof typeof MessageTypes];
const MESSAGE_TYPE_DELETABLE = {
[MessageTypes.DEFAULT]: true,
[MessageTypes.REPLY]: true,
[MessageTypes.CHANNEL_PINNED_MESSAGE]: true,
[MessageTypes.USER_JOIN]: true,
[MessageTypes.RECIPIENT_ADD]: false,
[MessageTypes.RECIPIENT_REMOVE]: false,
[MessageTypes.CALL]: false,
[MessageTypes.CHANNEL_NAME_CHANGE]: false,
[MessageTypes.CHANNEL_ICON_CHANGE]: false,
} as const satisfies Record<MessageTypeValue, boolean>;
export const isMessageTypeDeletable = (type: number): boolean => {
return type in MESSAGE_TYPE_DELETABLE ? MESSAGE_TYPE_DELETABLE[type as MessageTypeValue] : false;
};
export const MessageReferenceTypes = {
DEFAULT: 0,
FORWARD: 1,
} as const;
export const MessageFlags = {
SUPPRESS_EMBEDS: 1 << 2,
SUPPRESS_NOTIFICATIONS: 1 << 12,
COMPACT_ATTACHMENTS: 1 << 17,
} as const;
export const SENDABLE_MESSAGE_FLAGS =
MessageFlags.SUPPRESS_EMBEDS | MessageFlags.SUPPRESS_NOTIFICATIONS | MessageFlags.COMPACT_ATTACHMENTS;
export const MessageAttachmentFlags = {
IS_SPOILER: 1 << 3,
CONTAINS_EXPLICIT_MEDIA: 1 << 4,
IS_ANIMATED: 1 << 5,
} as const;
export const Permissions = {
CREATE_INSTANT_INVITE: 1n << 0n,
KICK_MEMBERS: 1n << 1n,
BAN_MEMBERS: 1n << 2n,
ADMINISTRATOR: 1n << 3n,
MANAGE_CHANNELS: 1n << 4n,
MANAGE_GUILD: 1n << 5n,
ADD_REACTIONS: 1n << 6n,
VIEW_AUDIT_LOG: 1n << 7n,
PRIORITY_SPEAKER: 1n << 8n,
STREAM: 1n << 9n,
VIEW_CHANNEL: 1n << 10n,
SEND_MESSAGES: 1n << 11n,
SEND_TTS_MESSAGES: 1n << 12n,
MANAGE_MESSAGES: 1n << 13n,
EMBED_LINKS: 1n << 14n,
ATTACH_FILES: 1n << 15n,
READ_MESSAGE_HISTORY: 1n << 16n,
MENTION_EVERYONE: 1n << 17n,
USE_EXTERNAL_EMOJIS: 1n << 18n,
CONNECT: 1n << 20n,
SPEAK: 1n << 21n,
MUTE_MEMBERS: 1n << 22n,
DEAFEN_MEMBERS: 1n << 23n,
MOVE_MEMBERS: 1n << 24n,
USE_VAD: 1n << 25n,
CHANGE_NICKNAME: 1n << 26n,
MANAGE_NICKNAMES: 1n << 27n,
MANAGE_ROLES: 1n << 28n,
MANAGE_WEBHOOKS: 1n << 29n,
MANAGE_EXPRESSIONS: 1n << 30n,
USE_EXTERNAL_STICKERS: 1n << 37n,
MODERATE_MEMBERS: 1n << 40n,
CREATE_EXPRESSIONS: 1n << 43n,
PIN_MESSAGES: 1n << 51n,
BYPASS_SLOWMODE: 1n << 52n,
UPDATE_RTC_REGION: 1n << 53n,
} as const;
export const ALL_PERMISSIONS = Object.values(Permissions).reduce((acc, p) => acc | p, 0n);
export const DEFAULT_PERMISSIONS =
Permissions.CREATE_INSTANT_INVITE |
Permissions.ADD_REACTIONS |
Permissions.STREAM |
Permissions.VIEW_CHANNEL |
Permissions.SEND_MESSAGES |
Permissions.EMBED_LINKS |
Permissions.ATTACH_FILES |
Permissions.READ_MESSAGE_HISTORY |
Permissions.USE_EXTERNAL_EMOJIS |
Permissions.CONNECT |
Permissions.SPEAK |
Permissions.USE_VAD |
Permissions.CHANGE_NICKNAME |
Permissions.USE_EXTERNAL_STICKERS |
Permissions.CREATE_EXPRESSIONS;

View File

@@ -0,0 +1,112 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
import {createUserID} from '~/BrandedTypes';
export const FLUXER_EPOCH = 1420070400000;
export const FLUXER_USER_AGENT = 'Mozilla/5.0 (compatible; Fluxerbot/1.0; +https://fluxer.app)';
export const MAX_GUILDS_PREMIUM = 200;
export const MAX_GUILDS_NON_PREMIUM = 100;
export const MAX_GUILD_CHANNELS = 500;
export const MAX_CHANNELS_PER_CATEGORY = 50;
export const MAX_GUILD_EMOJIS_ANIMATED = 50;
export const MAX_GUILD_EMOJIS_STATIC = 50;
export const MAX_GUILD_EMOJIS_ANIMATED_MORE_EMOJI = 250;
export const MAX_GUILD_EMOJIS_STATIC_MORE_EMOJI = 250;
export const MAX_GUILD_STICKERS = 50;
export const MAX_GUILD_STICKERS_MORE_STICKERS = 250;
export const MAX_GUILD_INVITES = 1000;
export const MAX_GUILD_ROLES = 250;
export const MAX_WEBHOOKS_PER_CHANNEL = 15;
export const MAX_WEBHOOKS_PER_GUILD = 1000;
export const MAX_MESSAGE_LENGTH_PREMIUM = 4000;
export const MAX_MESSAGE_LENGTH_NON_PREMIUM = 2000;
export const MAX_ATTACHMENTS_PER_MESSAGE = 10;
export const MAX_EMBEDS_PER_MESSAGE = 10;
export const MAX_REACTIONS_PER_MESSAGE = 30;
export const MAX_USERS_PER_MESSAGE_REACTION = 5000;
export const MAX_RELATIONSHIPS = 1000;
export const MAX_GROUP_DM_RECIPIENTS = 10;
export const MAX_PRIVATE_CHANNELS_PER_USER = 250;
export const MAX_GROUP_DMS_PER_USER = 150;
export const MAX_BOOKMARKS_PREMIUM = 300;
export const MAX_BOOKMARKS_NON_PREMIUM = 50;
export const MAX_FAVORITE_MEMES_PREMIUM = 500;
export const MAX_FAVORITE_MEMES_NON_PREMIUM = 50;
export const MAX_FAVORITE_MEME_TAGS = 10;
export const MAX_PACK_EXPRESSIONS = 200;
export const MAX_CREATED_PACKS_NON_PREMIUM = 0;
export const MAX_CREATED_PACKS_PREMIUM = 50;
export const MAX_INSTALLED_PACKS_NON_PREMIUM = 0;
export const MAX_INSTALLED_PACKS_PREMIUM = 50;
export const AVATAR_MAX_SIZE = 10 * 1024 * 1024;
export const AVATAR_EXTENSIONS = new Set(['jpeg', 'png', 'webp', 'gif']);
export const EMOJI_MAX_SIZE = 384 * 1024;
export const EMOJI_EXTENSIONS = new Set(['jpeg', 'png', 'webp', 'gif']);
export const STICKER_MAX_SIZE = 512 * 1024;
export const STICKER_EXTENSIONS = new Set(['png', 'gif']);
export const ATTACHMENT_MAX_SIZE_PREMIUM = 500 * 1024 * 1024;
export const ATTACHMENT_MAX_SIZE_NON_PREMIUM = 25 * 1024 * 1024;
export const USER_MENTION_REGEX = /<@!?(?<userId>\d+)>/g;
export const ROLE_MENTION_REGEX = /<@&(?<roleId>\d+)>/g;
export const URL_REGEX = /https?:\/\/[^\s/$.?#].[^\s]*/g;
export const VALID_TEMP_BAN_DURATIONS = new Set([
60 * 60,
60 * 60 * 12,
60 * 60 * 24,
60 * 60 * 24 * 3,
60 * 60 * 24 * 5,
60 * 60 * 24 * 7,
60 * 60 * 24 * 14,
60 * 60 * 24 * 30,
]);
export const DeletionReasons = {
USER_REQUESTED: 1,
OTHER: 2,
SPAM: 3,
HACKS_CHEATS: 4,
RAIDS: 5,
SELFBOT: 6,
NONCONSENSUAL_PORNOGRAPHY: 7,
SCAM: 8,
LOLICON: 9,
DOXXING: 10,
HARASSMENT: 11,
FRAUDULENT_CHARGE: 12,
COPPA: 13,
FRIENDLY_FRAUD: 14,
UNSOLICITED_NSFW: 15,
GORE: 16,
BAN_EVASION: 17,
TOKEN_SOLICITATION: 18,
INACTIVITY: 19,
} as const;
export const SYSTEM_USER_ID = createUserID(0n);

View File

@@ -0,0 +1,34 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export const FeatureFlags = {
MESSAGE_SCHEDULING: 'message_scheduling',
EXPRESSION_PACKS: 'expression_packs',
} as const;
export type FeatureFlag = (typeof FeatureFlags)[keyof typeof FeatureFlags];
export const ALL_FEATURE_FLAGS: Array<FeatureFlag> = Object.values(FeatureFlags);
export const FEATURE_FLAG_KEY_PREFIX = 'feature_flag:';
export const FEATURE_FLAG_REDIS_KEY = 'feature_flags:config';
export const FEATURE_FLAG_POLL_INTERVAL_MS = 30000;
export const FEATURE_FLAG_POLL_JITTER_MS = 5000;
export const FEATURE_FLAG_USER_CACHE_PREFIX = 'feature_flag:user';
export const FEATURE_FLAG_USER_CACHE_TTL_SECONDS = 30;

View File

@@ -0,0 +1,76 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export type GatewayDispatchEvent =
| 'READY'
| 'RESUMED'
| 'SESSIONS_REPLACE'
| 'USER_UPDATE'
| 'USER_PINNED_DMS_UPDATE'
| 'USER_SETTINGS_UPDATE'
| 'USER_GUILD_SETTINGS_UPDATE'
| 'USER_NOTE_UPDATE'
| 'RECENT_MENTION_DELETE'
| 'SAVED_MESSAGE_CREATE'
| 'SAVED_MESSAGE_DELETE'
| 'FAVORITE_MEME_CREATE'
| 'FAVORITE_MEME_UPDATE'
| 'FAVORITE_MEME_DELETE'
| 'AUTH_SESSION_CHANGE'
| 'PRESENCE_UPDATE'
| 'GUILD_CREATE'
| 'GUILD_UPDATE'
| 'GUILD_DELETE'
| 'GUILD_MEMBER_ADD'
| 'GUILD_MEMBER_UPDATE'
| 'GUILD_MEMBER_REMOVE'
| 'GUILD_ROLE_CREATE'
| 'GUILD_ROLE_UPDATE'
| 'GUILD_ROLE_UPDATE_BULK'
| 'GUILD_ROLE_DELETE'
| 'GUILD_EMOJIS_UPDATE'
| 'GUILD_STICKERS_UPDATE'
| 'GUILD_BAN_ADD'
| 'GUILD_BAN_REMOVE'
| 'CHANNEL_CREATE'
| 'CHANNEL_UPDATE'
| 'CHANNEL_UPDATE_BULK'
| 'CHANNEL_DELETE'
| 'CHANNEL_PINS_UPDATE'
| 'CHANNEL_PINS_ACK'
| 'CHANNEL_RECIPIENT_ADD'
| 'CHANNEL_RECIPIENT_REMOVE'
| 'MESSAGE_CREATE'
| 'MESSAGE_UPDATE'
| 'MESSAGE_DELETE'
| 'MESSAGE_DELETE_BULK'
| 'MESSAGE_REACTION_ADD'
| 'MESSAGE_REACTION_REMOVE'
| 'MESSAGE_REACTION_REMOVE_ALL'
| 'MESSAGE_REACTION_REMOVE_EMOJI'
| 'MESSAGE_ACK'
| 'TYPING_START'
| 'WEBHOOKS_UPDATE'
| 'INVITE_CREATE'
| 'INVITE_DELETE'
| 'RELATIONSHIP_ADD'
| 'RELATIONSHIP_UPDATE'
| 'RELATIONSHIP_REMOVE'
| 'VOICE_STATE_UPDATE'
| 'VOICE_SERVER_UPDATE';

View File

@@ -0,0 +1,99 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export const GuildVerificationLevel = {
NONE: 0,
LOW: 1,
MEDIUM: 2,
HIGH: 3,
VERY_HIGH: 4,
} as const;
export const GuildMFALevel = {
NONE: 0,
ELEVATED: 1,
} as const;
export const SystemChannelFlags = {
SUPPRESS_JOIN_NOTIFICATIONS: 1 << 0,
} as const;
export const GuildOperations = {
PUSH_NOTIFICATIONS: 1 << 0,
EVERYONE_MENTIONS: 1 << 1,
TYPING_EVENTS: 1 << 2,
INSTANT_INVITES: 1 << 3,
SEND_MESSAGE: 1 << 4,
REACTIONS: 1 << 5,
} as const;
export const GuildExplicitContentFilterTypes = {
DISABLED: 0,
MEMBERS_WITHOUT_ROLES: 1,
ALL_MEMBERS: 2,
} as const;
export const GuildFeatures = {
ANIMATED_ICON: 'ANIMATED_ICON',
ANIMATED_BANNER: 'ANIMATED_BANNER',
BANNER: 'BANNER',
DETACHED_BANNER: 'DETACHED_BANNER',
INVITE_SPLASH: 'INVITE_SPLASH',
INVITES_DISABLED: 'INVITES_DISABLED',
DISALLOW_UNCLAIMED_ACCOUNTS: 'DISALLOW_UNCLAIMED_ACCOUNTS',
TEXT_CHANNEL_FLEXIBLE_NAMES: 'TEXT_CHANNEL_FLEXIBLE_NAMES',
MORE_EMOJI: 'MORE_EMOJI',
MORE_STICKERS: 'MORE_STICKERS',
UNLIMITED_EMOJI: 'UNLIMITED_EMOJI',
UNLIMITED_STICKERS: 'UNLIMITED_STICKERS',
EXPRESSION_PURGE_ALLOWED: 'EXPRESSION_PURGE_ALLOWED',
VANITY_URL: 'VANITY_URL',
VERIFIED: 'VERIFIED',
VIP_VOICE: 'VIP_VOICE',
UNAVAILABLE_FOR_EVERYONE: 'UNAVAILABLE_FOR_EVERYONE',
UNAVAILABLE_FOR_EVERYONE_BUT_STAFF: 'UNAVAILABLE_FOR_EVERYONE_BUT_STAFF',
VISIONARY: 'VISIONARY',
OPERATOR: 'OPERATOR',
LARGE_GUILD_OVERRIDE: 'LARGE_GUILD_OVERRIDE',
} as const;
export const GuildSplashCardAlignment = {
CENTER: 0,
LEFT: 1,
RIGHT: 2,
} as const;
export type GuildSplashCardAlignmentValue = (typeof GuildSplashCardAlignment)[keyof typeof GuildSplashCardAlignment];
export const StickerFormatTypes = {
PNG: 1,
APNG: 2,
LOTTIE: 3,
GIF: 4,
} as const;
export const GuildMemberProfileFlags = {
AVATAR_UNSET: 1 << 0,
BANNER_UNSET: 1 << 1,
} as const;
export const JoinSourceTypes = {
INVITE: 0,
BOT_INVITE: 1,
} as const;

View File

@@ -0,0 +1,81 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export const CATEGORY_HARASSMENT = 'harassment' as const;
export const CATEGORY_HATE_SPEECH = 'hate_speech' as const;
export const CATEGORY_SPAM = 'spam' as const;
export const CATEGORY_ILLEGAL_ACTIVITY = 'illegal_activity' as const;
export const CATEGORY_IMPERSONATION = 'impersonation' as const;
export const CATEGORY_CHILD_SAFETY = 'child_safety' as const;
export const CATEGORY_OTHER = 'other' as const;
export const CATEGORY_VIOLENT_CONTENT = 'violent_content' as const;
export const CATEGORY_NSFW_VIOLATION = 'nsfw_violation' as const;
export const CATEGORY_DOXXING = 'doxxing' as const;
export const CATEGORY_SELF_HARM = 'self_harm' as const;
export const CATEGORY_MALICIOUS_LINKS = 'malicious_links' as const;
export const CATEGORY_SPAM_ACCOUNT = 'spam_account' as const;
export const CATEGORY_UNDERAGE_USER = 'underage_user' as const;
export const CATEGORY_INAPPROPRIATE_PROFILE = 'inappropriate_profile' as const;
export const CATEGORY_RAID_COORDINATION = 'raid_coordination' as const;
export const CATEGORY_MALWARE_DISTRIBUTION = 'malware_distribution' as const;
export const CATEGORY_EXTREMIST_COMMUNITY = 'extremist_community' as const;
const REPORT_CATEGORY_GROUPS = {
message: [
CATEGORY_HARASSMENT,
CATEGORY_HATE_SPEECH,
CATEGORY_VIOLENT_CONTENT,
CATEGORY_SPAM,
CATEGORY_NSFW_VIOLATION,
CATEGORY_ILLEGAL_ACTIVITY,
CATEGORY_DOXXING,
CATEGORY_SELF_HARM,
CATEGORY_CHILD_SAFETY,
CATEGORY_MALICIOUS_LINKS,
CATEGORY_IMPERSONATION,
CATEGORY_OTHER,
] as const,
user: [
CATEGORY_HARASSMENT,
CATEGORY_HATE_SPEECH,
CATEGORY_SPAM_ACCOUNT,
CATEGORY_IMPERSONATION,
CATEGORY_UNDERAGE_USER,
CATEGORY_INAPPROPRIATE_PROFILE,
CATEGORY_OTHER,
] as const,
guild: [
CATEGORY_HARASSMENT,
CATEGORY_HATE_SPEECH,
CATEGORY_EXTREMIST_COMMUNITY,
CATEGORY_ILLEGAL_ACTIVITY,
CATEGORY_CHILD_SAFETY,
CATEGORY_RAID_COORDINATION,
CATEGORY_SPAM,
CATEGORY_MALWARE_DISTRIBUTION,
CATEGORY_OTHER,
] as const,
} as const;
export const MESSAGE_REPORT_CATEGORIES = REPORT_CATEGORY_GROUPS.message;
export const USER_REPORT_CATEGORIES = REPORT_CATEGORY_GROUPS.user;
export const GUILD_REPORT_CATEGORIES = REPORT_CATEGORY_GROUPS.guild;

View File

@@ -0,0 +1,177 @@
/*
* Copyright (C) 2026 Fluxer Contributors
*
* This file is part of Fluxer.
*
* Fluxer is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Fluxer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Fluxer. If not, see <https://www.gnu.org/licenses/>.
*/
export const UserAuthenticatorTypes = {
TOTP: 0,
SMS: 1,
WEBAUTHN: 2,
} as const;
export const UserPremiumTypes = {
NONE: 0,
SUBSCRIPTION: 1,
LIFETIME: 2,
} as const;
export const UserFlags = {
STAFF: 1n << 0n,
CTP_MEMBER: 1n << 1n,
PARTNER: 1n << 2n,
BUG_HUNTER: 1n << 3n,
HIGH_GLOBAL_RATE_LIMIT: 1n << 33n,
DELETED: 1n << 34n,
DISABLED_SUSPICIOUS_ACTIVITY: 1n << 35n,
SELF_DELETED: 1n << 36n,
PREMIUM_DISCRIMINATOR: 1n << 37n,
DISABLED: 1n << 38n,
HAS_SESSION_STARTED: 1n << 39n,
PREMIUM_BADGE_HIDDEN: 1n << 40n,
PREMIUM_BADGE_MASKED: 1n << 41n,
PREMIUM_BADGE_TIMESTAMP_HIDDEN: 1n << 42n,
PREMIUM_BADGE_SEQUENCE_HIDDEN: 1n << 43n,
PREMIUM_PERKS_SANITIZED: 1n << 44n,
PREMIUM_PURCHASE_DISABLED: 1n << 45n,
PREMIUM_ENABLED_OVERRIDE: 1n << 46n,
RATE_LIMIT_BYPASS: 1n << 47n,
REPORT_BANNED: 1n << 48n,
VERIFIED_NOT_UNDERAGE: 1n << 49n,
PENDING_MANUAL_VERIFICATION: 1n << 50n,
HAS_DISMISSED_PREMIUM_ONBOARDING: 1n << 51n,
USED_MOBILE_CLIENT: 1n << 52n,
APP_STORE_REVIEWER: 1n << 53n,
} as const;
export const PUBLIC_USER_FLAGS = UserFlags.STAFF | UserFlags.CTP_MEMBER | UserFlags.PARTNER | UserFlags.BUG_HUNTER;
export const SuspiciousActivityFlags = {
REQUIRE_VERIFIED_EMAIL: 1 << 0,
REQUIRE_REVERIFIED_EMAIL: 1 << 1,
REQUIRE_VERIFIED_PHONE: 1 << 2,
REQUIRE_REVERIFIED_PHONE: 1 << 3,
REQUIRE_VERIFIED_EMAIL_OR_VERIFIED_PHONE: 1 << 4,
REQUIRE_REVERIFIED_EMAIL_OR_VERIFIED_PHONE: 1 << 5,
REQUIRE_VERIFIED_EMAIL_OR_REVERIFIED_PHONE: 1 << 6,
REQUIRE_REVERIFIED_EMAIL_OR_REVERIFIED_PHONE: 1 << 7,
} as const;
export const Locales = {
AR: 'ar',
BG: 'bg',
CS: 'cs',
DA: 'da',
DE: 'de',
EL: 'el',
EN_GB: 'en-GB',
EN_US: 'en-US',
ES_ES: 'es-ES',
ES_419: 'es-419',
FI: 'fi',
FR: 'fr',
HE: 'he',
HI: 'hi',
HR: 'hr',
HU: 'hu',
ID: 'id',
IT: 'it',
JA: 'ja',
KO: 'ko',
LT: 'lt',
NL: 'nl',
NO: 'no',
PL: 'pl',
PT_BR: 'pt-BR',
RO: 'ro',
RU: 'ru',
SV_SE: 'sv-SE',
TH: 'th',
TR: 'tr',
UK: 'uk',
VI: 'vi',
ZH_CN: 'zh-CN',
ZH_TW: 'zh-TW',
} as const;
export const StatusTypes = {
ONLINE: 'online',
DND: 'dnd',
IDLE: 'idle',
INVISIBLE: 'invisible',
} as const;
export const ThemeTypes = {
DARK: 'dark',
COAL: 'coal',
LIGHT: 'light',
SYSTEM: 'system',
} as const;
export const StickerAnimationOptions = {
ALWAYS_ANIMATE: 0,
ANIMATE_ON_INTERACTION: 1,
NEVER_ANIMATE: 2,
} as const;
export const RenderSpoilers = {
ALWAYS: 0,
ON_CLICK: 1,
IF_MODERATOR: 2,
} as const;
export const UserExplicitContentFilterTypes = {
DISABLED: 0,
NON_FRIENDS: 1,
FRIENDS_AND_NON_FRIENDS: 2,
} as const;
export const FriendSourceFlags = {
MUTUAL_FRIENDS: 1 << 0,
MUTUAL_GUILDS: 1 << 1,
NO_RELATION: 1 << 2,
} as const;
export const IncomingCallFlags = {
FRIENDS_OF_FRIENDS: 1 << 0,
GUILD_MEMBERS: 1 << 1,
EVERYONE: 1 << 2,
FRIENDS_ONLY: 1 << 3,
NOBODY: 1 << 4,
SILENT_EVERYONE: 1 << 5,
} as const;
export const GroupDmAddPermissionFlags = {
FRIENDS_OF_FRIENDS: 1 << 0,
GUILD_MEMBERS: 1 << 1,
EVERYONE: 1 << 2,
FRIENDS_ONLY: 1 << 3,
NOBODY: 1 << 4,
} as const;
export const UserNotificationSettings = {
ALL_MESSAGES: 0,
ONLY_MENTIONS: 1,
NO_MESSAGES: 2,
INHERIT: 3,
} as const;
export const RelationshipTypes = {
FRIEND: 1,
BLOCKED: 2,
INCOMING_REQUEST: 3,
OUTGOING_REQUEST: 4,
} as const;