@erinjs/core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/.changeset/README.md +8 -0
- package/core/.changeset/community-bootstrap-release.md +17 -0
- package/core/.changeset/config.json +11 -0
- package/core/.changeset/no-changelog.js +16 -0
- package/core/.changeset/pre.json +17 -0
- package/core/.editorconfig +13 -0
- package/core/.gitattributes +2 -0
- package/core/.github/CODE_OF_CONDUCT.md +23 -0
- package/core/.github/FUNDING.yml +7 -0
- package/core/.github/ISSUE_TEMPLATE/bug_report.md +31 -0
- package/core/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
- package/core/.github/PULL_REQUEST_TEMPLATE.md +16 -0
- package/core/.github/dependabot.yml +16 -0
- package/core/.github/workflows/autoapp.yml +16 -0
- package/core/.github/workflows/ci.yml +187 -0
- package/core/.github/workflows/codeql.yml +30 -0
- package/core/.github/workflows/deploy-docs.yml +54 -0
- package/core/.github/workflows/publish.yml +43 -0
- package/core/.lintstagedrc.json +4 -0
- package/core/.nvmrc +1 -0
- package/core/.prettierignore +8 -0
- package/core/.prettierrc +11 -0
- package/core/CONTRIBUTING.md +70 -0
- package/core/LICENSE +203 -0
- package/core/README.md +61 -0
- package/core/SECURITY.md +21 -0
- package/core/apps/docs/index.html +28 -0
- package/core/apps/docs/middleware.ts +21 -0
- package/core/apps/docs/package.json +33 -0
- package/core/apps/docs/public/@flux.png +0 -0
- package/core/apps/docs/public/docs/latest/guides.json +1420 -0
- package/core/apps/docs/public/docs/latest/main.json +14981 -0
- package/core/apps/docs/public/docs/latest/rag-index.json +1 -0
- package/core/apps/docs/public/docs/v1.0.5/guides.json +226 -0
- package/core/apps/docs/public/docs/v1.0.5/main.json +7920 -0
- package/core/apps/docs/public/docs/v1.0.6/guides.json +226 -0
- package/core/apps/docs/public/docs/v1.0.6/main.json +7920 -0
- package/core/apps/docs/public/docs/v1.0.7/guides.json +259 -0
- package/core/apps/docs/public/docs/v1.0.7/main.json +8652 -0
- package/core/apps/docs/public/docs/v1.0.8/guides.json +313 -0
- package/core/apps/docs/public/docs/v1.0.8/main.json +9618 -0
- package/core/apps/docs/public/docs/v1.0.9/guides.json +319 -0
- package/core/apps/docs/public/docs/v1.0.9/main.json +10694 -0
- package/core/apps/docs/public/docs/v1.1.0/guides.json +589 -0
- package/core/apps/docs/public/docs/v1.1.0/main.json +12576 -0
- package/core/apps/docs/public/docs/v1.1.2/guides.json +650 -0
- package/core/apps/docs/public/docs/v1.1.2/main.json +13239 -0
- package/core/apps/docs/public/docs/v1.1.3/guides.json +650 -0
- package/core/apps/docs/public/docs/v1.1.3/main.json +13239 -0
- package/core/apps/docs/public/docs/v1.1.4/guides.json +708 -0
- package/core/apps/docs/public/docs/v1.1.4/main.json +13231 -0
- package/core/apps/docs/public/docs/v1.1.5/guides.json +1035 -0
- package/core/apps/docs/public/docs/v1.1.5/main.json +13838 -0
- package/core/apps/docs/public/docs/v1.1.6/guides.json +1041 -0
- package/core/apps/docs/public/docs/v1.1.6/main.json +14313 -0
- package/core/apps/docs/public/docs/v1.1.8/guides.json +1047 -0
- package/core/apps/docs/public/docs/v1.1.8/main.json +14421 -0
- package/core/apps/docs/public/docs/v1.1.9/guides.json +1047 -0
- package/core/apps/docs/public/docs/v1.1.9/main.json +14421 -0
- package/core/apps/docs/public/docs/v1.2.0/guides.json +1212 -0
- package/core/apps/docs/public/docs/v1.2.0/main.json +14663 -0
- package/core/apps/docs/public/docs/v1.2.1/guides.json +1293 -0
- package/core/apps/docs/public/docs/v1.2.1/main.json +14828 -0
- package/core/apps/docs/public/docs/v1.2.2/guides.json +1293 -0
- package/core/apps/docs/public/docs/v1.2.2/main.json +15025 -0
- package/core/apps/docs/public/docs/v1.2.3/guides.json +1420 -0
- package/core/apps/docs/public/docs/v1.2.3/main.json +14954 -0
- package/core/apps/docs/public/docs/v1.2.4/guides.json +1420 -0
- package/core/apps/docs/public/docs/v1.2.4/main.json +14981 -0
- package/core/apps/docs/public/docs/versions.json +24 -0
- package/core/apps/docs/public/flux.png +0 -0
- package/core/apps/docs/public/locales/en.json +50 -0
- package/core/apps/docs/public/locales/guides-en.json +512 -0
- package/core/apps/docs/public/robots.txt +4 -0
- package/core/apps/docs/public/sitemap.xml +33 -0
- package/core/apps/docs/src/App.vue +538 -0
- package/core/apps/docs/src/components/ApiCategorySection.vue +42 -0
- package/core/apps/docs/src/components/ApiDiscordCompat.vue +65 -0
- package/core/apps/docs/src/components/ApiEndpointCard.vue +313 -0
- package/core/apps/docs/src/components/ApiSchemaBlock.vue +131 -0
- package/core/apps/docs/src/components/CodeBlock.vue +177 -0
- package/core/apps/docs/src/components/CommunityCallout.vue +90 -0
- package/core/apps/docs/src/components/ConstructorSection.vue +82 -0
- package/core/apps/docs/src/components/DocDescription.vue +40 -0
- package/core/apps/docs/src/components/FluxerLogo.vue +3 -0
- package/core/apps/docs/src/components/Footer.vue +106 -0
- package/core/apps/docs/src/components/GuideCodeBlock.vue +102 -0
- package/core/apps/docs/src/components/GuideDiscordCompat.vue +77 -0
- package/core/apps/docs/src/components/GuideDiscordCompatCallout.vue +83 -0
- package/core/apps/docs/src/components/GuideTable.vue +77 -0
- package/core/apps/docs/src/components/GuideTip.vue +38 -0
- package/core/apps/docs/src/components/MethodsSection.vue +195 -0
- package/core/apps/docs/src/components/ParamsTable.vue +70 -0
- package/core/apps/docs/src/components/PropertiesSection.vue +143 -0
- package/core/apps/docs/src/components/SearchBar.vue +76 -0
- package/core/apps/docs/src/components/SearchModal.vue +361 -0
- package/core/apps/docs/src/components/SidebarNav.vue +225 -0
- package/core/apps/docs/src/components/SponsorBanner.vue +153 -0
- package/core/apps/docs/src/components/TypeSignature.vue +187 -0
- package/core/apps/docs/src/components/VersionPicker.vue +191 -0
- package/core/apps/docs/src/composables/useSearchIndex.ts +144 -0
- package/core/apps/docs/src/composables/useVersionedPath.ts +20 -0
- package/core/apps/docs/src/data/apiEndpoints.ts +1073 -0
- package/core/apps/docs/src/data/changelog.ts +717 -0
- package/core/apps/docs/src/data/guides.ts +2362 -0
- package/core/apps/docs/src/env.d.ts +7 -0
- package/core/apps/docs/src/locales/guides-en.json +512 -0
- package/core/apps/docs/src/main.ts +27 -0
- package/core/apps/docs/src/pages/ApiReferenceLayout.vue +175 -0
- package/core/apps/docs/src/pages/ApiReferencePage.vue +128 -0
- package/core/apps/docs/src/pages/Changelog.vue +288 -0
- package/core/apps/docs/src/pages/ClassPage.vue +319 -0
- package/core/apps/docs/src/pages/ClassesList.vue +100 -0
- package/core/apps/docs/src/pages/DocsLayout.vue +127 -0
- package/core/apps/docs/src/pages/GuidePage.vue +279 -0
- package/core/apps/docs/src/pages/GuidesIndex.vue +166 -0
- package/core/apps/docs/src/pages/GuidesLayout.vue +245 -0
- package/core/apps/docs/src/pages/Home.vue +125 -0
- package/core/apps/docs/src/pages/NotFound.vue +57 -0
- package/core/apps/docs/src/pages/TypedefPage.vue +230 -0
- package/core/apps/docs/src/pages/TypedefsList.vue +168 -0
- package/core/apps/docs/src/pages/VersionLayout.vue +15 -0
- package/core/apps/docs/src/router.ts +73 -0
- package/core/apps/docs/src/stores/docs.ts +54 -0
- package/core/apps/docs/src/stores/guides.ts +53 -0
- package/core/apps/docs/src/stores/version.ts +67 -0
- package/core/apps/docs/src/styles/main.css +278 -0
- package/core/apps/docs/src/styles/prism.css +95 -0
- package/core/apps/docs/src/types/doc-schema.ts +112 -0
- package/core/apps/docs/tsconfig.json +17 -0
- package/core/apps/docs/tsconfig.node.json +10 -0
- package/core/apps/docs/vite.config.d.ts +2 -0
- package/core/apps/docs/vite.config.js +26 -0
- package/core/apps/docs/vite.config.ts +28 -0
- package/core/apps/docs-vitepress/.vitepress/config.ts +141 -0
- package/core/apps/docs-vitepress/api-data/latest/main.json +15035 -0
- package/core/apps/docs-vitepress/api-data/v1.2.4/main.json +15035 -0
- package/core/apps/docs-vitepress/api-data/versions.json +6 -0
- package/core/apps/docs-vitepress/index.md +15 -0
- package/core/apps/docs-vitepress/package-lock.json +2924 -0
- package/core/apps/docs-vitepress/package.json +20 -0
- package/core/apps/docs-vitepress/public/CNAME +1 -0
- package/core/apps/docs-vitepress/scripts/generate-api.ts +243 -0
- package/core/apps/docs-vitepress/scripts/migrate-guides.ts +129 -0
- package/core/apps/docs-vitepress/tsconfig.json +11 -0
- package/core/apps/docs-vitepress/v/latest/guides/attachments-by-url.md +57 -0
- package/core/apps/docs-vitepress/v/latest/guides/attachments.md +62 -0
- package/core/apps/docs-vitepress/v/latest/guides/basic-bot.md +49 -0
- package/core/apps/docs-vitepress/v/latest/guides/channels.md +180 -0
- package/core/apps/docs-vitepress/v/latest/guides/deprecated-apis.md +58 -0
- package/core/apps/docs-vitepress/v/latest/guides/discord-js-compatibility.md +42 -0
- package/core/apps/docs-vitepress/v/latest/guides/editing-embeds.md +65 -0
- package/core/apps/docs-vitepress/v/latest/guides/embed-media.md +87 -0
- package/core/apps/docs-vitepress/v/latest/guides/embeds.md +166 -0
- package/core/apps/docs-vitepress/v/latest/guides/emojis.md +77 -0
- package/core/apps/docs-vitepress/v/latest/guides/events.md +202 -0
- package/core/apps/docs-vitepress/v/latest/guides/gifs.md +47 -0
- package/core/apps/docs-vitepress/v/latest/guides/installation.md +10 -0
- package/core/apps/docs-vitepress/v/latest/guides/moderation.md +89 -0
- package/core/apps/docs-vitepress/v/latest/guides/permissions.md +130 -0
- package/core/apps/docs-vitepress/v/latest/guides/prefix-commands.md +41 -0
- package/core/apps/docs-vitepress/v/latest/guides/profile-urls.md +58 -0
- package/core/apps/docs-vitepress/v/latest/guides/reactions.md +69 -0
- package/core/apps/docs-vitepress/v/latest/guides/roles.md +130 -0
- package/core/apps/docs-vitepress/v/latest/guides/sending-without-reply.md +172 -0
- package/core/apps/docs-vitepress/v/latest/guides/voice.md +109 -0
- package/core/apps/docs-vitepress/v/latest/guides/wait-for-guilds.md +37 -0
- package/core/apps/docs-vitepress/v/latest/guides/webhook-attachments-embeds.md +73 -0
- package/core/apps/docs-vitepress/v/latest/guides/webhooks.md +131 -0
- package/core/eslint.config.js +80 -0
- package/core/examples/.env.example +22 -0
- package/core/examples/README.md +68 -0
- package/core/examples/first-steps-bot.js +118 -0
- package/core/examples/minimal-bot.js +17 -0
- package/core/examples/moderation-bot.js +209 -0
- package/core/examples/package.json +14 -0
- package/core/examples/ping-bot.js +1146 -0
- package/core/examples/reaction-bot.js +70 -0
- package/core/examples/reaction-roles-bot.js +140 -0
- package/core/examples/webhook-bot.js +239 -0
- package/core/flux.png +0 -0
- package/core/package.json +78 -0
- package/core/packages/builders/package.json +51 -0
- package/core/packages/builders/src/index.ts +13 -0
- package/core/packages/builders/src/messages/AttachmentBuilder.test.ts +79 -0
- package/core/packages/builders/src/messages/AttachmentBuilder.ts +69 -0
- package/core/packages/builders/src/messages/EmbedBuilder.test.ts +266 -0
- package/core/packages/builders/src/messages/EmbedBuilder.ts +239 -0
- package/core/packages/builders/src/messages/MessagePayload.test.ts +118 -0
- package/core/packages/builders/src/messages/MessagePayload.ts +122 -0
- package/core/packages/builders/tsconfig.json +9 -0
- package/core/packages/builders/tsup.config.ts +9 -0
- package/core/packages/builders/vitest.config.ts +9 -0
- package/core/packages/collection/package.json +47 -0
- package/core/packages/collection/src/Collection.test.ts +232 -0
- package/core/packages/collection/src/Collection.ts +196 -0
- package/core/packages/collection/src/index.ts +1 -0
- package/core/packages/collection/tsconfig.json +9 -0
- package/core/packages/collection/tsup.config.ts +9 -0
- package/core/packages/collection/vitest.config.ts +9 -0
- package/core/packages/docgen/package.json +26 -0
- package/core/packages/docgen/src/extract.ts +262 -0
- package/core/packages/docgen/src/formatType.ts +24 -0
- package/core/packages/docgen/src/index.ts +103 -0
- package/core/packages/docgen/src/schema.ts +100 -0
- package/core/packages/docgen/src/visitor.ts +147 -0
- package/core/packages/docgen/tsconfig.json +9 -0
- package/core/packages/docgen/tsup.config.ts +9 -0
- package/core/packages/fluxer-core/README.md +26 -0
- package/core/packages/fluxer-core/package.json +60 -0
- package/core/packages/fluxer-core/src/client/ChannelManager.ts +143 -0
- package/core/packages/fluxer-core/src/client/Client.gateway.test.ts +84 -0
- package/core/packages/fluxer-core/src/client/Client.resolveEmoji.test.ts +45 -0
- package/core/packages/fluxer-core/src/client/Client.ts +558 -0
- package/core/packages/fluxer-core/src/client/ClientUser.ts +40 -0
- package/core/packages/fluxer-core/src/client/EventHandlerRegistry.ts +469 -0
- package/core/packages/fluxer-core/src/client/GuildManager.ts +79 -0
- package/core/packages/fluxer-core/src/client/GuildMemberManager.ts +91 -0
- package/core/packages/fluxer-core/src/client/MessageManager.ts +58 -0
- package/core/packages/fluxer-core/src/client/UsersManager.ts +122 -0
- package/core/packages/fluxer-core/src/errors/ErrorCodes.test.ts +19 -0
- package/core/packages/fluxer-core/src/errors/ErrorCodes.ts +12 -0
- package/core/packages/fluxer-core/src/errors/FluxerError.test.ts +32 -0
- package/core/packages/fluxer-core/src/errors/FluxerError.ts +15 -0
- package/core/packages/fluxer-core/src/index.ts +85 -0
- package/core/packages/fluxer-core/src/structures/Base.ts +7 -0
- package/core/packages/fluxer-core/src/structures/Channel.ts +508 -0
- package/core/packages/fluxer-core/src/structures/Guild.test.ts +189 -0
- package/core/packages/fluxer-core/src/structures/Guild.ts +734 -0
- package/core/packages/fluxer-core/src/structures/GuildBan.ts +35 -0
- package/core/packages/fluxer-core/src/structures/GuildEmoji.ts +57 -0
- package/core/packages/fluxer-core/src/structures/GuildMember.test.ts +203 -0
- package/core/packages/fluxer-core/src/structures/GuildMember.ts +213 -0
- package/core/packages/fluxer-core/src/structures/GuildMemberRoleManager.ts +121 -0
- package/core/packages/fluxer-core/src/structures/GuildSticker.ts +56 -0
- package/core/packages/fluxer-core/src/structures/Invite.test.ts +103 -0
- package/core/packages/fluxer-core/src/structures/Invite.ts +121 -0
- package/core/packages/fluxer-core/src/structures/Message.test.ts +109 -0
- package/core/packages/fluxer-core/src/structures/Message.ts +397 -0
- package/core/packages/fluxer-core/src/structures/MessageReaction.ts +72 -0
- package/core/packages/fluxer-core/src/structures/PartialMessage.ts +12 -0
- package/core/packages/fluxer-core/src/structures/Role.test.ts +77 -0
- package/core/packages/fluxer-core/src/structures/Role.ts +112 -0
- package/core/packages/fluxer-core/src/structures/User.test.ts +110 -0
- package/core/packages/fluxer-core/src/structures/User.ts +109 -0
- package/core/packages/fluxer-core/src/structures/Webhook.test.ts +109 -0
- package/core/packages/fluxer-core/src/structures/Webhook.ts +258 -0
- package/core/packages/fluxer-core/src/util/Constants.test.ts +16 -0
- package/core/packages/fluxer-core/src/util/Constants.ts +7 -0
- package/core/packages/fluxer-core/src/util/Events.ts +46 -0
- package/core/packages/fluxer-core/src/util/MessageCollector.ts +87 -0
- package/core/packages/fluxer-core/src/util/Options.ts +33 -0
- package/core/packages/fluxer-core/src/util/ReactionCollector.ts +116 -0
- package/core/packages/fluxer-core/src/util/cdn.test.ts +108 -0
- package/core/packages/fluxer-core/src/util/cdn.ts +130 -0
- package/core/packages/fluxer-core/src/util/guildUtils.ts +33 -0
- package/core/packages/fluxer-core/src/util/messageUtils.test.ts +74 -0
- package/core/packages/fluxer-core/src/util/messageUtils.ts +119 -0
- package/core/packages/fluxer-core/src/util/permissions.test.ts +95 -0
- package/core/packages/fluxer-core/src/util/permissions.ts +43 -0
- package/core/packages/fluxer-core/tsconfig.json +9 -0
- package/core/packages/fluxer-core/tsup.config.ts +9 -0
- package/core/packages/fluxer-core/vitest.config.ts +9 -0
- package/core/packages/rest/package.json +52 -0
- package/core/packages/rest/src/REST.test.ts +64 -0
- package/core/packages/rest/src/REST.ts +90 -0
- package/core/packages/rest/src/RateLimitManager.test.ts +71 -0
- package/core/packages/rest/src/RateLimitManager.ts +60 -0
- package/core/packages/rest/src/RequestManager.test.ts +87 -0
- package/core/packages/rest/src/RequestManager.ts +172 -0
- package/core/packages/rest/src/errors/FluxerAPIError.test.ts +57 -0
- package/core/packages/rest/src/errors/FluxerAPIError.ts +21 -0
- package/core/packages/rest/src/errors/HTTPError.test.ts +55 -0
- package/core/packages/rest/src/errors/HTTPError.ts +25 -0
- package/core/packages/rest/src/errors/RateLimitError.test.ts +41 -0
- package/core/packages/rest/src/errors/RateLimitError.ts +15 -0
- package/core/packages/rest/src/errors/index.ts +3 -0
- package/core/packages/rest/src/index.ts +6 -0
- package/core/packages/rest/src/utils/constants.test.ts +31 -0
- package/core/packages/rest/src/utils/constants.ts +5 -0
- package/core/packages/rest/src/utils/files.test.ts +37 -0
- package/core/packages/rest/src/utils/files.ts +75 -0
- package/core/packages/rest/tsconfig.json +9 -0
- package/core/packages/rest/tsup.config.ts +9 -0
- package/core/packages/rest/vitest.config.ts +9 -0
- package/core/packages/types/package.json +46 -0
- package/core/packages/types/src/api/ban.ts +8 -0
- package/core/packages/types/src/api/channel.ts +65 -0
- package/core/packages/types/src/api/embed.ts +82 -0
- package/core/packages/types/src/api/emoji.ts +12 -0
- package/core/packages/types/src/api/errors.ts +68 -0
- package/core/packages/types/src/api/gateway.ts +14 -0
- package/core/packages/types/src/api/guild.ts +123 -0
- package/core/packages/types/src/api/index.ts +15 -0
- package/core/packages/types/src/api/instance.ts +32 -0
- package/core/packages/types/src/api/interaction.ts +26 -0
- package/core/packages/types/src/api/invite.ts +28 -0
- package/core/packages/types/src/api/message.ts +140 -0
- package/core/packages/types/src/api/role.ts +41 -0
- package/core/packages/types/src/api/sticker.ts +14 -0
- package/core/packages/types/src/api/user.ts +79 -0
- package/core/packages/types/src/api/webhook.ts +41 -0
- package/core/packages/types/src/common/index.ts +1 -0
- package/core/packages/types/src/common/snowflake.test.ts +9 -0
- package/core/packages/types/src/common/snowflake.ts +8 -0
- package/core/packages/types/src/gateway/events.ts +189 -0
- package/core/packages/types/src/gateway/index.ts +3 -0
- package/core/packages/types/src/gateway/opcodes.ts +17 -0
- package/core/packages/types/src/gateway/payloads.ts +481 -0
- package/core/packages/types/src/index.ts +4 -0
- package/core/packages/types/src/rest/index.ts +1 -0
- package/core/packages/types/src/rest/routes.test.ts +169 -0
- package/core/packages/types/src/rest/routes.ts +109 -0
- package/core/packages/types/tsconfig.json +9 -0
- package/core/packages/types/tsup.config.ts +9 -0
- package/core/packages/types/vitest.config.ts +9 -0
- package/core/packages/util/package.json +51 -0
- package/core/packages/util/src/BitField.test.ts +96 -0
- package/core/packages/util/src/BitField.ts +105 -0
- package/core/packages/util/src/MessageFlagsBitField.test.ts +42 -0
- package/core/packages/util/src/MessageFlagsBitField.ts +20 -0
- package/core/packages/util/src/PermissionsBitField.test.ts +79 -0
- package/core/packages/util/src/PermissionsBitField.ts +97 -0
- package/core/packages/util/src/SnowflakeUtil.test.ts +69 -0
- package/core/packages/util/src/SnowflakeUtil.ts +65 -0
- package/core/packages/util/src/UserFlagsBitField.test.ts +39 -0
- package/core/packages/util/src/UserFlagsBitField.ts +48 -0
- package/core/packages/util/src/deprecation.test.ts +44 -0
- package/core/packages/util/src/deprecation.ts +28 -0
- package/core/packages/util/src/emojiShortcodes.generated.ts +5 -0
- package/core/packages/util/src/emojiShortcodes.test.ts +41 -0
- package/core/packages/util/src/emojiShortcodes.ts +22 -0
- package/core/packages/util/src/formatters.test.ts +65 -0
- package/core/packages/util/src/formatters.ts +35 -0
- package/core/packages/util/src/index.ts +34 -0
- package/core/packages/util/src/resolvers.test.ts +198 -0
- package/core/packages/util/src/resolvers.ts +127 -0
- package/core/packages/util/src/tenorUtils.test.ts +75 -0
- package/core/packages/util/src/tenorUtils.ts +86 -0
- package/core/packages/util/tsconfig.json +9 -0
- package/core/packages/util/tsup.config.ts +9 -0
- package/core/packages/util/vitest.config.ts +9 -0
- package/core/packages/voice/README.md +42 -0
- package/core/packages/voice/package.json +67 -0
- package/core/packages/voice/src/LiveKitRtcConnection.receive.test.ts +24 -0
- package/core/packages/voice/src/LiveKitRtcConnection.ts +1767 -0
- package/core/packages/voice/src/VoiceConnection.ts +413 -0
- package/core/packages/voice/src/VoiceManager.receive.test.ts +61 -0
- package/core/packages/voice/src/VoiceManager.test.ts +44 -0
- package/core/packages/voice/src/VoiceManager.ts +503 -0
- package/core/packages/voice/src/exports.test.ts +38 -0
- package/core/packages/voice/src/index.ts +51 -0
- package/core/packages/voice/src/livekit.test.ts +48 -0
- package/core/packages/voice/src/livekit.ts +33 -0
- package/core/packages/voice/src/mp4box.d.ts +32 -0
- package/core/packages/voice/src/opusUtils.test.ts +29 -0
- package/core/packages/voice/src/opusUtils.ts +86 -0
- package/core/packages/voice/src/streamPreviewPlaceholder.test.ts +16 -0
- package/core/packages/voice/src/streamPreviewPlaceholder.ts +8 -0
- package/core/packages/voice/src/ws.d.ts +1 -0
- package/core/packages/voice/tsconfig.json +5 -0
- package/core/packages/voice/tsup.config.ts +10 -0
- package/core/packages/voice/vitest.config.ts +9 -0
- package/core/packages/ws/package.json +52 -0
- package/core/packages/ws/src/WebSocketManager.ts +130 -0
- package/core/packages/ws/src/WebSocketShard.ts +296 -0
- package/core/packages/ws/src/index.ts +12 -0
- package/core/packages/ws/src/utils/constants.test.ts +46 -0
- package/core/packages/ws/src/utils/constants.ts +22 -0
- package/core/packages/ws/src/utils/getWebSocket.ts +55 -0
- package/core/packages/ws/src/ws.d.ts +10 -0
- package/core/packages/ws/tsconfig.json +9 -0
- package/core/packages/ws/tsup.config.ts +9 -0
- package/core/pnpm-lock.yaml +7033 -0
- package/core/pnpm-workspace.yaml +4 -0
- package/core/scripts/generate-ai-rag.ts +240 -0
- package/core/scripts/generate-docs.ts +143 -0
- package/core/scripts/generate-emoji-shortcodes.ts +58 -0
- package/core/scripts/generate-types.ts +6 -0
- package/core/scripts/publish-ordered.js +63 -0
- package/core/scripts/test-cjs-require.mjs +43 -0
- package/core/scripts/test-esm-imports.mjs +42 -0
- package/core/scripts/test-package-exports.mjs +98 -0
- package/core/scripts/test-smoke.mjs +103 -0
- package/core/tsconfig.json +18 -0
- package/core/turbo.json +30 -0
- package/core/vitest.config.ts +17 -0
- package/core/wrangler.jsonc +9 -0
- package/package.json +26 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Snowflake } from '../common/snowflake.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Role from GET /guilds/{id}/roles
|
|
5
|
+
* permissions is bitfield as string (e.g. "8933636165185")
|
|
6
|
+
*/
|
|
7
|
+
export interface APIRole {
|
|
8
|
+
id: Snowflake;
|
|
9
|
+
name: string;
|
|
10
|
+
color: number;
|
|
11
|
+
position: number;
|
|
12
|
+
hoist_position?: number | null;
|
|
13
|
+
permissions: string;
|
|
14
|
+
hoist: boolean;
|
|
15
|
+
mentionable: boolean;
|
|
16
|
+
unicode_emoji?: string | null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Body for POST /guilds/{id}/roles (create role). All fields optional. */
|
|
20
|
+
export interface RESTCreateRoleBody {
|
|
21
|
+
name?: string;
|
|
22
|
+
permissions?: string;
|
|
23
|
+
color?: number;
|
|
24
|
+
hoist?: boolean;
|
|
25
|
+
mentionable?: boolean;
|
|
26
|
+
unicode_emoji?: string | null;
|
|
27
|
+
position?: number;
|
|
28
|
+
hoist_position?: number | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Body for PATCH /guilds/{id}/roles/{roleId} (update role). All fields optional. */
|
|
32
|
+
export interface RESTUpdateRoleBody {
|
|
33
|
+
name?: string;
|
|
34
|
+
permissions?: string;
|
|
35
|
+
color?: number;
|
|
36
|
+
hoist?: boolean;
|
|
37
|
+
mentionable?: boolean;
|
|
38
|
+
unicode_emoji?: string | null;
|
|
39
|
+
position?: number;
|
|
40
|
+
hoist_position?: number | null;
|
|
41
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Snowflake } from '../common/snowflake.js';
|
|
2
|
+
import { APIUser } from './user.js';
|
|
3
|
+
|
|
4
|
+
export interface APISticker {
|
|
5
|
+
id: Snowflake;
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
tags: string[];
|
|
9
|
+
animated: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface APIStickerWithUser extends APISticker {
|
|
13
|
+
user?: APIUser;
|
|
14
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Snowflake } from '../common/snowflake.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Partial user object returned by the API (messages, members, webhooks, etc.).
|
|
5
|
+
* @see GET /users/{id} - Returns id, username, discriminator, global_name, avatar, avatar_color, flags
|
|
6
|
+
* @see GET /users/@me - Returns full user with bot, email, premium fields, etc.
|
|
7
|
+
*/
|
|
8
|
+
export interface APIUserPartial {
|
|
9
|
+
id: Snowflake;
|
|
10
|
+
username: string;
|
|
11
|
+
discriminator: string;
|
|
12
|
+
global_name?: string | null;
|
|
13
|
+
avatar?: string | null;
|
|
14
|
+
/** RGB color as number (e.g. 7577782) */
|
|
15
|
+
avatar_color?: number | null;
|
|
16
|
+
/** Public/user flags bitfield */
|
|
17
|
+
flags?: number | null;
|
|
18
|
+
/** @deprecated Use flags. Discord compat. */
|
|
19
|
+
public_flags?: number | null;
|
|
20
|
+
/** Present when author is a bot */
|
|
21
|
+
bot?: boolean;
|
|
22
|
+
/** Whether this is an official system user */
|
|
23
|
+
system?: boolean;
|
|
24
|
+
/** User banner hash (from profile, member, or invite context) */
|
|
25
|
+
banner?: string | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type APIUser = APIUserPartial;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* User profile sub-object from GET /users/{id}/profile.
|
|
32
|
+
* @see https://docs.fluxer.app/api-reference
|
|
33
|
+
*/
|
|
34
|
+
export interface APIUserProfile {
|
|
35
|
+
pronouns?: string | null;
|
|
36
|
+
bio?: string | null;
|
|
37
|
+
banner?: string | null;
|
|
38
|
+
accent_color?: number | null;
|
|
39
|
+
banner_color?: number | null;
|
|
40
|
+
theme?: string | null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Connected account from profile response.
|
|
45
|
+
*/
|
|
46
|
+
export interface APIConnectedAccount {
|
|
47
|
+
name?: string | null;
|
|
48
|
+
type?: string | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Full profile response from GET /users/{id}/profile.
|
|
53
|
+
* Optionally use ?guild_id=GUILD_ID for server-specific profile.
|
|
54
|
+
*/
|
|
55
|
+
export interface APIProfileResponse {
|
|
56
|
+
user_profile?: APIUserProfile | null;
|
|
57
|
+
mutual_guilds?: Array<{ id: Snowflake }> | null;
|
|
58
|
+
mutual_guild_ids?: Snowflake[] | null;
|
|
59
|
+
connected_accounts?: APIConnectedAccount[] | null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Guild member from GET /guilds/{guild_id}/members or GET /guilds/{guild_id}/members/{user_id}
|
|
64
|
+
*/
|
|
65
|
+
export interface APIGuildMember {
|
|
66
|
+
user: APIUserPartial;
|
|
67
|
+
nick?: string | null;
|
|
68
|
+
avatar?: string | null;
|
|
69
|
+
banner?: string | null;
|
|
70
|
+
accent_color?: number | null;
|
|
71
|
+
roles: Snowflake[];
|
|
72
|
+
joined_at: string;
|
|
73
|
+
mute?: boolean;
|
|
74
|
+
deaf?: boolean;
|
|
75
|
+
communication_disabled_until?: string | null;
|
|
76
|
+
profile_flags?: number | null;
|
|
77
|
+
/** When the user started boosting this guild. */
|
|
78
|
+
premium_since?: string | null;
|
|
79
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Snowflake } from '../common/snowflake.js';
|
|
2
|
+
import { APIUser } from './user.js';
|
|
3
|
+
|
|
4
|
+
export enum WebhookType {
|
|
5
|
+
Incoming = 1,
|
|
6
|
+
ChannelFollower = 2,
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Webhook from GET /channels/{id}/webhooks (includes token) or GET /webhooks/{id} (no token)
|
|
11
|
+
*/
|
|
12
|
+
export interface APIWebhook {
|
|
13
|
+
id: Snowflake;
|
|
14
|
+
guild_id: Snowflake;
|
|
15
|
+
channel_id: Snowflake;
|
|
16
|
+
name: string;
|
|
17
|
+
avatar: string | null;
|
|
18
|
+
/** Present when listing channel webhooks; not returned when fetching by ID without token */
|
|
19
|
+
token?: string;
|
|
20
|
+
user: APIUser;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Request body for PATCH /webhooks/{id} (bot auth). All fields optional. */
|
|
24
|
+
export interface APIWebhookUpdateRequest {
|
|
25
|
+
name?: string;
|
|
26
|
+
avatar?: string | null;
|
|
27
|
+
channel_id?: Snowflake;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Request body for PATCH /webhooks/{id}/{token} (token auth). All fields optional. */
|
|
31
|
+
export interface APIWebhookTokenUpdateRequest {
|
|
32
|
+
name?: string;
|
|
33
|
+
avatar?: string | null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Request body for PATCH /webhooks/{id}/{token}/messages/{message_id}. All fields optional. */
|
|
37
|
+
export interface APIWebhookEditMessageRequest {
|
|
38
|
+
content?: string;
|
|
39
|
+
embeds?: unknown[];
|
|
40
|
+
attachments?: unknown[];
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './snowflake.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { FLUXER_EPOCH } from './snowflake.js';
|
|
3
|
+
|
|
4
|
+
describe('snowflake common', () => {
|
|
5
|
+
it('FLUXER_EPOCH is 2015-01-01', () => {
|
|
6
|
+
expect(FLUXER_EPOCH).toBe(1420070400000);
|
|
7
|
+
expect(new Date(FLUXER_EPOCH).toISOString()).toBe('2015-01-01T00:00:00.000Z');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snowflake ID type - 64-bit unsigned integer as string.
|
|
3
|
+
* Fluxer uses Twitter Snowflakes with epoch 1420070400000 (first second of 2015).
|
|
4
|
+
*/
|
|
5
|
+
export type Snowflake = string;
|
|
6
|
+
|
|
7
|
+
/** Fluxer epoch in milliseconds (2015-01-01 00:00:00 UTC) */
|
|
8
|
+
export const FLUXER_EPOCH = 1420070400000;
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gateway dispatch event names sent by the Fluxer gateway.
|
|
3
|
+
* Sourced from fluxer_gateway constants.erl. Use for type-safe event handling.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* if (payload.t === GatewayDispatchEvents.MessageCreate) {
|
|
8
|
+
* // handle message
|
|
9
|
+
* }
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export const GatewayDispatchEvents = {
|
|
13
|
+
// ─── Connection & Session ─────────────────────────────────────────────────
|
|
14
|
+
/** Initial connection established; contains user, guilds, and session state. */
|
|
15
|
+
Ready: 'READY',
|
|
16
|
+
/** Connection resumed after disconnect; sequence restored. */
|
|
17
|
+
Resumed: 'RESUMED',
|
|
18
|
+
/** User's active sessions list replaced (e.g. new login). */
|
|
19
|
+
SessionsReplace: 'SESSIONS_REPLACE',
|
|
20
|
+
|
|
21
|
+
// ─── User ──────────────────────────────────────────────────────────────────
|
|
22
|
+
/** Current user's profile was updated. */
|
|
23
|
+
UserUpdate: 'USER_UPDATE',
|
|
24
|
+
/** User settings changed (theme, locale, etc.). */
|
|
25
|
+
UserSettingsUpdate: 'USER_SETTINGS_UPDATE',
|
|
26
|
+
/** Per-guild user settings changed (notifications, etc.). */
|
|
27
|
+
UserGuildSettingsUpdate: 'USER_GUILD_SETTINGS_UPDATE',
|
|
28
|
+
/** Pinned DM order changed. */
|
|
29
|
+
UserPinnedDmsUpdate: 'USER_PINNED_DMS_UPDATE',
|
|
30
|
+
/** Note on another user changed. */
|
|
31
|
+
UserNoteUpdate: 'USER_NOTE_UPDATE',
|
|
32
|
+
/** Recent mention was cleared. */
|
|
33
|
+
RecentMentionDelete: 'RECENT_MENTION_DELETE',
|
|
34
|
+
|
|
35
|
+
// ─── Saved Messages & Auth ─────────────────────────────────────────────────
|
|
36
|
+
/** Message was saved (bookmarked). */
|
|
37
|
+
SavedMessageCreate: 'SAVED_MESSAGE_CREATE',
|
|
38
|
+
/** Saved message was unsaved. */
|
|
39
|
+
SavedMessageDelete: 'SAVED_MESSAGE_DELETE',
|
|
40
|
+
/** Auth session changed (login/logout on another client). */
|
|
41
|
+
AuthSessionChange: 'AUTH_SESSION_CHANGE',
|
|
42
|
+
|
|
43
|
+
// ─── Presence ───────────────────────────────────────────────────────────────
|
|
44
|
+
/** User's presence (status, activity) updated. */
|
|
45
|
+
PresenceUpdate: 'PRESENCE_UPDATE',
|
|
46
|
+
|
|
47
|
+
// ─── Guild ─────────────────────────────────────────────────────────────────
|
|
48
|
+
/** Bot joined a guild or guild data became available. */
|
|
49
|
+
GuildCreate: 'GUILD_CREATE',
|
|
50
|
+
/** Guild was updated. */
|
|
51
|
+
GuildUpdate: 'GUILD_UPDATE',
|
|
52
|
+
/** Bot left or was removed from a guild. */
|
|
53
|
+
GuildDelete: 'GUILD_DELETE',
|
|
54
|
+
/** Member joined a guild. */
|
|
55
|
+
GuildMemberAdd: 'GUILD_MEMBER_ADD',
|
|
56
|
+
/** Member was updated (roles, nickname, etc.). */
|
|
57
|
+
GuildMemberUpdate: 'GUILD_MEMBER_UPDATE',
|
|
58
|
+
/** Member left or was removed from a guild. */
|
|
59
|
+
GuildMemberRemove: 'GUILD_MEMBER_REMOVE',
|
|
60
|
+
/** Chunk of guild members (from request_guild_members). */
|
|
61
|
+
GuildMembersChunk: 'GUILD_MEMBERS_CHUNK',
|
|
62
|
+
/** Member list view updated (lazy loading). */
|
|
63
|
+
GuildMemberListUpdate: 'GUILD_MEMBER_LIST_UPDATE',
|
|
64
|
+
/** Guild sync state (passive/lazy loading). */
|
|
65
|
+
GuildSync: 'GUILD_SYNC',
|
|
66
|
+
|
|
67
|
+
// ─── Roles ──────────────────────────────────────────────────────────────────
|
|
68
|
+
/** Role was created. */
|
|
69
|
+
GuildRoleCreate: 'GUILD_ROLE_CREATE',
|
|
70
|
+
/** Role was updated. */
|
|
71
|
+
GuildRoleUpdate: 'GUILD_ROLE_UPDATE',
|
|
72
|
+
/** Multiple roles updated at once. */
|
|
73
|
+
GuildRoleUpdateBulk: 'GUILD_ROLE_UPDATE_BULK',
|
|
74
|
+
/** Role was deleted. */
|
|
75
|
+
GuildRoleDelete: 'GUILD_ROLE_DELETE',
|
|
76
|
+
|
|
77
|
+
// ─── Guild Assets ───────────────────────────────────────────────────────────
|
|
78
|
+
/** Guild emojis changed. */
|
|
79
|
+
GuildEmojisUpdate: 'GUILD_EMOJIS_UPDATE',
|
|
80
|
+
/** Guild stickers changed. */
|
|
81
|
+
GuildStickersUpdate: 'GUILD_STICKERS_UPDATE',
|
|
82
|
+
|
|
83
|
+
// ─── Moderation ─────────────────────────────────────────────────────────────
|
|
84
|
+
/** User was banned from a guild. */
|
|
85
|
+
GuildBanAdd: 'GUILD_BAN_ADD',
|
|
86
|
+
/** User was unbanned from a guild. */
|
|
87
|
+
GuildBanRemove: 'GUILD_BAN_REMOVE',
|
|
88
|
+
|
|
89
|
+
// ─── Channels ──────────────────────────────────────────────────────────────
|
|
90
|
+
/** Channel was created. */
|
|
91
|
+
ChannelCreate: 'CHANNEL_CREATE',
|
|
92
|
+
/** Channel was updated. */
|
|
93
|
+
ChannelUpdate: 'CHANNEL_UPDATE',
|
|
94
|
+
/** Multiple channels updated at once. */
|
|
95
|
+
ChannelUpdateBulk: 'CHANNEL_UPDATE_BULK',
|
|
96
|
+
/** Channel was deleted. */
|
|
97
|
+
ChannelDelete: 'CHANNEL_DELETE',
|
|
98
|
+
/** Recipient added to group DM. */
|
|
99
|
+
ChannelRecipientAdd: 'CHANNEL_RECIPIENT_ADD',
|
|
100
|
+
/** Recipient removed from group DM. */
|
|
101
|
+
ChannelRecipientRemove: 'CHANNEL_RECIPIENT_REMOVE',
|
|
102
|
+
/** Pinned messages in a channel changed. */
|
|
103
|
+
ChannelPinsUpdate: 'CHANNEL_PINS_UPDATE',
|
|
104
|
+
/** User acknowledged viewing pinned messages. */
|
|
105
|
+
ChannelPinsAck: 'CHANNEL_PINS_ACK',
|
|
106
|
+
|
|
107
|
+
// ─── Internal / Passive ────────────────────────────────────────────────────
|
|
108
|
+
/** Passive/lazy-loaded entity updates. */
|
|
109
|
+
PassiveUpdates: 'PASSIVE_UPDATES',
|
|
110
|
+
|
|
111
|
+
// ─── Invites ───────────────────────────────────────────────────────────────
|
|
112
|
+
/** Invite was created. */
|
|
113
|
+
InviteCreate: 'INVITE_CREATE',
|
|
114
|
+
/** Invite was deleted or expired. */
|
|
115
|
+
InviteDelete: 'INVITE_DELETE',
|
|
116
|
+
|
|
117
|
+
// ─── Messages ──────────────────────────────────────────────────────────────
|
|
118
|
+
/** New message was sent. */
|
|
119
|
+
MessageCreate: 'MESSAGE_CREATE',
|
|
120
|
+
/** Message was edited. */
|
|
121
|
+
MessageUpdate: 'MESSAGE_UPDATE',
|
|
122
|
+
/** Message was deleted. */
|
|
123
|
+
MessageDelete: 'MESSAGE_DELETE',
|
|
124
|
+
/** Multiple messages were deleted. */
|
|
125
|
+
MessageDeleteBulk: 'MESSAGE_DELETE_BULK',
|
|
126
|
+
/** Reaction was added to a message. */
|
|
127
|
+
MessageReactionAdd: 'MESSAGE_REACTION_ADD',
|
|
128
|
+
/** Reaction was removed from a message. */
|
|
129
|
+
MessageReactionRemove: 'MESSAGE_REACTION_REMOVE',
|
|
130
|
+
/** All reactions were removed from a message. */
|
|
131
|
+
MessageReactionRemoveAll: 'MESSAGE_REACTION_REMOVE_ALL',
|
|
132
|
+
/** All reactions of an emoji were removed from a message. */
|
|
133
|
+
MessageReactionRemoveEmoji: 'MESSAGE_REACTION_REMOVE_EMOJI',
|
|
134
|
+
/** Message was acknowledged (read receipt). */
|
|
135
|
+
MessageAck: 'MESSAGE_ACK',
|
|
136
|
+
|
|
137
|
+
// ─── Typing ─────────────────────────────────────────────────────────────────
|
|
138
|
+
/** User started typing in a channel. */
|
|
139
|
+
TypingStart: 'TYPING_START',
|
|
140
|
+
|
|
141
|
+
// ─── Webhooks ───────────────────────────────────────────────────────────────
|
|
142
|
+
/** Webhooks for a channel were updated. */
|
|
143
|
+
WebhooksUpdate: 'WEBHOOKS_UPDATE',
|
|
144
|
+
|
|
145
|
+
// ─── Relationships ──────────────────────────────────────────────────────────
|
|
146
|
+
/** Relationship (friend, block) was added. */
|
|
147
|
+
RelationshipAdd: 'RELATIONSHIP_ADD',
|
|
148
|
+
/** Relationship was updated. */
|
|
149
|
+
RelationshipUpdate: 'RELATIONSHIP_UPDATE',
|
|
150
|
+
/** Relationship was removed. */
|
|
151
|
+
RelationshipRemove: 'RELATIONSHIP_REMOVE',
|
|
152
|
+
|
|
153
|
+
// ─── Voice ───────────────────────────────────────────────────────────────────
|
|
154
|
+
/** Voice state changed (join, leave, mute, etc.). */
|
|
155
|
+
VoiceStateUpdate: 'VOICE_STATE_UPDATE',
|
|
156
|
+
/** Voice server allocation info (for connecting to voice). */
|
|
157
|
+
VoiceServerUpdate: 'VOICE_SERVER_UPDATE',
|
|
158
|
+
|
|
159
|
+
// ─── Calls ──────────────────────────────────────────────────────────────────
|
|
160
|
+
/** Call was created. */
|
|
161
|
+
CallCreate: 'CALL_CREATE',
|
|
162
|
+
/** Call was updated. */
|
|
163
|
+
CallUpdate: 'CALL_UPDATE',
|
|
164
|
+
/** Call was ended. */
|
|
165
|
+
CallDelete: 'CALL_DELETE',
|
|
166
|
+
|
|
167
|
+
// ─── Favorites ──────────────────────────────────────────────────────────────
|
|
168
|
+
/** Favorite meme/media was added. */
|
|
169
|
+
FavoriteMemeCreate: 'FAVORITE_MEME_CREATE',
|
|
170
|
+
/** Favorite meme/media was updated. */
|
|
171
|
+
FavoriteMemeUpdate: 'FAVORITE_MEME_UPDATE',
|
|
172
|
+
/** Favorite meme/media was removed. */
|
|
173
|
+
FavoriteMemeDelete: 'FAVORITE_MEME_DELETE',
|
|
174
|
+
|
|
175
|
+
// ─── SDK / Compatibility (may come from API layer) ──────────────────────────
|
|
176
|
+
/** Slash command or component interaction. */
|
|
177
|
+
InteractionCreate: 'INTERACTION_CREATE',
|
|
178
|
+
/** Guild integrations changed. */
|
|
179
|
+
GuildIntegrationsUpdate: 'GUILD_INTEGRATIONS_UPDATE',
|
|
180
|
+
/** Guild scheduled event was created. */
|
|
181
|
+
GuildScheduledEventCreate: 'GUILD_SCHEDULED_EVENT_CREATE',
|
|
182
|
+
/** Guild scheduled event was updated. */
|
|
183
|
+
GuildScheduledEventUpdate: 'GUILD_SCHEDULED_EVENT_UPDATE',
|
|
184
|
+
/** Guild scheduled event was cancelled. */
|
|
185
|
+
GuildScheduledEventDelete: 'GUILD_SCHEDULED_EVENT_DELETE',
|
|
186
|
+
} as const;
|
|
187
|
+
|
|
188
|
+
export type GatewayDispatchEventName =
|
|
189
|
+
(typeof GatewayDispatchEvents)[keyof typeof GatewayDispatchEvents];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gateway opcodes (Discord-compatible).
|
|
3
|
+
* @see https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
|
4
|
+
*/
|
|
5
|
+
export enum GatewayOpcodes {
|
|
6
|
+
Dispatch = 0,
|
|
7
|
+
Heartbeat = 1,
|
|
8
|
+
Identify = 2,
|
|
9
|
+
PresenceUpdate = 3,
|
|
10
|
+
VoiceStateUpdate = 4,
|
|
11
|
+
Resume = 6,
|
|
12
|
+
Reconnect = 7,
|
|
13
|
+
RequestGuildMembers = 8,
|
|
14
|
+
InvalidSession = 9,
|
|
15
|
+
Hello = 10,
|
|
16
|
+
HeartbeatAck = 11,
|
|
17
|
+
}
|