@erinjs/core 1.0.0 → 1.2.4
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/LICENSE → LICENSE} +203 -203
- package/README.md +46 -0
- package/dist/index.d.mts +2084 -0
- package/dist/index.d.ts +2084 -0
- package/dist/index.js +3867 -0
- package/dist/index.mjs +3809 -0
- package/package.json +50 -15
- package/core/.changeset/README.md +0 -8
- package/core/.changeset/community-bootstrap-release.md +0 -17
- package/core/.changeset/config.json +0 -11
- package/core/.changeset/no-changelog.js +0 -16
- package/core/.changeset/pre.json +0 -17
- package/core/.editorconfig +0 -13
- package/core/.gitattributes +0 -2
- package/core/.github/CODE_OF_CONDUCT.md +0 -23
- package/core/.github/FUNDING.yml +0 -7
- package/core/.github/ISSUE_TEMPLATE/bug_report.md +0 -31
- package/core/.github/ISSUE_TEMPLATE/feature_request.md +0 -23
- package/core/.github/PULL_REQUEST_TEMPLATE.md +0 -16
- package/core/.github/dependabot.yml +0 -16
- package/core/.github/workflows/autoapp.yml +0 -16
- package/core/.github/workflows/ci.yml +0 -187
- package/core/.github/workflows/codeql.yml +0 -30
- package/core/.github/workflows/deploy-docs.yml +0 -54
- package/core/.github/workflows/publish.yml +0 -43
- package/core/.lintstagedrc.json +0 -4
- package/core/.nvmrc +0 -1
- package/core/.prettierignore +0 -8
- package/core/.prettierrc +0 -11
- package/core/CONTRIBUTING.md +0 -70
- package/core/README.md +0 -61
- package/core/SECURITY.md +0 -21
- package/core/apps/docs/index.html +0 -28
- package/core/apps/docs/middleware.ts +0 -21
- package/core/apps/docs/package.json +0 -33
- package/core/apps/docs/public/@flux.png +0 -0
- package/core/apps/docs/public/docs/latest/guides.json +0 -1420
- package/core/apps/docs/public/docs/latest/main.json +0 -14981
- package/core/apps/docs/public/docs/latest/rag-index.json +0 -1
- package/core/apps/docs/public/docs/v1.0.5/guides.json +0 -226
- package/core/apps/docs/public/docs/v1.0.5/main.json +0 -7920
- package/core/apps/docs/public/docs/v1.0.6/guides.json +0 -226
- package/core/apps/docs/public/docs/v1.0.6/main.json +0 -7920
- package/core/apps/docs/public/docs/v1.0.7/guides.json +0 -259
- package/core/apps/docs/public/docs/v1.0.7/main.json +0 -8652
- package/core/apps/docs/public/docs/v1.0.8/guides.json +0 -313
- package/core/apps/docs/public/docs/v1.0.8/main.json +0 -9618
- package/core/apps/docs/public/docs/v1.0.9/guides.json +0 -319
- package/core/apps/docs/public/docs/v1.0.9/main.json +0 -10694
- package/core/apps/docs/public/docs/v1.1.0/guides.json +0 -589
- package/core/apps/docs/public/docs/v1.1.0/main.json +0 -12576
- package/core/apps/docs/public/docs/v1.1.2/guides.json +0 -650
- package/core/apps/docs/public/docs/v1.1.2/main.json +0 -13239
- package/core/apps/docs/public/docs/v1.1.3/guides.json +0 -650
- package/core/apps/docs/public/docs/v1.1.3/main.json +0 -13239
- package/core/apps/docs/public/docs/v1.1.4/guides.json +0 -708
- package/core/apps/docs/public/docs/v1.1.4/main.json +0 -13231
- package/core/apps/docs/public/docs/v1.1.5/guides.json +0 -1035
- package/core/apps/docs/public/docs/v1.1.5/main.json +0 -13838
- package/core/apps/docs/public/docs/v1.1.6/guides.json +0 -1041
- package/core/apps/docs/public/docs/v1.1.6/main.json +0 -14313
- package/core/apps/docs/public/docs/v1.1.8/guides.json +0 -1047
- package/core/apps/docs/public/docs/v1.1.8/main.json +0 -14421
- package/core/apps/docs/public/docs/v1.1.9/guides.json +0 -1047
- package/core/apps/docs/public/docs/v1.1.9/main.json +0 -14421
- package/core/apps/docs/public/docs/v1.2.0/guides.json +0 -1212
- package/core/apps/docs/public/docs/v1.2.0/main.json +0 -14663
- package/core/apps/docs/public/docs/v1.2.1/guides.json +0 -1293
- package/core/apps/docs/public/docs/v1.2.1/main.json +0 -14828
- package/core/apps/docs/public/docs/v1.2.2/guides.json +0 -1293
- package/core/apps/docs/public/docs/v1.2.2/main.json +0 -15025
- package/core/apps/docs/public/docs/v1.2.3/guides.json +0 -1420
- package/core/apps/docs/public/docs/v1.2.3/main.json +0 -14954
- package/core/apps/docs/public/docs/v1.2.4/guides.json +0 -1420
- package/core/apps/docs/public/docs/v1.2.4/main.json +0 -14981
- package/core/apps/docs/public/docs/versions.json +0 -24
- package/core/apps/docs/public/flux.png +0 -0
- package/core/apps/docs/public/locales/en.json +0 -50
- package/core/apps/docs/public/locales/guides-en.json +0 -512
- package/core/apps/docs/public/robots.txt +0 -4
- package/core/apps/docs/public/sitemap.xml +0 -33
- package/core/apps/docs/src/App.vue +0 -538
- package/core/apps/docs/src/components/ApiCategorySection.vue +0 -42
- package/core/apps/docs/src/components/ApiDiscordCompat.vue +0 -65
- package/core/apps/docs/src/components/ApiEndpointCard.vue +0 -313
- package/core/apps/docs/src/components/ApiSchemaBlock.vue +0 -131
- package/core/apps/docs/src/components/CodeBlock.vue +0 -177
- package/core/apps/docs/src/components/CommunityCallout.vue +0 -90
- package/core/apps/docs/src/components/ConstructorSection.vue +0 -82
- package/core/apps/docs/src/components/DocDescription.vue +0 -40
- package/core/apps/docs/src/components/FluxerLogo.vue +0 -3
- package/core/apps/docs/src/components/Footer.vue +0 -106
- package/core/apps/docs/src/components/GuideCodeBlock.vue +0 -102
- package/core/apps/docs/src/components/GuideDiscordCompat.vue +0 -77
- package/core/apps/docs/src/components/GuideDiscordCompatCallout.vue +0 -83
- package/core/apps/docs/src/components/GuideTable.vue +0 -77
- package/core/apps/docs/src/components/GuideTip.vue +0 -38
- package/core/apps/docs/src/components/MethodsSection.vue +0 -195
- package/core/apps/docs/src/components/ParamsTable.vue +0 -70
- package/core/apps/docs/src/components/PropertiesSection.vue +0 -143
- package/core/apps/docs/src/components/SearchBar.vue +0 -76
- package/core/apps/docs/src/components/SearchModal.vue +0 -361
- package/core/apps/docs/src/components/SidebarNav.vue +0 -225
- package/core/apps/docs/src/components/SponsorBanner.vue +0 -153
- package/core/apps/docs/src/components/TypeSignature.vue +0 -187
- package/core/apps/docs/src/components/VersionPicker.vue +0 -191
- package/core/apps/docs/src/composables/useSearchIndex.ts +0 -144
- package/core/apps/docs/src/composables/useVersionedPath.ts +0 -20
- package/core/apps/docs/src/data/apiEndpoints.ts +0 -1073
- package/core/apps/docs/src/data/changelog.ts +0 -717
- package/core/apps/docs/src/data/guides.ts +0 -2362
- package/core/apps/docs/src/env.d.ts +0 -7
- package/core/apps/docs/src/locales/guides-en.json +0 -512
- package/core/apps/docs/src/main.ts +0 -27
- package/core/apps/docs/src/pages/ApiReferenceLayout.vue +0 -175
- package/core/apps/docs/src/pages/ApiReferencePage.vue +0 -128
- package/core/apps/docs/src/pages/Changelog.vue +0 -288
- package/core/apps/docs/src/pages/ClassPage.vue +0 -319
- package/core/apps/docs/src/pages/ClassesList.vue +0 -100
- package/core/apps/docs/src/pages/DocsLayout.vue +0 -127
- package/core/apps/docs/src/pages/GuidePage.vue +0 -279
- package/core/apps/docs/src/pages/GuidesIndex.vue +0 -166
- package/core/apps/docs/src/pages/GuidesLayout.vue +0 -245
- package/core/apps/docs/src/pages/Home.vue +0 -125
- package/core/apps/docs/src/pages/NotFound.vue +0 -57
- package/core/apps/docs/src/pages/TypedefPage.vue +0 -230
- package/core/apps/docs/src/pages/TypedefsList.vue +0 -168
- package/core/apps/docs/src/pages/VersionLayout.vue +0 -15
- package/core/apps/docs/src/router.ts +0 -73
- package/core/apps/docs/src/stores/docs.ts +0 -54
- package/core/apps/docs/src/stores/guides.ts +0 -53
- package/core/apps/docs/src/stores/version.ts +0 -67
- package/core/apps/docs/src/styles/main.css +0 -278
- package/core/apps/docs/src/styles/prism.css +0 -95
- package/core/apps/docs/src/types/doc-schema.ts +0 -112
- package/core/apps/docs/tsconfig.json +0 -17
- package/core/apps/docs/tsconfig.node.json +0 -10
- package/core/apps/docs/vite.config.d.ts +0 -2
- package/core/apps/docs/vite.config.js +0 -26
- package/core/apps/docs/vite.config.ts +0 -28
- package/core/apps/docs-vitepress/.vitepress/config.ts +0 -141
- package/core/apps/docs-vitepress/api-data/latest/main.json +0 -15035
- package/core/apps/docs-vitepress/api-data/v1.2.4/main.json +0 -15035
- package/core/apps/docs-vitepress/api-data/versions.json +0 -6
- package/core/apps/docs-vitepress/index.md +0 -15
- package/core/apps/docs-vitepress/package-lock.json +0 -2924
- package/core/apps/docs-vitepress/package.json +0 -20
- package/core/apps/docs-vitepress/public/CNAME +0 -1
- package/core/apps/docs-vitepress/scripts/generate-api.ts +0 -243
- package/core/apps/docs-vitepress/scripts/migrate-guides.ts +0 -129
- package/core/apps/docs-vitepress/tsconfig.json +0 -11
- package/core/apps/docs-vitepress/v/latest/guides/attachments-by-url.md +0 -57
- package/core/apps/docs-vitepress/v/latest/guides/attachments.md +0 -62
- package/core/apps/docs-vitepress/v/latest/guides/basic-bot.md +0 -49
- package/core/apps/docs-vitepress/v/latest/guides/channels.md +0 -180
- package/core/apps/docs-vitepress/v/latest/guides/deprecated-apis.md +0 -58
- package/core/apps/docs-vitepress/v/latest/guides/discord-js-compatibility.md +0 -42
- package/core/apps/docs-vitepress/v/latest/guides/editing-embeds.md +0 -65
- package/core/apps/docs-vitepress/v/latest/guides/embed-media.md +0 -87
- package/core/apps/docs-vitepress/v/latest/guides/embeds.md +0 -166
- package/core/apps/docs-vitepress/v/latest/guides/emojis.md +0 -77
- package/core/apps/docs-vitepress/v/latest/guides/events.md +0 -202
- package/core/apps/docs-vitepress/v/latest/guides/gifs.md +0 -47
- package/core/apps/docs-vitepress/v/latest/guides/installation.md +0 -10
- package/core/apps/docs-vitepress/v/latest/guides/moderation.md +0 -89
- package/core/apps/docs-vitepress/v/latest/guides/permissions.md +0 -130
- package/core/apps/docs-vitepress/v/latest/guides/prefix-commands.md +0 -41
- package/core/apps/docs-vitepress/v/latest/guides/profile-urls.md +0 -58
- package/core/apps/docs-vitepress/v/latest/guides/reactions.md +0 -69
- package/core/apps/docs-vitepress/v/latest/guides/roles.md +0 -130
- package/core/apps/docs-vitepress/v/latest/guides/sending-without-reply.md +0 -172
- package/core/apps/docs-vitepress/v/latest/guides/voice.md +0 -109
- package/core/apps/docs-vitepress/v/latest/guides/wait-for-guilds.md +0 -37
- package/core/apps/docs-vitepress/v/latest/guides/webhook-attachments-embeds.md +0 -73
- package/core/apps/docs-vitepress/v/latest/guides/webhooks.md +0 -131
- package/core/eslint.config.js +0 -80
- package/core/examples/.env.example +0 -22
- package/core/examples/README.md +0 -68
- package/core/examples/first-steps-bot.js +0 -118
- package/core/examples/minimal-bot.js +0 -17
- package/core/examples/moderation-bot.js +0 -209
- package/core/examples/package.json +0 -14
- package/core/examples/ping-bot.js +0 -1146
- package/core/examples/reaction-bot.js +0 -70
- package/core/examples/reaction-roles-bot.js +0 -140
- package/core/examples/webhook-bot.js +0 -239
- package/core/flux.png +0 -0
- package/core/package.json +0 -78
- package/core/packages/builders/package.json +0 -51
- package/core/packages/builders/src/index.ts +0 -13
- package/core/packages/builders/src/messages/AttachmentBuilder.test.ts +0 -79
- package/core/packages/builders/src/messages/AttachmentBuilder.ts +0 -69
- package/core/packages/builders/src/messages/EmbedBuilder.test.ts +0 -266
- package/core/packages/builders/src/messages/EmbedBuilder.ts +0 -239
- package/core/packages/builders/src/messages/MessagePayload.test.ts +0 -118
- package/core/packages/builders/src/messages/MessagePayload.ts +0 -122
- package/core/packages/builders/tsconfig.json +0 -9
- package/core/packages/builders/tsup.config.ts +0 -9
- package/core/packages/builders/vitest.config.ts +0 -9
- package/core/packages/collection/package.json +0 -47
- package/core/packages/collection/src/Collection.test.ts +0 -232
- package/core/packages/collection/src/Collection.ts +0 -196
- package/core/packages/collection/src/index.ts +0 -1
- package/core/packages/collection/tsconfig.json +0 -9
- package/core/packages/collection/tsup.config.ts +0 -9
- package/core/packages/collection/vitest.config.ts +0 -9
- package/core/packages/docgen/package.json +0 -26
- package/core/packages/docgen/src/extract.ts +0 -262
- package/core/packages/docgen/src/formatType.ts +0 -24
- package/core/packages/docgen/src/index.ts +0 -103
- package/core/packages/docgen/src/schema.ts +0 -100
- package/core/packages/docgen/src/visitor.ts +0 -147
- package/core/packages/docgen/tsconfig.json +0 -9
- package/core/packages/docgen/tsup.config.ts +0 -9
- package/core/packages/fluxer-core/README.md +0 -26
- package/core/packages/fluxer-core/package.json +0 -60
- package/core/packages/fluxer-core/src/client/ChannelManager.ts +0 -143
- package/core/packages/fluxer-core/src/client/Client.gateway.test.ts +0 -84
- package/core/packages/fluxer-core/src/client/Client.resolveEmoji.test.ts +0 -45
- package/core/packages/fluxer-core/src/client/Client.ts +0 -558
- package/core/packages/fluxer-core/src/client/ClientUser.ts +0 -40
- package/core/packages/fluxer-core/src/client/EventHandlerRegistry.ts +0 -469
- package/core/packages/fluxer-core/src/client/GuildManager.ts +0 -79
- package/core/packages/fluxer-core/src/client/GuildMemberManager.ts +0 -91
- package/core/packages/fluxer-core/src/client/MessageManager.ts +0 -58
- package/core/packages/fluxer-core/src/client/UsersManager.ts +0 -122
- package/core/packages/fluxer-core/src/errors/ErrorCodes.test.ts +0 -19
- package/core/packages/fluxer-core/src/errors/ErrorCodes.ts +0 -12
- package/core/packages/fluxer-core/src/errors/FluxerError.test.ts +0 -32
- package/core/packages/fluxer-core/src/errors/FluxerError.ts +0 -15
- package/core/packages/fluxer-core/src/index.ts +0 -85
- package/core/packages/fluxer-core/src/structures/Base.ts +0 -7
- package/core/packages/fluxer-core/src/structures/Channel.ts +0 -508
- package/core/packages/fluxer-core/src/structures/Guild.test.ts +0 -189
- package/core/packages/fluxer-core/src/structures/Guild.ts +0 -734
- package/core/packages/fluxer-core/src/structures/GuildBan.ts +0 -35
- package/core/packages/fluxer-core/src/structures/GuildEmoji.ts +0 -57
- package/core/packages/fluxer-core/src/structures/GuildMember.test.ts +0 -203
- package/core/packages/fluxer-core/src/structures/GuildMember.ts +0 -213
- package/core/packages/fluxer-core/src/structures/GuildMemberRoleManager.ts +0 -121
- package/core/packages/fluxer-core/src/structures/GuildSticker.ts +0 -56
- package/core/packages/fluxer-core/src/structures/Invite.test.ts +0 -103
- package/core/packages/fluxer-core/src/structures/Invite.ts +0 -121
- package/core/packages/fluxer-core/src/structures/Message.test.ts +0 -109
- package/core/packages/fluxer-core/src/structures/Message.ts +0 -397
- package/core/packages/fluxer-core/src/structures/MessageReaction.ts +0 -72
- package/core/packages/fluxer-core/src/structures/PartialMessage.ts +0 -12
- package/core/packages/fluxer-core/src/structures/Role.test.ts +0 -77
- package/core/packages/fluxer-core/src/structures/Role.ts +0 -112
- package/core/packages/fluxer-core/src/structures/User.test.ts +0 -110
- package/core/packages/fluxer-core/src/structures/User.ts +0 -109
- package/core/packages/fluxer-core/src/structures/Webhook.test.ts +0 -109
- package/core/packages/fluxer-core/src/structures/Webhook.ts +0 -258
- package/core/packages/fluxer-core/src/util/Constants.test.ts +0 -16
- package/core/packages/fluxer-core/src/util/Constants.ts +0 -7
- package/core/packages/fluxer-core/src/util/Events.ts +0 -46
- package/core/packages/fluxer-core/src/util/MessageCollector.ts +0 -87
- package/core/packages/fluxer-core/src/util/Options.ts +0 -33
- package/core/packages/fluxer-core/src/util/ReactionCollector.ts +0 -116
- package/core/packages/fluxer-core/src/util/cdn.test.ts +0 -108
- package/core/packages/fluxer-core/src/util/cdn.ts +0 -130
- package/core/packages/fluxer-core/src/util/guildUtils.ts +0 -33
- package/core/packages/fluxer-core/src/util/messageUtils.test.ts +0 -74
- package/core/packages/fluxer-core/src/util/messageUtils.ts +0 -119
- package/core/packages/fluxer-core/src/util/permissions.test.ts +0 -95
- package/core/packages/fluxer-core/src/util/permissions.ts +0 -43
- package/core/packages/fluxer-core/tsconfig.json +0 -9
- package/core/packages/fluxer-core/tsup.config.ts +0 -9
- package/core/packages/fluxer-core/vitest.config.ts +0 -9
- package/core/packages/rest/package.json +0 -52
- package/core/packages/rest/src/REST.test.ts +0 -64
- package/core/packages/rest/src/REST.ts +0 -90
- package/core/packages/rest/src/RateLimitManager.test.ts +0 -71
- package/core/packages/rest/src/RateLimitManager.ts +0 -60
- package/core/packages/rest/src/RequestManager.test.ts +0 -87
- package/core/packages/rest/src/RequestManager.ts +0 -172
- package/core/packages/rest/src/errors/FluxerAPIError.test.ts +0 -57
- package/core/packages/rest/src/errors/FluxerAPIError.ts +0 -21
- package/core/packages/rest/src/errors/HTTPError.test.ts +0 -55
- package/core/packages/rest/src/errors/HTTPError.ts +0 -25
- package/core/packages/rest/src/errors/RateLimitError.test.ts +0 -41
- package/core/packages/rest/src/errors/RateLimitError.ts +0 -15
- package/core/packages/rest/src/errors/index.ts +0 -3
- package/core/packages/rest/src/index.ts +0 -6
- package/core/packages/rest/src/utils/constants.test.ts +0 -31
- package/core/packages/rest/src/utils/constants.ts +0 -5
- package/core/packages/rest/src/utils/files.test.ts +0 -37
- package/core/packages/rest/src/utils/files.ts +0 -75
- package/core/packages/rest/tsconfig.json +0 -9
- package/core/packages/rest/tsup.config.ts +0 -9
- package/core/packages/rest/vitest.config.ts +0 -9
- package/core/packages/types/package.json +0 -46
- package/core/packages/types/src/api/ban.ts +0 -8
- package/core/packages/types/src/api/channel.ts +0 -65
- package/core/packages/types/src/api/embed.ts +0 -82
- package/core/packages/types/src/api/emoji.ts +0 -12
- package/core/packages/types/src/api/errors.ts +0 -68
- package/core/packages/types/src/api/gateway.ts +0 -14
- package/core/packages/types/src/api/guild.ts +0 -123
- package/core/packages/types/src/api/index.ts +0 -15
- package/core/packages/types/src/api/instance.ts +0 -32
- package/core/packages/types/src/api/interaction.ts +0 -26
- package/core/packages/types/src/api/invite.ts +0 -28
- package/core/packages/types/src/api/message.ts +0 -140
- package/core/packages/types/src/api/role.ts +0 -41
- package/core/packages/types/src/api/sticker.ts +0 -14
- package/core/packages/types/src/api/user.ts +0 -79
- package/core/packages/types/src/api/webhook.ts +0 -41
- package/core/packages/types/src/common/index.ts +0 -1
- package/core/packages/types/src/common/snowflake.test.ts +0 -9
- package/core/packages/types/src/common/snowflake.ts +0 -8
- package/core/packages/types/src/gateway/events.ts +0 -189
- package/core/packages/types/src/gateway/index.ts +0 -3
- package/core/packages/types/src/gateway/opcodes.ts +0 -17
- package/core/packages/types/src/gateway/payloads.ts +0 -481
- package/core/packages/types/src/index.ts +0 -4
- package/core/packages/types/src/rest/index.ts +0 -1
- package/core/packages/types/src/rest/routes.test.ts +0 -169
- package/core/packages/types/src/rest/routes.ts +0 -109
- package/core/packages/types/tsconfig.json +0 -9
- package/core/packages/types/tsup.config.ts +0 -9
- package/core/packages/types/vitest.config.ts +0 -9
- package/core/packages/util/package.json +0 -51
- package/core/packages/util/src/BitField.test.ts +0 -96
- package/core/packages/util/src/BitField.ts +0 -105
- package/core/packages/util/src/MessageFlagsBitField.test.ts +0 -42
- package/core/packages/util/src/MessageFlagsBitField.ts +0 -20
- package/core/packages/util/src/PermissionsBitField.test.ts +0 -79
- package/core/packages/util/src/PermissionsBitField.ts +0 -97
- package/core/packages/util/src/SnowflakeUtil.test.ts +0 -69
- package/core/packages/util/src/SnowflakeUtil.ts +0 -65
- package/core/packages/util/src/UserFlagsBitField.test.ts +0 -39
- package/core/packages/util/src/UserFlagsBitField.ts +0 -48
- package/core/packages/util/src/deprecation.test.ts +0 -44
- package/core/packages/util/src/deprecation.ts +0 -28
- package/core/packages/util/src/emojiShortcodes.generated.ts +0 -5
- package/core/packages/util/src/emojiShortcodes.test.ts +0 -41
- package/core/packages/util/src/emojiShortcodes.ts +0 -22
- package/core/packages/util/src/formatters.test.ts +0 -65
- package/core/packages/util/src/formatters.ts +0 -35
- package/core/packages/util/src/index.ts +0 -34
- package/core/packages/util/src/resolvers.test.ts +0 -198
- package/core/packages/util/src/resolvers.ts +0 -127
- package/core/packages/util/src/tenorUtils.test.ts +0 -75
- package/core/packages/util/src/tenorUtils.ts +0 -86
- package/core/packages/util/tsconfig.json +0 -9
- package/core/packages/util/tsup.config.ts +0 -9
- package/core/packages/util/vitest.config.ts +0 -9
- package/core/packages/voice/README.md +0 -42
- package/core/packages/voice/package.json +0 -67
- package/core/packages/voice/src/LiveKitRtcConnection.receive.test.ts +0 -24
- package/core/packages/voice/src/LiveKitRtcConnection.ts +0 -1767
- package/core/packages/voice/src/VoiceConnection.ts +0 -413
- package/core/packages/voice/src/VoiceManager.receive.test.ts +0 -61
- package/core/packages/voice/src/VoiceManager.test.ts +0 -44
- package/core/packages/voice/src/VoiceManager.ts +0 -503
- package/core/packages/voice/src/exports.test.ts +0 -38
- package/core/packages/voice/src/index.ts +0 -51
- package/core/packages/voice/src/livekit.test.ts +0 -48
- package/core/packages/voice/src/livekit.ts +0 -33
- package/core/packages/voice/src/mp4box.d.ts +0 -32
- package/core/packages/voice/src/opusUtils.test.ts +0 -29
- package/core/packages/voice/src/opusUtils.ts +0 -86
- package/core/packages/voice/src/streamPreviewPlaceholder.test.ts +0 -16
- package/core/packages/voice/src/streamPreviewPlaceholder.ts +0 -8
- package/core/packages/voice/src/ws.d.ts +0 -1
- package/core/packages/voice/tsconfig.json +0 -5
- package/core/packages/voice/tsup.config.ts +0 -10
- package/core/packages/voice/vitest.config.ts +0 -9
- package/core/packages/ws/package.json +0 -52
- package/core/packages/ws/src/WebSocketManager.ts +0 -130
- package/core/packages/ws/src/WebSocketShard.ts +0 -296
- package/core/packages/ws/src/index.ts +0 -12
- package/core/packages/ws/src/utils/constants.test.ts +0 -46
- package/core/packages/ws/src/utils/constants.ts +0 -22
- package/core/packages/ws/src/utils/getWebSocket.ts +0 -55
- package/core/packages/ws/src/ws.d.ts +0 -10
- package/core/packages/ws/tsconfig.json +0 -9
- package/core/packages/ws/tsup.config.ts +0 -9
- package/core/pnpm-lock.yaml +0 -7033
- package/core/pnpm-workspace.yaml +0 -4
- package/core/scripts/generate-ai-rag.ts +0 -240
- package/core/scripts/generate-docs.ts +0 -143
- package/core/scripts/generate-emoji-shortcodes.ts +0 -58
- package/core/scripts/generate-types.ts +0 -6
- package/core/scripts/publish-ordered.js +0 -63
- package/core/scripts/test-cjs-require.mjs +0 -43
- package/core/scripts/test-esm-imports.mjs +0 -42
- package/core/scripts/test-package-exports.mjs +0 -98
- package/core/scripts/test-smoke.mjs +0 -103
- package/core/tsconfig.json +0 -18
- package/core/turbo.json +0 -30
- package/core/vitest.config.ts +0 -17
- package/core/wrangler.jsonc +0 -9
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
# Channels
|
|
2
|
-
|
|
3
|
-
Create and manage channels, roles, and invites. Covers guild.createChannel(), channel.edit(), channel.createInvite(), guild.createRole(), and more.
|
|
4
|
-
|
|
5
|
-
## Channels — Create
|
|
6
|
-
|
|
7
|
-
Use guild.createChannel() to create text (0), voice (2), category (4), or link (5) channels. Requires Manage Channels permission. Pass parent_id to put a channel under a category.
|
|
8
|
-
|
|
9
|
-
```javascript
|
|
10
|
-
import { Client, Events } from '@erinjs/core';
|
|
11
|
-
|
|
12
|
-
const client = new Client({ intents: 0 });
|
|
13
|
-
|
|
14
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
15
|
-
if (!message.guildId || message.content !== '!createchannel') return;
|
|
16
|
-
const guild = client.guilds.get(message.guildId) ?? await client.guilds.resolve(message.guildId);
|
|
17
|
-
if (!guild) return;
|
|
18
|
-
|
|
19
|
-
// Text channel (0), voice (2), category (4), link (5)
|
|
20
|
-
const textChannel = await guild.createChannel({
|
|
21
|
-
type: 0,
|
|
22
|
-
name: 'general',
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
// Category, then voice channel under it
|
|
26
|
-
const category = await guild.createChannel({
|
|
27
|
-
type: 4,
|
|
28
|
-
name: 'Voice Chats',
|
|
29
|
-
});
|
|
30
|
-
const voiceChannel = await guild.createChannel({
|
|
31
|
-
type: 2,
|
|
32
|
-
name: 'Lounge',
|
|
33
|
-
parent_id: category.id,
|
|
34
|
-
bitrate: 64000,
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
await message.reply(`Created ${textChannel.name} and ${voiceChannel.name} in ${category.name}`);
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
await client.login(process.env.ERIN_BOT_TOKEN);
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Channels — Fetch and Edit
|
|
44
|
-
|
|
45
|
-
Use guild.fetchChannels() to load all guild channels. Use channel.edit() to rename, set topic, move to a category, set slowmode, or update permission overwrites.
|
|
46
|
-
|
|
47
|
-
```javascript
|
|
48
|
-
const guild = client.guilds.get(guildId) ?? await client.guilds.resolve(guildId);
|
|
49
|
-
if (!guild) return;
|
|
50
|
-
|
|
51
|
-
const channels = await guild.fetchChannels();
|
|
52
|
-
|
|
53
|
-
// Edit a text channel
|
|
54
|
-
const channel = guild.channels.get(channelId);
|
|
55
|
-
if (channel) {
|
|
56
|
-
await channel.edit({
|
|
57
|
-
name: 'renamed-channel',
|
|
58
|
-
topic: 'New topic here',
|
|
59
|
-
parent_id: categoryId, // Move under category
|
|
60
|
-
rate_limit_per_user: 5, // 5 second slowmode
|
|
61
|
-
nsfw: false,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Channels — Delete and Reorder
|
|
67
|
-
|
|
68
|
-
Use channel.delete() to remove a channel. Use guild.setChannelPositions() to reorder channels or move them between categories.
|
|
69
|
-
|
|
70
|
-
```javascript
|
|
71
|
-
// Delete channel (silent: true skips system message)
|
|
72
|
-
await channel.delete();
|
|
73
|
-
await channel.delete({ silent: true });
|
|
74
|
-
|
|
75
|
-
// Reorder channels
|
|
76
|
-
await guild.setChannelPositions([
|
|
77
|
-
{ id: channelId1, position: 0 },
|
|
78
|
-
{ id: channelId2, position: 1, parent_id: categoryId },
|
|
79
|
-
]);
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Channel Permission Overwrites
|
|
83
|
-
|
|
84
|
-
Use channel.editPermission() to add or update overwrites (type 0=role, 1=member). Use channel.deletePermission() to remove. Use resolvePermissionsToBitfield() for allow/deny bitfields.
|
|
85
|
-
|
|
86
|
-
```javascript
|
|
87
|
-
import { resolvePermissionsToBitfield, PermissionFlags } from '@erinjs/core';
|
|
88
|
-
|
|
89
|
-
// Deny SendMessages for a role (type 0=role, 1=member)
|
|
90
|
-
await channel.editPermission(roleId, {
|
|
91
|
-
type: 0,
|
|
92
|
-
deny: resolvePermissionsToBitfield(['SendMessages']),
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
// Allow ViewChannel for a specific member
|
|
96
|
-
await channel.editPermission(userId, {
|
|
97
|
-
type: 1,
|
|
98
|
-
allow: resolvePermissionsToBitfield([PermissionFlags.ViewChannel]),
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
// Remove overwrite
|
|
102
|
-
await channel.deletePermission(roleId);
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Roles — Quick Reference
|
|
106
|
-
|
|
107
|
-
Create roles with guild.createRole(), fetch with guild.fetchRoles() or guild.fetchRole(roleId). Add/remove with guild.addRoleToMember() / guild.removeRoleFromMember(). Reorder with guild.setRolePositions().
|
|
108
|
-
|
|
109
|
-
::: tip
|
|
110
|
-
See the Roles guide for full examples, permission bitfields, and role.edit() / role.delete().
|
|
111
|
-
:::
|
|
112
|
-
|
|
113
|
-
```javascript
|
|
114
|
-
// See the Roles guide for full examples and permission bitfields.
|
|
115
|
-
const role = await guild.createRole({ name: 'Mod', permissions: ['KickMembers', 'BanMembers'] });
|
|
116
|
-
await guild.addRoleToMember(userId, role.id);
|
|
117
|
-
await guild.removeRoleFromMember(userId, role.id);
|
|
118
|
-
await guild.setRolePositions([{ id: role.id, position: 5 }]);
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Invites
|
|
122
|
-
|
|
123
|
-
Use channel.createInvite() to create an invite. Use channel.fetchInvites() to list channel invites. Use invite.delete() to revoke. invite.url gives the full invite URL.
|
|
124
|
-
|
|
125
|
-
```javascript
|
|
126
|
-
import { Client, Events } from '@erinjs/core';
|
|
127
|
-
|
|
128
|
-
const client = new Client({ intents: 0 });
|
|
129
|
-
|
|
130
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
131
|
-
if (!message.content.startsWith('!invite') || !message.guildId) return;
|
|
132
|
-
const channel = message.channel;
|
|
133
|
-
if (!channel?.createInvite) return;
|
|
134
|
-
|
|
135
|
-
if (message.content === '!invite') {
|
|
136
|
-
const invite = await channel.createInvite({
|
|
137
|
-
max_age: 86400, // 24 hours
|
|
138
|
-
max_uses: 10,
|
|
139
|
-
temporary: false,
|
|
140
|
-
});
|
|
141
|
-
await message.reply(`Invite: ${invite.url}`);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (message.content === '!invitelist') {
|
|
145
|
-
const invites = await channel.fetchInvites();
|
|
146
|
-
const list = invites.map((i) => `${i.code} (${i.max_uses ?? '∞'} uses)`).join('\n');
|
|
147
|
-
await message.reply(list || 'No invites.');
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (message.content.startsWith('!inviterevoke ')) {
|
|
151
|
-
const code = message.content.slice(13).trim();
|
|
152
|
-
const invites = await channel.fetchInvites();
|
|
153
|
-
const inv = invites.find((i) => i.code === code);
|
|
154
|
-
if (inv) {
|
|
155
|
-
await inv.delete();
|
|
156
|
-
await message.reply('Invite revoked.');
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
await client.login(process.env.ERIN_BOT_TOKEN);
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Quick Reference
|
|
165
|
-
|
|
166
|
-
| API | Method | Purpose |
|
|
167
|
-
| --- | --- | --- |
|
|
168
|
-
| `Channels` | `guild.createChannel()` | Create text, voice, category, or link channel |
|
|
169
|
-
| `Channels` | `guild.fetchChannels()` | Fetch all guild channels |
|
|
170
|
-
| `Channels` | `channel.edit()` | Rename, set topic, slowmode, parent, overwrites |
|
|
171
|
-
| `Channels` | `channel.delete()` | Delete a channel |
|
|
172
|
-
| `Channels` | `guild.setChannelPositions()` | Reorder or reparent channels |
|
|
173
|
-
| `Channels` | `channel.editPermission()` | Add or update permission overwrite |
|
|
174
|
-
| `Channels` | `channel.deletePermission()` | Remove permission overwrite |
|
|
175
|
-
| `Roles` | `guild.createRole()` | Create a role |
|
|
176
|
-
| `Roles` | `guild.addRoleToMember()` | Add role to member |
|
|
177
|
-
| `Roles` | `guild.removeRoleFromMember()` | Remove role from member |
|
|
178
|
-
| `Invites` | `channel.createInvite()` | Create invite with max_uses, max_age |
|
|
179
|
-
| `Invites` | `channel.fetchInvites()` | List channel invites |
|
|
180
|
-
| `Invites` | `invite.delete()` | Revoke invite |
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
# Deprecated APIs
|
|
2
|
-
|
|
3
|
-
APIs that are deprecated and will be removed in a future release. Migrate to the recommended alternatives.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The following methods emit a one-time deprecation warning at runtime. Set ERIN_SUPPRESS_DEPRECATION=1 to silence warnings. Migrate to the recommended replacements.
|
|
8
|
-
|
|
9
|
-
## Client.sendToChannel
|
|
10
|
-
|
|
11
|
-
Use client.channels.send(channelId, payload) instead. Accepts the same MessageSendOptions (content, embeds, files).
|
|
12
|
-
|
|
13
|
-
| Deprecated | Replacement |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| `client.sendToChannel(channelId, content)` | `client.channels.send(channelId, payload)` |
|
|
16
|
-
|
|
17
|
-
```javascript
|
|
18
|
-
// ❌ Deprecated
|
|
19
|
-
await client.sendToChannel(channelId, 'Hello!');
|
|
20
|
-
await client.sendToChannel(channelId, { embeds: [embed] });
|
|
21
|
-
|
|
22
|
-
// ✅ Use instead
|
|
23
|
-
await client.channels.send(channelId, 'Hello!');
|
|
24
|
-
await client.channels.send(channelId, { embeds: [embed] });
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Client.fetchMessage
|
|
28
|
-
|
|
29
|
-
Use channel.messages.fetch(messageId) instead. Resolve the channel first if you only have IDs.
|
|
30
|
-
|
|
31
|
-
| Deprecated | Replacement |
|
|
32
|
-
| --- | --- |
|
|
33
|
-
| `client.fetchMessage(channelId, messageId)` | `(await client.channels.resolve(channelId))?.messages?.fetch(messageId)` |
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
// ❌ Deprecated
|
|
37
|
-
const message = await client.fetchMessage(channelId, messageId);
|
|
38
|
-
|
|
39
|
-
// ✅ Use instead
|
|
40
|
-
const channel = await client.channels.resolve(channelId);
|
|
41
|
-
const message = channel?.messages ? await channel.messages.fetch(messageId) : null;
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## ChannelManager.fetchMessage
|
|
45
|
-
|
|
46
|
-
Use channel.messages.fetch(messageId) instead.
|
|
47
|
-
|
|
48
|
-
| Deprecated | Replacement |
|
|
49
|
-
| --- | --- |
|
|
50
|
-
| `client.channels.fetchMessage(channelId, messageId)` | `channel.messages.fetch(messageId)` |
|
|
51
|
-
|
|
52
|
-
## Channel.fetchMessage
|
|
53
|
-
|
|
54
|
-
Use channel.messages.fetch(messageId) instead. Available on TextChannel and DMChannel.
|
|
55
|
-
|
|
56
|
-
| Deprecated | Replacement |
|
|
57
|
-
| --- | --- |
|
|
58
|
-
| `channel.fetchMessage(messageId)` | `channel.messages.fetch(messageId)` |
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Discord.js Compatibility
|
|
2
|
-
|
|
3
|
-
APIs designed to ease migration from Discord.js. Look for the green "Discord.js compatible" badge in guides.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
erin.js SDK provides Discord.js-style APIs where it makes sense. Sections marked with the green "Discord.js compatible" badge offer familiar patterns — click the badge to see the full API reference.
|
|
8
|
-
|
|
9
|
-
## member.roles (GuildMemberRoleManager)
|
|
10
|
-
|
|
11
|
-
::: info Discord.js Compatible
|
|
12
|
-
See [API reference](/v/latest/api/classes/GuildMemberRoleManager) for full details.
|
|
13
|
-
:::
|
|
14
|
-
|
|
15
|
-
member.roles is a manager with add(), remove(), set(), and cache. Use member.roles.add(roleId), member.roles.remove(roleId), member.roles.set(roleIds), and member.roles.cache.has(roleId) instead of the old member.addRole() / member.roles.includes() pattern.
|
|
16
|
-
|
|
17
|
-
```javascript
|
|
18
|
-
// Discord.js style
|
|
19
|
-
await member.roles.add(roleId);
|
|
20
|
-
await member.roles.remove(roleId);
|
|
21
|
-
await member.roles.set(['id1', 'id2']);
|
|
22
|
-
if (member.roles.cache.has(roleId)) { ... }
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## guild.members.me
|
|
26
|
-
|
|
27
|
-
::: info Discord.js Compatible
|
|
28
|
-
See [API reference](/v/latest/api/classes/GuildMemberManager) for full details.
|
|
29
|
-
:::
|
|
30
|
-
|
|
31
|
-
guild.members.me returns the bot's GuildMember in that guild. Use guild.members.fetchMe() to load it when not cached. Same as Discord.js.
|
|
32
|
-
|
|
33
|
-
```javascript
|
|
34
|
-
const me = guild.members.me ?? await guild.members.fetchMe();
|
|
35
|
-
if (me?.permissions.has(PermissionFlags.BanMembers)) {
|
|
36
|
-
await message.reply('I can ban members here.');
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Other parity
|
|
41
|
-
|
|
42
|
-
client.channels.cache and client.guilds.cache are compatibility aliases. Collection extends Map with find(), filter(), etc. See the API reference for full details.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# Editing Embeds
|
|
2
|
-
|
|
3
|
-
Edit existing message embeds with message.edit().
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
The erin.js API supports editing existing messages via PATCH. You can update the message content, embeds, or both. Only the message author (or admins with proper permissions) can edit messages.
|
|
8
|
-
|
|
9
|
-
## Edit Content
|
|
10
|
-
|
|
11
|
-
Update the text content of a message you sent.
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
const reply = await message.reply('Initial message');
|
|
15
|
-
await reply.edit({ content: 'Updated message!' });
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Edit Embeds
|
|
19
|
-
|
|
20
|
-
Replace or update embeds on an existing message. Pass an array of EmbedBuilder instances or APIEmbed objects.
|
|
21
|
-
|
|
22
|
-
```javascript
|
|
23
|
-
import { Client, Events, EmbedBuilder } from '@erinjs/core';
|
|
24
|
-
|
|
25
|
-
const client = new Client({ intents: 0 });
|
|
26
|
-
|
|
27
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
28
|
-
if (message.content === '!editembed') {
|
|
29
|
-
const embed = new EmbedBuilder()
|
|
30
|
-
.setTitle('Loading...')
|
|
31
|
-
.setColor(0x5865f2)
|
|
32
|
-
.setTimestamp();
|
|
33
|
-
|
|
34
|
-
const reply = await message.reply({ embeds: [embed] });
|
|
35
|
-
|
|
36
|
-
// Simulate loading, then update the embed
|
|
37
|
-
await new Promise((r) => setTimeout(r, 2000));
|
|
38
|
-
|
|
39
|
-
const updatedEmbed = new EmbedBuilder()
|
|
40
|
-
.setTitle('Done!')
|
|
41
|
-
.setDescription('This embed was edited after 2 seconds.')
|
|
42
|
-
.setColor(0x57f287)
|
|
43
|
-
.setTimestamp();
|
|
44
|
-
|
|
45
|
-
await reply.edit({ embeds: [updatedEmbed] });
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
await client.login(process.env.ERIN_BOT_TOKEN);
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Edit Content and Embeds Together
|
|
53
|
-
|
|
54
|
-
You can update both content and embeds in a single edit call.
|
|
55
|
-
|
|
56
|
-
```javascript
|
|
57
|
-
await message.edit({
|
|
58
|
-
content: 'Updated text',
|
|
59
|
-
embeds: [new EmbedBuilder().setTitle('Updated embed').setColor(0x5865f2)],
|
|
60
|
-
});
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## API Reference
|
|
64
|
-
|
|
65
|
-
The edit endpoint is PATCH /channels/{channel_id}/messages/{message_id}. See openapi.json for the full request body schema. The SDK Message.edit() accepts { content?: string; embeds?: (APIEmbed | EmbedBuilder)[] }.
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# Embed Media
|
|
2
|
-
|
|
3
|
-
Add images, thumbnails, video, and audio to embeds with EmbedBuilder and EmbedMediaOptions.
|
|
4
|
-
|
|
5
|
-
## Images and Thumbnails
|
|
6
|
-
|
|
7
|
-
Use setImage() and setThumbnail() with a URL string, or pass full EmbedMediaOptions for width, height, content_type, and other metadata.
|
|
8
|
-
|
|
9
|
-
```javascript
|
|
10
|
-
import { Client, Events, EmbedBuilder } from '@erinjs/core';
|
|
11
|
-
|
|
12
|
-
const client = new Client({ intents: 0 });
|
|
13
|
-
|
|
14
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
15
|
-
if (message.content === '!embedimg') {
|
|
16
|
-
const embed = new EmbedBuilder()
|
|
17
|
-
.setTitle('Image Embed')
|
|
18
|
-
.setDescription('Simple image from URL.')
|
|
19
|
-
.setImage('https://placehold.co/400x200/5865f2/white?text=Image')
|
|
20
|
-
.setThumbnail('https://placehold.co/100x100/57f287/white?text=Thumb')
|
|
21
|
-
.setColor(0x5865f2);
|
|
22
|
-
|
|
23
|
-
await message.reply({ embeds: [embed] });
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Image with Full Media Options
|
|
29
|
-
|
|
30
|
-
Pass an object to setImage or setThumbnail with url, width, height, content_type, description, placeholder, duration, and flags. Use EmbedMediaFlags.IS_ANIMATED for animated GIFs.
|
|
31
|
-
|
|
32
|
-
```javascript
|
|
33
|
-
const embed = new EmbedBuilder()
|
|
34
|
-
.setTitle('Image with metadata')
|
|
35
|
-
.setDescription('EmbedMediaOptions: width, height')
|
|
36
|
-
.setImage({
|
|
37
|
-
url: 'https://placehold.co/400x200/5865f2/white?text=Image',
|
|
38
|
-
width: 400,
|
|
39
|
-
height: 200,
|
|
40
|
-
content_type: 'image/png',
|
|
41
|
-
})
|
|
42
|
-
.setColor(0x5865f2);
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## GIFs in embeds
|
|
46
|
-
|
|
47
|
-
Embeds require GIF format for animated images (not MP4). Add EmbedMediaFlags.IS_ANIMATED to the flags field. For Tenor URLs, use resolveTenorToImageUrl() to get the GIF URL and flag — see the GIFs (Tenor) guide.
|
|
48
|
-
|
|
49
|
-
## Video in Embeds
|
|
50
|
-
|
|
51
|
-
Use setVideo() to add video to a rich embed. erin.js supports the .video field. Include a title when using video. Pass a URL or EmbedMediaOptions (e.g. duration for progress bars).
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
const embed = new EmbedBuilder()
|
|
55
|
-
.setTitle('Video embed')
|
|
56
|
-
.setDescription('Rich embed with video field.')
|
|
57
|
-
.setVideo('https://example.com/sample.mp4')
|
|
58
|
-
.setURL('https://example.com/sample.mp4')
|
|
59
|
-
.setColor(0x5865f2);
|
|
60
|
-
|
|
61
|
-
// With full options (duration, dimensions for progress bar):
|
|
62
|
-
const embedWithDuration = new EmbedBuilder()
|
|
63
|
-
.setTitle('Video with metadata')
|
|
64
|
-
.setVideo({
|
|
65
|
-
url: 'https://example.com/video.mp4',
|
|
66
|
-
duration: 120,
|
|
67
|
-
width: 1280,
|
|
68
|
-
height: 720,
|
|
69
|
-
})
|
|
70
|
-
.setColor(0x5865f2);
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Audio in Embeds
|
|
74
|
-
|
|
75
|
-
Use setAudio() to add audio to an embed. Pass a URL or EmbedMediaOptions (e.g. duration, content_type).
|
|
76
|
-
|
|
77
|
-
```javascript
|
|
78
|
-
const embed = new EmbedBuilder()
|
|
79
|
-
.setTitle('Audio embed')
|
|
80
|
-
.setDescription('Rich embed with audio field.')
|
|
81
|
-
.setAudio({
|
|
82
|
-
url: 'https://example.com/sample.mp3',
|
|
83
|
-
duration: 180,
|
|
84
|
-
content_type: 'audio/mpeg',
|
|
85
|
-
})
|
|
86
|
-
.setColor(0x5865f2);
|
|
87
|
-
```
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
# Embeds
|
|
2
|
-
|
|
3
|
-
Complete reference for EmbedBuilder: title, description, author, footer, fields, color, media, and more.
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
Use EmbedBuilder to create rich embeds. EmbedBuilder instances are auto-converted—no need to call .toJSON() when passing to reply(), send(), or edit(). An embed must have at least one of: title, description, fields, or image/thumbnail. A description-only embed (no title) is valid.
|
|
8
|
-
|
|
9
|
-
## Basic embed
|
|
10
|
-
|
|
11
|
-
Minimal embed with title, description, color, fields, footer, and timestamp.
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
import { Client, Events, EmbedBuilder } from '@erinjs/core';
|
|
15
|
-
|
|
16
|
-
const client = new Client({ intents: 0 });
|
|
17
|
-
|
|
18
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
19
|
-
if (message.content === '!embed') {
|
|
20
|
-
const embed = new EmbedBuilder()
|
|
21
|
-
.setTitle('Hello!')
|
|
22
|
-
.setDescription('This is a erin.js embed.')
|
|
23
|
-
.setColor(0x5865f2)
|
|
24
|
-
.addFields(
|
|
25
|
-
{ name: 'Field 1', value: 'Value 1', inline: true },
|
|
26
|
-
{ name: 'Field 2', value: 'Value 2', inline: true }
|
|
27
|
-
)
|
|
28
|
-
.setFooter({ text: 'Powered by erin.js' })
|
|
29
|
-
.setTimestamp();
|
|
30
|
-
|
|
31
|
-
await message.reply({ embeds: [embed] });
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
await client.login(process.env.ERIN_BOT_TOKEN);
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
## Title, Description, and URL
|
|
39
|
-
|
|
40
|
-
setTitle() and setDescription() accept strings (max 256 and 4096 chars). setURL() makes the title a clickable link.
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
const embed = new EmbedBuilder()
|
|
44
|
-
.setTitle('Clickable Title')
|
|
45
|
-
.setDescription('Main body text here.')
|
|
46
|
-
.setURL('https://example.com');
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## Color
|
|
50
|
-
|
|
51
|
-
setColor() accepts: number (0x5865f2), hex string ("#5865f2"), or [r, g, b] array.
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
embed.setColor(0x5865f2);
|
|
55
|
-
embed.setColor('#57f287');
|
|
56
|
-
embed.setColor([88, 101, 242]);
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## Author
|
|
60
|
-
|
|
61
|
-
setAuthor() adds a header line with name. Optional: iconURL, url.
|
|
62
|
-
|
|
63
|
-
```javascript
|
|
64
|
-
embed.setAuthor({
|
|
65
|
-
name: 'erin.js',
|
|
66
|
-
iconURL: 'https://example.com/icon.png',
|
|
67
|
-
url: 'https://erinjs.dev',
|
|
68
|
-
});
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Footer
|
|
72
|
-
|
|
73
|
-
setFooter() adds text at the bottom. Optional: iconURL.
|
|
74
|
-
|
|
75
|
-
```javascript
|
|
76
|
-
embed.setFooter({
|
|
77
|
-
text: 'Powered by erin.js',
|
|
78
|
-
iconURL: 'https://example.com/footer-icon.png',
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Timestamp
|
|
83
|
-
|
|
84
|
-
setTimestamp() shows a date. Omit or pass null for current time. Pass Date or number (ms) for a specific time.
|
|
85
|
-
|
|
86
|
-
```javascript
|
|
87
|
-
embed.setTimestamp(); // current time
|
|
88
|
-
embed.setTimestamp(new Date('2026-01-01'));
|
|
89
|
-
embed.setTimestamp(Date.now() - 3600000); // 1 hour ago
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Fields
|
|
93
|
-
|
|
94
|
-
addFields() adds name/value pairs. Max 25 fields. Use inline: true for side-by-side layout. spliceFields() to insert/remove.
|
|
95
|
-
|
|
96
|
-
```javascript
|
|
97
|
-
embed.addFields(
|
|
98
|
-
{ name: 'Field 1', value: 'Value 1', inline: true },
|
|
99
|
-
{ name: 'Field 2', value: 'Value 2', inline: true },
|
|
100
|
-
{ name: 'Long field', value: 'Not inline, full width' }
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
// Insert/replace fields
|
|
104
|
-
embed.spliceFields(1, 1, { name: 'Replaced', value: 'New value' });
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
## Image and Thumbnail
|
|
108
|
-
|
|
109
|
-
setImage() adds a large image. setThumbnail() adds a small image (e.g. top-right). Pass a URL string or EmbedMediaOptions (url, width, height, content_type, etc).
|
|
110
|
-
|
|
111
|
-
```javascript
|
|
112
|
-
embed.setImage('https://example.com/image.png');
|
|
113
|
-
embed.setThumbnail('https://example.com/thumb.png');
|
|
114
|
-
|
|
115
|
-
// With metadata
|
|
116
|
-
embed.setImage({
|
|
117
|
-
url: 'https://example.com/image.png',
|
|
118
|
-
width: 400,
|
|
119
|
-
height: 200,
|
|
120
|
-
content_type: 'image/png',
|
|
121
|
-
});
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## Video and Audio
|
|
125
|
-
|
|
126
|
-
setVideo() and setAudio() add video/audio to embeds (erin.js supports these). Pass URL or EmbedMediaOptions. Include a title when using video. See Embed Media guide for full examples.
|
|
127
|
-
|
|
128
|
-
```javascript
|
|
129
|
-
embed.setVideo('https://example.com/video.mp4');
|
|
130
|
-
embed.setAudio({
|
|
131
|
-
url: 'https://example.com/audio.mp3',
|
|
132
|
-
duration: 120,
|
|
133
|
-
content_type: 'audio/mpeg',
|
|
134
|
-
});
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
## Multiple embeds
|
|
138
|
-
|
|
139
|
-
Messages can include up to 10 embeds. Pass an array to embeds.
|
|
140
|
-
|
|
141
|
-
```javascript
|
|
142
|
-
await message.reply({
|
|
143
|
-
embeds: [
|
|
144
|
-
new EmbedBuilder().setTitle('First').setColor(0x5865f2),
|
|
145
|
-
new EmbedBuilder().setTitle('Second').setColor(0x57f287),
|
|
146
|
-
],
|
|
147
|
-
});
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
## Load from existing embed
|
|
151
|
-
|
|
152
|
-
EmbedBuilder.from() creates a builder from an API embed (e.g. from a received message). Edit and toJSON() to send.
|
|
153
|
-
|
|
154
|
-
```javascript
|
|
155
|
-
const existing = message.embeds[0];
|
|
156
|
-
if (existing) {
|
|
157
|
-
const edited = EmbedBuilder.from(existing)
|
|
158
|
-
.setTitle('Updated title')
|
|
159
|
-
.setColor(0x57f287);
|
|
160
|
-
await message.edit({ embeds: [edited] });
|
|
161
|
-
}
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
## Limits
|
|
165
|
-
|
|
166
|
-
Title ≤256, description ≤4096, field name ≤256, field value ≤1024, footer ≤2048, author name ≤256. Max 25 fields. Combined title+description+fields+footer ≤6000 chars.
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# Emojis & Stickers
|
|
2
|
-
|
|
3
|
-
Fetch, create, edit, and delete guild emojis and stickers. Use guild.fetchEmojis(), guild.createEmojisBulk(), and guild.createStickersBulk().
|
|
4
|
-
|
|
5
|
-
## Fetch Emojis
|
|
6
|
-
|
|
7
|
-
Use guild.fetchEmojis() to get all emojis in a guild. Cached in guild.emojis. Use guild.fetchEmoji(emojiId) for a single emoji. Use emoji.delete() to remove an emoji (e.g. autocreated ones).
|
|
8
|
-
|
|
9
|
-
```javascript
|
|
10
|
-
import { Client, Events } from '@erinjs/core';
|
|
11
|
-
|
|
12
|
-
const client = new Client({ intents: 0 });
|
|
13
|
-
|
|
14
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
15
|
-
if (!message.guildId || message.content !== '!emojis') return;
|
|
16
|
-
const guild = client.guilds.get(message.guildId) ?? await client.guilds.resolve(message.guildId);
|
|
17
|
-
if (!guild) return;
|
|
18
|
-
|
|
19
|
-
const emojis = await guild.fetchEmojis();
|
|
20
|
-
const list = emojis.map((e) => `:${e.name}: (${e.id})`).join(', ');
|
|
21
|
-
await message.reply(emojis.length ? list : 'No emojis.');
|
|
22
|
-
|
|
23
|
-
// Or get from cache after fetching: guild.emojis.get(emojiId)
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
// Fetch single emoji by ID
|
|
27
|
-
const emoji = await guild.fetchEmoji(emojiId);
|
|
28
|
-
await emoji.delete();
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Create Emojis & Stickers
|
|
32
|
-
|
|
33
|
-
Use guild.createEmojisBulk() and guild.createStickersBulk() with base64 image data. Use emoji.edit() / emoji.delete() and sticker.edit() / sticker.delete() for individual updates.
|
|
34
|
-
|
|
35
|
-
```javascript
|
|
36
|
-
import { Client, Events } from '@erinjs/core';
|
|
37
|
-
|
|
38
|
-
const client = new Client({ intents: 0 });
|
|
39
|
-
|
|
40
|
-
// Create emoji from URL (fetch and convert to base64)
|
|
41
|
-
async function createEmojiFromUrl(guild, name, imageUrl) {
|
|
42
|
-
const res = await fetch(imageUrl);
|
|
43
|
-
const buf = await res.arrayBuffer();
|
|
44
|
-
const base64 = Buffer.from(buf).toString('base64');
|
|
45
|
-
const [emoji] = await guild.createEmojisBulk([{ name, image: base64 }]);
|
|
46
|
-
return emoji;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
client.on(Events.MessageCreate, async (message) => {
|
|
50
|
-
if (!message.guildId || !message.content.startsWith('!addemoji ')) return;
|
|
51
|
-
const guild = client.guilds.get(message.guildId) ?? await client.guilds.resolve(message.guildId);
|
|
52
|
-
if (!guild) return;
|
|
53
|
-
|
|
54
|
-
const [_, name, url] = message.content.split(/\s+/);
|
|
55
|
-
if (!name || !url) return;
|
|
56
|
-
const emoji = await createEmojiFromUrl(guild, name, url);
|
|
57
|
-
await message.reply(`Created emoji :${emoji.name}:`);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// Bulk create stickers
|
|
61
|
-
const stickers = await guild.createStickersBulk([
|
|
62
|
-
{ name: 'cool', image: base64Image, description: 'A cool sticker' },
|
|
63
|
-
]);
|
|
64
|
-
|
|
65
|
-
// Edit and delete
|
|
66
|
-
await emoji.edit({ name: 'newname' });
|
|
67
|
-
await emoji.delete();
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Quick Reference
|
|
71
|
-
|
|
72
|
-
| API | Method | Purpose |
|
|
73
|
-
| --- | --- | --- |
|
|
74
|
-
| `Emojis` | `guild.fetchEmojis()` | Fetch all guild emojis (cached in guild.emojis) |
|
|
75
|
-
| `Emojis` | `guild.fetchEmoji(emojiId)` | Fetch single emoji by ID |
|
|
76
|
-
| `Emojis` | `guild.createEmojisBulk()` | Bulk create emojis (base64 image) |
|
|
77
|
-
| `Stickers` | `guild.createStickersBulk()` | Bulk create stickers |
|