elynn-baileys 1.0.1
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/LICENSE +22 -0
- package/README.md +2372 -0
- package/WAProto/index.d.ts +15871 -0
- package/WAProto/index.js +115447 -0
- package/elynn/config.js +12 -0
- package/elynn/plugins/README.md +24 -0
- package/elynn/plugins/ai/deepseekr1.js +27 -0
- package/elynn/plugins/ai/gita.js +16 -0
- package/elynn/plugins/ai/glm47flash.js +27 -0
- package/elynn/plugins/ai/gptoss120b.js +27 -0
- package/elynn/plugins/ai/qwq32b.js +27 -0
- package/elynn/plugins/berita/antara.js +18 -0
- package/elynn/plugins/berita/cnbcindonesia.js +18 -0
- package/elynn/plugins/berita/cnn.js +18 -0
- package/elynn/plugins/berita/kompas.js +18 -0
- package/elynn/plugins/berita/liputan6.js +18 -0
- package/elynn/plugins/berita/merdeka.js +18 -0
- package/elynn/plugins/berita/sindonews.js +18 -0
- package/elynn/plugins/berita/tribunnews.js +18 -0
- package/elynn/plugins/downloader/douyin.js +19 -0
- package/elynn/plugins/downloader/facebook.js +19 -0
- package/elynn/plugins/downloader/github.js +25 -0
- package/elynn/plugins/downloader/lahelu.js +19 -0
- package/elynn/plugins/downloader/snackvideo.js +19 -0
- package/elynn/plugins/downloader/soundcloud.js +19 -0
- package/elynn/plugins/downloader/tiktok.js +19 -0
- package/elynn/plugins/downloader/tiktokhd.js +19 -0
- package/elynn/plugins/downloader/twitter.js +19 -0
- package/elynn/plugins/downloader/ummy.js +26 -0
- package/elynn/plugins/index.cjs +26 -0
- package/elynn/plugins/index.js +232 -0
- package/elynn/plugins/info/bmkg.js +25 -0
- package/elynn/plugins/info/cuaca.js +23 -0
- package/elynn/plugins/info/jadwaltv.js +21 -0
- package/elynn/plugins/maker/brat.js +45 -0
- package/elynn/plugins/maker/bratvid.js +52 -0
- package/elynn/plugins/search/8font.js +18 -0
- package/elynn/plugins/search/applemusic.js +18 -0
- package/elynn/plugins/search/bimg.js +19 -0
- package/elynn/plugins/search/brave.js +24 -0
- package/elynn/plugins/search/duckduckgo.js +18 -0
- package/elynn/plugins/search/lahelu.js +18 -0
- package/elynn/plugins/search/mangatoon.js +18 -0
- package/elynn/plugins/search/mcpedl.js +18 -0
- package/elynn/plugins/search/myinstants.js +18 -0
- package/elynn/plugins/search/otakotaku.js +18 -0
- package/elynn/plugins/search/pinterest.js +19 -0
- package/elynn/plugins/search/resep.js +18 -0
- package/elynn/plugins/search/seegore.js +19 -0
- package/elynn/plugins/search/soundcloud.js +18 -0
- package/elynn/plugins/search/youtube.js +18 -0
- package/elynn/plugins/stalk/github.js +28 -0
- package/elynn/plugins/stalk/pinterest.js +27 -0
- package/elynn/plugins/stalk/threads.js +24 -0
- package/elynn/plugins/stalk/tiktok.js +27 -0
- package/elynn/plugins/stalk/twitter.js +27 -0
- package/elynn/plugins/stalk/youtube.js +27 -0
- package/engine-requirements.js +45 -0
- package/lib/Defaults/index.d.ts +145 -0
- package/lib/Defaults/index.d.ts.map +1 -0
- package/lib/Defaults/index.js +152 -0
- package/lib/Defaults/index.js.map +1 -0
- package/lib/Discord/Client.cjs +274 -0
- package/lib/Discord/Client.d.ts +98 -0
- package/lib/Discord/Client.js +274 -0
- package/lib/Discord/Constants.cjs +1842 -0
- package/lib/Discord/Constants.d.ts +1514 -0
- package/lib/Discord/Constants.js +1842 -0
- package/lib/Discord/connect-dc.js +5 -0
- package/lib/Discord/esm-bridge.mjs +128 -0
- package/lib/Discord/gateway/Dispatcher.cjs +86 -0
- package/lib/Discord/gateway/Dispatcher.d.ts +17 -0
- package/lib/Discord/gateway/Dispatcher.js +86 -0
- package/lib/Discord/gateway/Shard.cjs +723 -0
- package/lib/Discord/gateway/Shard.d.ts +87 -0
- package/lib/Discord/gateway/Shard.js +723 -0
- package/lib/Discord/gateway/ShardManager.cjs +350 -0
- package/lib/Discord/gateway/ShardManager.d.ts +31 -0
- package/lib/Discord/gateway/ShardManager.js +350 -0
- package/lib/Discord/gateway/compression/base.cjs +14 -0
- package/lib/Discord/gateway/compression/base.d.ts +6 -0
- package/lib/Discord/gateway/compression/base.js +14 -0
- package/lib/Discord/gateway/compression/config.cjs +47 -0
- package/lib/Discord/gateway/compression/config.d.ts +17 -0
- package/lib/Discord/gateway/compression/config.js +47 -0
- package/lib/Discord/gateway/compression/pako.cjs +45 -0
- package/lib/Discord/gateway/compression/pako.d.ts +16 -0
- package/lib/Discord/gateway/compression/pako.js +45 -0
- package/lib/Discord/gateway/compression/zlib-native.cjs +50 -0
- package/lib/Discord/gateway/compression/zlib-native.d.ts +10 -0
- package/lib/Discord/gateway/compression/zlib-native.js +50 -0
- package/lib/Discord/gateway/compression/zlib-sync.cjs +32 -0
- package/lib/Discord/gateway/compression/zlib-sync.d.ts +8 -0
- package/lib/Discord/gateway/compression/zlib-sync.js +32 -0
- package/lib/Discord/gateway/compression/zstd-napi.cjs +74 -0
- package/lib/Discord/gateway/compression/zstd-napi.d.ts +9 -0
- package/lib/Discord/gateway/compression/zstd-napi.js +74 -0
- package/lib/Discord/gateway/compression/zstd-native.cjs +48 -0
- package/lib/Discord/gateway/compression/zstd-native.d.ts +9 -0
- package/lib/Discord/gateway/compression/zstd-native.js +48 -0
- package/lib/Discord/gateway/events.cjs +956 -0
- package/lib/Discord/gateway/events.d.ts +75 -0
- package/lib/Discord/gateway/events.js +956 -0
- package/lib/Discord/index.cjs +228 -0
- package/lib/Discord/index.d.ts +98 -0
- package/lib/Discord/index.js +228 -0
- package/lib/Discord/rest/Bucket.cjs +77 -0
- package/lib/Discord/rest/Bucket.d.ts +32 -0
- package/lib/Discord/rest/Bucket.js +77 -0
- package/lib/Discord/rest/DiscordHTTPError.cjs +66 -0
- package/lib/Discord/rest/DiscordHTTPError.d.ts +15 -0
- package/lib/Discord/rest/DiscordHTTPError.js +66 -0
- package/lib/Discord/rest/DiscordRESTError.cjs +88 -0
- package/lib/Discord/rest/DiscordRESTError.d.ts +18 -0
- package/lib/Discord/rest/DiscordRESTError.js +88 -0
- package/lib/Discord/rest/OAuthHelper.cjs +220 -0
- package/lib/Discord/rest/OAuthHelper.d.ts +61 -0
- package/lib/Discord/rest/OAuthHelper.js +220 -0
- package/lib/Discord/rest/RESTManager.cjs +119 -0
- package/lib/Discord/rest/RESTManager.d.ts +42 -0
- package/lib/Discord/rest/RESTManager.js +119 -0
- package/lib/Discord/rest/RequestHandler.cjs +323 -0
- package/lib/Discord/rest/RequestHandler.d.ts +27 -0
- package/lib/Discord/rest/RequestHandler.js +323 -0
- package/lib/Discord/rest/SequentialBucket.cjs +74 -0
- package/lib/Discord/rest/SequentialBucket.d.ts +24 -0
- package/lib/Discord/rest/SequentialBucket.js +74 -0
- package/lib/Discord/routes/Applications.cjs +618 -0
- package/lib/Discord/routes/Applications.d.ts +230 -0
- package/lib/Discord/routes/Applications.js +618 -0
- package/lib/Discord/routes/Channels.cjs +1191 -0
- package/lib/Discord/routes/Channels.d.ts +428 -0
- package/lib/Discord/routes/Channels.js +1192 -0
- package/lib/Discord/routes/Guilds.cjs +1785 -0
- package/lib/Discord/routes/Guilds.d.ts +644 -0
- package/lib/Discord/routes/Guilds.js +1785 -0
- package/lib/Discord/routes/Interactions.cjs +205 -0
- package/lib/Discord/routes/Interactions.d.ts +74 -0
- package/lib/Discord/routes/Interactions.js +205 -0
- package/lib/Discord/routes/Lobbies.cjs +190 -0
- package/lib/Discord/routes/Lobbies.d.ts +70 -0
- package/lib/Discord/routes/Lobbies.js +190 -0
- package/lib/Discord/routes/Miscellaneous.cjs +113 -0
- package/lib/Discord/routes/Miscellaneous.d.ts +36 -0
- package/lib/Discord/routes/Miscellaneous.js +113 -0
- package/lib/Discord/routes/OAuth.cjs +343 -0
- package/lib/Discord/routes/OAuth.d.ts +107 -0
- package/lib/Discord/routes/OAuth.js +343 -0
- package/lib/Discord/routes/Users.cjs +100 -0
- package/lib/Discord/routes/Users.d.ts +32 -0
- package/lib/Discord/routes/Users.js +100 -0
- package/lib/Discord/routes/Webhooks.cjs +301 -0
- package/lib/Discord/routes/Webhooks.d.ts +126 -0
- package/lib/Discord/routes/Webhooks.js +301 -0
- package/lib/Discord/structures/AnnouncementChannel.cjs +46 -0
- package/lib/Discord/structures/AnnouncementChannel.d.ts +34 -0
- package/lib/Discord/structures/AnnouncementChannel.js +46 -0
- package/lib/Discord/structures/AnnouncementThreadChannel.cjs +28 -0
- package/lib/Discord/structures/AnnouncementThreadChannel.d.ts +17 -0
- package/lib/Discord/structures/AnnouncementThreadChannel.js +28 -0
- package/lib/Discord/structures/Application.cjs +477 -0
- package/lib/Discord/structures/Application.d.ts +166 -0
- package/lib/Discord/structures/Application.js +477 -0
- package/lib/Discord/structures/ApplicationCommand.cjs +146 -0
- package/lib/Discord/structures/ApplicationCommand.d.ts +75 -0
- package/lib/Discord/structures/ApplicationCommand.js +146 -0
- package/lib/Discord/structures/Attachment.cjs +78 -0
- package/lib/Discord/structures/Attachment.d.ts +43 -0
- package/lib/Discord/structures/Attachment.js +78 -0
- package/lib/Discord/structures/AuditLogEntry.cjs +54 -0
- package/lib/Discord/structures/AuditLogEntry.d.ts +25 -0
- package/lib/Discord/structures/AuditLogEntry.js +54 -0
- package/lib/Discord/structures/AutoModerationRule.cjs +140 -0
- package/lib/Discord/structures/AutoModerationRule.d.ts +48 -0
- package/lib/Discord/structures/AutoModerationRule.js +140 -0
- package/lib/Discord/structures/AutocompleteInteraction.cjs +120 -0
- package/lib/Discord/structures/AutocompleteInteraction.d.ts +61 -0
- package/lib/Discord/structures/AutocompleteInteraction.js +120 -0
- package/lib/Discord/structures/Base.cjs +58 -0
- package/lib/Discord/structures/Base.d.ts +19 -0
- package/lib/Discord/structures/Base.js +58 -0
- package/lib/Discord/structures/BaseEntitlement.cjs +49 -0
- package/lib/Discord/structures/BaseEntitlement.d.ts +20 -0
- package/lib/Discord/structures/BaseEntitlement.js +49 -0
- package/lib/Discord/structures/CategoryChannel.cjs +106 -0
- package/lib/Discord/structures/CategoryChannel.d.ts +40 -0
- package/lib/Discord/structures/CategoryChannel.js +106 -0
- package/lib/Discord/structures/Channel.cjs +92 -0
- package/lib/Discord/structures/Channel.d.ts +19 -0
- package/lib/Discord/structures/Channel.js +92 -0
- package/lib/Discord/structures/ClientApplication.cjs +273 -0
- package/lib/Discord/structures/ClientApplication.d.ts +189 -0
- package/lib/Discord/structures/ClientApplication.js +273 -0
- package/lib/Discord/structures/CommandInteraction.cjs +324 -0
- package/lib/Discord/structures/CommandInteraction.d.ts +166 -0
- package/lib/Discord/structures/CommandInteraction.js +324 -0
- package/lib/Discord/structures/ComponentInteraction.cjs +338 -0
- package/lib/Discord/structures/ComponentInteraction.d.ts +180 -0
- package/lib/Discord/structures/ComponentInteraction.js +338 -0
- package/lib/Discord/structures/Entitlement.cjs +27 -0
- package/lib/Discord/structures/Entitlement.d.ts +11 -0
- package/lib/Discord/structures/Entitlement.js +27 -0
- package/lib/Discord/structures/ExtendedUser.cjs +58 -0
- package/lib/Discord/structures/ExtendedUser.d.ts +25 -0
- package/lib/Discord/structures/ExtendedUser.js +58 -0
- package/lib/Discord/structures/ForumChannel.cjs +20 -0
- package/lib/Discord/structures/ForumChannel.d.ts +11 -0
- package/lib/Discord/structures/ForumChannel.js +20 -0
- package/lib/Discord/structures/GroupChannel.cjs +172 -0
- package/lib/Discord/structures/GroupChannel.d.ts +60 -0
- package/lib/Discord/structures/GroupChannel.js +172 -0
- package/lib/Discord/structures/Guild.cjs +1415 -0
- package/lib/Discord/structures/Guild.d.ts +687 -0
- package/lib/Discord/structures/Guild.js +1415 -0
- package/lib/Discord/structures/GuildChannel.cjs +90 -0
- package/lib/Discord/structures/GuildChannel.d.ts +36 -0
- package/lib/Discord/structures/GuildChannel.js +90 -0
- package/lib/Discord/structures/GuildPreview.cjs +153 -0
- package/lib/Discord/structures/GuildPreview.d.ts +49 -0
- package/lib/Discord/structures/GuildPreview.js +153 -0
- package/lib/Discord/structures/GuildScheduledEvent.cjs +188 -0
- package/lib/Discord/structures/GuildScheduledEvent.d.ts +59 -0
- package/lib/Discord/structures/GuildScheduledEvent.js +188 -0
- package/lib/Discord/structures/GuildTemplate.cjs +118 -0
- package/lib/Discord/structures/GuildTemplate.d.ts +48 -0
- package/lib/Discord/structures/GuildTemplate.js +118 -0
- package/lib/Discord/structures/Integration.cjs +157 -0
- package/lib/Discord/structures/Integration.d.ts +53 -0
- package/lib/Discord/structures/Integration.js +157 -0
- package/lib/Discord/structures/Interaction.cjs +91 -0
- package/lib/Discord/structures/Interaction.d.ts +39 -0
- package/lib/Discord/structures/Interaction.js +91 -0
- package/lib/Discord/structures/InteractionResolvedChannel.cjs +46 -0
- package/lib/Discord/structures/InteractionResolvedChannel.d.ts +27 -0
- package/lib/Discord/structures/InteractionResolvedChannel.js +46 -0
- package/lib/Discord/structures/Invite.cjs +240 -0
- package/lib/Discord/structures/Invite.d.ts +132 -0
- package/lib/Discord/structures/Invite.js +240 -0
- package/lib/Discord/structures/InviteGuild.cjs +130 -0
- package/lib/Discord/structures/InviteGuild.d.ts +54 -0
- package/lib/Discord/structures/InviteGuild.js +130 -0
- package/lib/Discord/structures/InviteRole.cjs +110 -0
- package/lib/Discord/structures/InviteRole.d.ts +53 -0
- package/lib/Discord/structures/InviteRole.js +110 -0
- package/lib/Discord/structures/Lobby.cjs +88 -0
- package/lib/Discord/structures/Lobby.d.ts +54 -0
- package/lib/Discord/structures/Lobby.js +88 -0
- package/lib/Discord/structures/LobbyMember.cjs +33 -0
- package/lib/Discord/structures/LobbyMember.d.ts +15 -0
- package/lib/Discord/structures/LobbyMember.js +33 -0
- package/lib/Discord/structures/MediaChannel.cjs +20 -0
- package/lib/Discord/structures/MediaChannel.d.ts +11 -0
- package/lib/Discord/structures/MediaChannel.js +20 -0
- package/lib/Discord/structures/Member.cjs +325 -0
- package/lib/Discord/structures/Member.d.ts +140 -0
- package/lib/Discord/structures/Member.js +325 -0
- package/lib/Discord/structures/Message.cjs +627 -0
- package/lib/Discord/structures/Message.d.ts +223 -0
- package/lib/Discord/structures/Message.js +627 -0
- package/lib/Discord/structures/ModalSubmitInteraction.cjs +295 -0
- package/lib/Discord/structures/ModalSubmitInteraction.d.ts +138 -0
- package/lib/Discord/structures/ModalSubmitInteraction.js +295 -0
- package/lib/Discord/structures/OAuthApplication.cjs +244 -0
- package/lib/Discord/structures/OAuthApplication.d.ts +77 -0
- package/lib/Discord/structures/OAuthApplication.js +244 -0
- package/lib/Discord/structures/OAuthGuild.cjs +107 -0
- package/lib/Discord/structures/OAuthGuild.d.ts +43 -0
- package/lib/Discord/structures/OAuthGuild.js +107 -0
- package/lib/Discord/structures/PartialApplication.cjs +101 -0
- package/lib/Discord/structures/PartialApplication.d.ts +29 -0
- package/lib/Discord/structures/PartialApplication.js +101 -0
- package/lib/Discord/structures/Permission.cjs +66 -0
- package/lib/Discord/structures/Permission.d.ts +21 -0
- package/lib/Discord/structures/Permission.js +66 -0
- package/lib/Discord/structures/PermissionOverwrite.cjs +50 -0
- package/lib/Discord/structures/PermissionOverwrite.d.ts +25 -0
- package/lib/Discord/structures/PermissionOverwrite.js +50 -0
- package/lib/Discord/structures/PingInteraction.cjs +27 -0
- package/lib/Discord/structures/PingInteraction.d.ts +15 -0
- package/lib/Discord/structures/PingInteraction.js +27 -0
- package/lib/Discord/structures/Poll.cjs +77 -0
- package/lib/Discord/structures/Poll.d.ts +27 -0
- package/lib/Discord/structures/Poll.js +77 -0
- package/lib/Discord/structures/PrimaryGuild.cjs +92 -0
- package/lib/Discord/structures/PrimaryGuild.d.ts +23 -0
- package/lib/Discord/structures/PrimaryGuild.js +92 -0
- package/lib/Discord/structures/PrivateChannel.cjs +139 -0
- package/lib/Discord/structures/PrivateChannel.d.ts +102 -0
- package/lib/Discord/structures/PrivateChannel.js +139 -0
- package/lib/Discord/structures/PrivateThreadChannel.cjs +28 -0
- package/lib/Discord/structures/PrivateThreadChannel.d.ts +17 -0
- package/lib/Discord/structures/PrivateThreadChannel.js +28 -0
- package/lib/Discord/structures/PublicThreadChannel.cjs +38 -0
- package/lib/Discord/structures/PublicThreadChannel.d.ts +20 -0
- package/lib/Discord/structures/PublicThreadChannel.js +38 -0
- package/lib/Discord/structures/Role.cjs +156 -0
- package/lib/Discord/structures/Role.d.ts +56 -0
- package/lib/Discord/structures/Role.js +156 -0
- package/lib/Discord/structures/SKU.cjs +70 -0
- package/lib/Discord/structures/SKU.d.ts +33 -0
- package/lib/Discord/structures/SKU.js +70 -0
- package/lib/Discord/structures/Soundboard.cjs +74 -0
- package/lib/Discord/structures/Soundboard.d.ts +42 -0
- package/lib/Discord/structures/Soundboard.js +74 -0
- package/lib/Discord/structures/StageChannel.cjs +45 -0
- package/lib/Discord/structures/StageChannel.d.ts +31 -0
- package/lib/Discord/structures/StageChannel.js +45 -0
- package/lib/Discord/structures/StageInstance.cjs +95 -0
- package/lib/Discord/structures/StageInstance.d.ts +35 -0
- package/lib/Discord/structures/StageInstance.js +95 -0
- package/lib/Discord/structures/Subscription.cjs +39 -0
- package/lib/Discord/structures/Subscription.d.ts +25 -0
- package/lib/Discord/structures/Subscription.js +39 -0
- package/lib/Discord/structures/Team.cjs +86 -0
- package/lib/Discord/structures/Team.d.ts +28 -0
- package/lib/Discord/structures/Team.js +86 -0
- package/lib/Discord/structures/TestEntitlement.cjs +22 -0
- package/lib/Discord/structures/TestEntitlement.d.ts +10 -0
- package/lib/Discord/structures/TestEntitlement.js +22 -0
- package/lib/Discord/structures/TextChannel.cjs +48 -0
- package/lib/Discord/structures/TextChannel.d.ts +34 -0
- package/lib/Discord/structures/TextChannel.js +48 -0
- package/lib/Discord/structures/TextableChannel.cjs +281 -0
- package/lib/Discord/structures/TextableChannel.d.ts +167 -0
- package/lib/Discord/structures/TextableChannel.js +281 -0
- package/lib/Discord/structures/TextableVoiceChannel.cjs +79 -0
- package/lib/Discord/structures/TextableVoiceChannel.d.ts +34 -0
- package/lib/Discord/structures/TextableVoiceChannel.js +79 -0
- package/lib/Discord/structures/ThreadChannel.cjs +300 -0
- package/lib/Discord/structures/ThreadChannel.d.ts +170 -0
- package/lib/Discord/structures/ThreadChannel.js +300 -0
- package/lib/Discord/structures/ThreadOnlyChannel.cjs +231 -0
- package/lib/Discord/structures/ThreadOnlyChannel.d.ts +95 -0
- package/lib/Discord/structures/ThreadOnlyChannel.js +231 -0
- package/lib/Discord/structures/ThreadableChannel.cjs +59 -0
- package/lib/Discord/structures/ThreadableChannel.d.ts +35 -0
- package/lib/Discord/structures/ThreadableChannel.js +59 -0
- package/lib/Discord/structures/UnavailableGuild.cjs +22 -0
- package/lib/Discord/structures/UnavailableGuild.d.ts +10 -0
- package/lib/Discord/structures/UnavailableGuild.js +22 -0
- package/lib/Discord/structures/User.cjs +240 -0
- package/lib/Discord/structures/User.d.ts +90 -0
- package/lib/Discord/structures/User.js +240 -0
- package/lib/Discord/structures/VoiceChannel.cjs +36 -0
- package/lib/Discord/structures/VoiceChannel.d.ts +19 -0
- package/lib/Discord/structures/VoiceChannel.js +36 -0
- package/lib/Discord/structures/VoiceState.cjs +141 -0
- package/lib/Discord/structures/VoiceState.d.ts +49 -0
- package/lib/Discord/structures/VoiceState.js +141 -0
- package/lib/Discord/structures/Webhook.cjs +240 -0
- package/lib/Discord/structures/Webhook.d.ts +126 -0
- package/lib/Discord/structures/Webhook.js +240 -0
- package/lib/Discord/types/applications.d.ts +695 -0
- package/lib/Discord/types/audit-log.d.ts +116 -0
- package/lib/Discord/types/auto-moderation.d.ts +99 -0
- package/lib/Discord/types/channels.d.ts +1570 -0
- package/lib/Discord/types/client.d.ts +250 -0
- package/lib/Discord/types/events.d.ts +224 -0
- package/lib/Discord/types/gateway-raw.d.ts +585 -0
- package/lib/Discord/types/gateway.d.ts +401 -0
- package/lib/Discord/types/guild-template.d.ts +25 -0
- package/lib/Discord/types/guilds.d.ts +987 -0
- package/lib/Discord/types/index.d.ts +24 -0
- package/lib/Discord/types/interactions.d.ts +524 -0
- package/lib/Discord/types/invites.d.ts +117 -0
- package/lib/Discord/types/json.d.ts +833 -0
- package/lib/Discord/types/lobbies.d.ts +31 -0
- package/lib/Discord/types/misc.d.ts +25 -0
- package/lib/Discord/types/namespaced.d.ts +22 -0
- package/lib/Discord/types/oauth.d.ts +206 -0
- package/lib/Discord/types/request-handler.d.ts +54 -0
- package/lib/Discord/types/scheduled-events.d.ts +87 -0
- package/lib/Discord/types/shared.d.ts +24 -0
- package/lib/Discord/types/users.d.ts +104 -0
- package/lib/Discord/types/voice.d.ts +45 -0
- package/lib/Discord/types/webhooks.d.ts +75 -0
- package/lib/Discord/util/Collection.cjs +77 -0
- package/lib/Discord/util/Collection.d.ts +47 -0
- package/lib/Discord/util/Collection.js +77 -0
- package/lib/Discord/util/Errors.cjs +84 -0
- package/lib/Discord/util/Errors.d.ts +43 -0
- package/lib/Discord/util/Errors.js +84 -0
- package/lib/Discord/util/QueryBuilder.cjs +20 -0
- package/lib/Discord/util/QueryBuilder.d.ts +4 -0
- package/lib/Discord/util/QueryBuilder.js +20 -0
- package/lib/Discord/util/Routes.cjs +293 -0
- package/lib/Discord/util/Routes.d.ts +145 -0
- package/lib/Discord/util/Routes.js +293 -0
- package/lib/Discord/util/SimpleCollection.cjs +82 -0
- package/lib/Discord/util/SimpleCollection.d.ts +12 -0
- package/lib/Discord/util/SimpleCollection.js +82 -0
- package/lib/Discord/util/Time.cjs +93 -0
- package/lib/Discord/util/Time.d.ts +39 -0
- package/lib/Discord/util/Time.js +93 -0
- package/lib/Discord/util/TypedCollection.cjs +81 -0
- package/lib/Discord/util/TypedCollection.d.ts +24 -0
- package/lib/Discord/util/TypedCollection.js +81 -0
- package/lib/Discord/util/TypedEmitter.cjs +20 -0
- package/lib/Discord/util/TypedEmitter.d.ts +18 -0
- package/lib/Discord/util/TypedEmitter.js +20 -0
- package/lib/Discord/util/Util.cjs +906 -0
- package/lib/Discord/util/Util.d.ts +66 -0
- package/lib/Discord/util/Util.js +906 -0
- package/lib/Discord/util/interactions/InteractionOptionsWrapper.cjs +211 -0
- package/lib/Discord/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
- package/lib/Discord/util/interactions/InteractionOptionsWrapper.js +211 -0
- package/lib/Discord/util/interactions/MessageInteractionResponse.cjs +29 -0
- package/lib/Discord/util/interactions/MessageInteractionResponse.d.ts +27 -0
- package/lib/Discord/util/interactions/MessageInteractionResponse.js +29 -0
- package/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.cjs +101 -0
- package/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +157 -0
- package/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.js +101 -0
- package/lib/Discord/util/interactions/SelectMenuValuesWrapper.cjs +81 -0
- package/lib/Discord/util/interactions/SelectMenuValuesWrapper.d.ts +59 -0
- package/lib/Discord/util/interactions/SelectMenuValuesWrapper.js +81 -0
- package/lib/Discord/util/interactions/shared.cjs +20 -0
- package/lib/Discord/util/interactions/shared.d.ts +7 -0
- package/lib/Discord/util/interactions/shared.js +20 -0
- package/lib/Discord/util/warning.cjs +34 -0
- package/lib/Discord/util/warning.d.ts +6 -0
- package/lib/Discord/util/warning.js +34 -0
- package/lib/Signal/Group/ciphertext-message.d.ts +10 -0
- package/lib/Signal/Group/ciphertext-message.d.ts.map +1 -0
- package/lib/Signal/Group/ciphertext-message.js +12 -0
- package/lib/Signal/Group/ciphertext-message.js.map +1 -0
- package/lib/Signal/Group/group-session-builder.d.ts +8 -0
- package/lib/Signal/Group/group-session-builder.d.ts.map +1 -0
- package/lib/Signal/Group/group-session-builder.js +30 -0
- package/lib/Signal/Group/group-session-builder.js.map +1 -0
- package/lib/Signal/Group/group_cipher.d.ts +11 -0
- package/lib/Signal/Group/group_cipher.d.ts.map +1 -0
- package/lib/Signal/Group/group_cipher.js +82 -0
- package/lib/Signal/Group/group_cipher.js.map +1 -0
- package/lib/Signal/Group/index.d.ts +12 -0
- package/lib/Signal/Group/index.d.ts.map +1 -0
- package/lib/Signal/Group/index.js +12 -0
- package/lib/Signal/Group/index.js.map +1 -0
- package/lib/Signal/Group/keyhelper.d.ts +7 -0
- package/lib/Signal/Group/keyhelper.d.ts.map +1 -0
- package/lib/Signal/Group/keyhelper.js +18 -0
- package/lib/Signal/Group/keyhelper.js.map +1 -0
- package/lib/Signal/Group/sender-chain-key.d.ts +14 -0
- package/lib/Signal/Group/sender-chain-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-chain-key.js +26 -0
- package/lib/Signal/Group/sender-chain-key.js.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts +17 -0
- package/lib/Signal/Group/sender-key-distribution-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-distribution-message.js +63 -0
- package/lib/Signal/Group/sender-key-distribution-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-message.d.ts +19 -0
- package/lib/Signal/Group/sender-key-message.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-message.js +66 -0
- package/lib/Signal/Group/sender-key-message.js.map +1 -0
- package/lib/Signal/Group/sender-key-name.d.ts +12 -0
- package/lib/Signal/Group/sender-key-name.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-name.js +48 -0
- package/lib/Signal/Group/sender-key-name.js.map +1 -0
- package/lib/Signal/Group/sender-key-record.d.ts +13 -0
- package/lib/Signal/Group/sender-key-record.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-record.js +41 -0
- package/lib/Signal/Group/sender-key-record.js.map +1 -0
- package/lib/Signal/Group/sender-key-state.d.ts +17 -0
- package/lib/Signal/Group/sender-key-state.d.ts.map +1 -0
- package/lib/Signal/Group/sender-key-state.js +84 -0
- package/lib/Signal/Group/sender-key-state.js.map +1 -0
- package/lib/Signal/Group/sender-message-key.d.ts +12 -0
- package/lib/Signal/Group/sender-message-key.d.ts.map +1 -0
- package/lib/Signal/Group/sender-message-key.js +26 -0
- package/lib/Signal/Group/sender-message-key.js.map +1 -0
- package/lib/Signal/libsignal.d.ts +55 -0
- package/lib/Signal/libsignal.d.ts.map +1 -0
- package/lib/Signal/libsignal.js +431 -0
- package/lib/Signal/libsignal.js.map +1 -0
- package/lib/Signal/lid-mapping.d.ts +21 -0
- package/lib/Signal/lid-mapping.d.ts.map +1 -0
- package/lib/Signal/lid-mapping.js +277 -0
- package/lib/Signal/lid-mapping.js.map +1 -0
- package/lib/Socket/Client/index.d.ts +3 -0
- package/lib/Socket/Client/index.d.ts.map +1 -0
- package/lib/Socket/Client/index.js +3 -0
- package/lib/Socket/Client/index.js.map +1 -0
- package/lib/Socket/Client/types.d.ts +6 -0
- package/lib/Socket/Client/types.d.ts.map +1 -0
- package/lib/Socket/Client/types.js +11 -0
- package/lib/Socket/Client/types.js.map +1 -0
- package/lib/Socket/Client/websocket.d.ts +13 -0
- package/lib/Socket/Client/websocket.d.ts.map +1 -0
- package/lib/Socket/Client/websocket.js +54 -0
- package/lib/Socket/Client/websocket.js.map +1 -0
- package/lib/Socket/business.d.ts +395 -0
- package/lib/Socket/business.d.ts.map +1 -0
- package/lib/Socket/business.js +380 -0
- package/lib/Socket/business.js.map +1 -0
- package/lib/Socket/chats.d.ts +137 -0
- package/lib/Socket/chats.d.ts.map +1 -0
- package/lib/Socket/chats.js +1214 -0
- package/lib/Socket/chats.js.map +1 -0
- package/lib/Socket/communities.d.ts +562 -0
- package/lib/Socket/communities.d.ts.map +1 -0
- package/lib/Socket/communities.js +432 -0
- package/lib/Socket/communities.js.map +1 -0
- package/lib/Socket/groups.d.ts +286 -0
- package/lib/Socket/groups.d.ts.map +1 -0
- package/lib/Socket/groups.js +348 -0
- package/lib/Socket/groups.js.map +1 -0
- package/lib/Socket/index.d.ts +530 -0
- package/lib/Socket/index.d.ts.map +1 -0
- package/lib/Socket/index.js +12 -0
- package/lib/Socket/index.js.map +1 -0
- package/lib/Socket/messages-recv.d.ts +334 -0
- package/lib/Socket/messages-recv.d.ts.map +1 -0
- package/lib/Socket/messages-recv.js +1765 -0
- package/lib/Socket/messages-recv.js.map +1 -0
- package/lib/Socket/messages-send.d.ts +330 -0
- package/lib/Socket/messages-send.d.ts.map +1 -0
- package/lib/Socket/messages-send.js +1368 -0
- package/lib/Socket/messages-send.js.map +1 -0
- package/lib/Socket/mex.d.ts +2 -0
- package/lib/Socket/mex.d.ts.map +1 -0
- package/lib/Socket/mex.js +42 -0
- package/lib/Socket/mex.js.map +1 -0
- package/lib/Socket/newsletter.d.ts +283 -0
- package/lib/Socket/newsletter.d.ts.map +1 -0
- package/lib/Socket/newsletter.js +226 -0
- package/lib/Socket/newsletter.js.map +1 -0
- package/lib/Socket/socket.d.ts +61 -0
- package/lib/Socket/socket.d.ts.map +1 -0
- package/lib/Socket/socket.js +972 -0
- package/lib/Socket/socket.js.map +1 -0
- package/lib/Store/index.d.ts +4 -0
- package/lib/Store/index.d.ts.map +1 -0
- package/lib/Store/index.js +4 -0
- package/lib/Store/index.js.map +1 -0
- package/lib/Store/make-in-memory-store.d.ts +63 -0
- package/lib/Store/make-in-memory-store.d.ts.map +1 -0
- package/lib/Store/make-in-memory-store.js +471 -0
- package/lib/Store/make-in-memory-store.js.map +1 -0
- package/lib/Store/make-ordered-dictionary.d.ts +13 -0
- package/lib/Store/make-ordered-dictionary.d.ts.map +1 -0
- package/lib/Store/make-ordered-dictionary.js +79 -0
- package/lib/Store/make-ordered-dictionary.js.map +1 -0
- package/lib/Store/object-repository.d.ts +11 -0
- package/lib/Store/object-repository.d.ts.map +1 -0
- package/lib/Store/object-repository.js +24 -0
- package/lib/Store/object-repository.js.map +1 -0
- package/lib/Telegram/button.js +147 -0
- package/lib/Telegram/cli.mjs +105 -0
- package/lib/Telegram/composer.js +582 -0
- package/lib/Telegram/context.js +855 -0
- package/lib/Telegram/core/helpers/args.js +57 -0
- package/lib/Telegram/core/helpers/check.js +55 -0
- package/lib/Telegram/core/helpers/compact.js +16 -0
- package/lib/Telegram/core/helpers/deunionize.js +12 -0
- package/lib/Telegram/core/helpers/formatting.js +91 -0
- package/lib/Telegram/core/helpers/util.js +50 -0
- package/lib/Telegram/core/network/client.js +330 -0
- package/lib/Telegram/core/network/error.js +21 -0
- package/lib/Telegram/core/network/multipart-stream.js +71 -0
- package/lib/Telegram/core/network/polling.js +87 -0
- package/lib/Telegram/core/network/webhook.js +54 -0
- package/lib/Telegram/core/types/typegram.js +27 -0
- package/lib/Telegram/elynn-telegraf.js +256 -0
- package/lib/Telegram/esm-bridge.mjs +21 -0
- package/lib/Telegram/filters.js +69 -0
- package/lib/Telegram/format.js +58 -0
- package/lib/Telegram/future.js +140 -0
- package/lib/Telegram/index.js +59 -0
- package/lib/Telegram/input.js +61 -0
- package/lib/Telegram/markup.js +121 -0
- package/lib/Telegram/middleware.js +2 -0
- package/lib/Telegram/package.json +3 -0
- package/lib/Telegram/reactions.js +84 -0
- package/lib/Telegram/router.js +46 -0
- package/lib/Telegram/scenes/base.js +39 -0
- package/lib/Telegram/scenes/context.js +104 -0
- package/lib/Telegram/scenes/index.js +21 -0
- package/lib/Telegram/scenes/stage.js +49 -0
- package/lib/Telegram/scenes/wizard/context.js +31 -0
- package/lib/Telegram/scenes/wizard/index.js +45 -0
- package/lib/Telegram/scenes.js +17 -0
- package/lib/Telegram/session.js +166 -0
- package/lib/Telegram/telegram-types.js +6 -0
- package/lib/Telegram/telegram.js +945 -0
- package/lib/Telegram/types.js +2 -0
- package/lib/Telegram/utils.js +5 -0
- package/lib/Types/Auth.d.ts +2 -0
- package/lib/Types/Auth.d.ts.map +1 -0
- package/lib/Types/Auth.js +2 -0
- package/lib/Types/Auth.js.map +1 -0
- package/lib/Types/Bussines.d.ts +2 -0
- package/lib/Types/Bussines.d.ts.map +1 -0
- package/lib/Types/Bussines.js +2 -0
- package/lib/Types/Bussines.js.map +1 -0
- package/lib/Types/Call.d.ts +2 -0
- package/lib/Types/Call.d.ts.map +1 -0
- package/lib/Types/Call.js +2 -0
- package/lib/Types/Call.js.map +1 -0
- package/lib/Types/Chat.d.ts +2 -0
- package/lib/Types/Chat.d.ts.map +1 -0
- package/lib/Types/Chat.js +8 -0
- package/lib/Types/Chat.js.map +1 -0
- package/lib/Types/Contact.d.ts +2 -0
- package/lib/Types/Contact.d.ts.map +1 -0
- package/lib/Types/Contact.js +2 -0
- package/lib/Types/Contact.js.map +1 -0
- package/lib/Types/Events.d.ts +2 -0
- package/lib/Types/Events.d.ts.map +1 -0
- package/lib/Types/Events.js +2 -0
- package/lib/Types/Events.js.map +1 -0
- package/lib/Types/GroupMetadata.d.ts +2 -0
- package/lib/Types/GroupMetadata.d.ts.map +1 -0
- package/lib/Types/GroupMetadata.js +2 -0
- package/lib/Types/GroupMetadata.js.map +1 -0
- package/lib/Types/Label.d.ts +3 -0
- package/lib/Types/Label.d.ts.map +1 -0
- package/lib/Types/Label.js +25 -0
- package/lib/Types/Label.js.map +1 -0
- package/lib/Types/LabelAssociation.d.ts +3 -0
- package/lib/Types/LabelAssociation.d.ts.map +1 -0
- package/lib/Types/LabelAssociation.js +7 -0
- package/lib/Types/LabelAssociation.js.map +1 -0
- package/lib/Types/Message.d.ts +12 -0
- package/lib/Types/Message.d.ts.map +1 -0
- package/lib/Types/Message.js +18 -0
- package/lib/Types/Message.js.map +1 -0
- package/lib/Types/Mex.d.ts +3 -0
- package/lib/Types/Mex.d.ts.map +1 -0
- package/lib/Types/Mex.js +39 -0
- package/lib/Types/Mex.js.map +1 -0
- package/lib/Types/Product.d.ts +2 -0
- package/lib/Types/Product.d.ts.map +1 -0
- package/lib/Types/Product.js +2 -0
- package/lib/Types/Product.js.map +1 -0
- package/lib/Types/RichType.d.ts +3 -0
- package/lib/Types/RichType.d.ts.map +1 -0
- package/lib/Types/RichType.js +23 -0
- package/lib/Types/RichType.js.map +1 -0
- package/lib/Types/Signal.d.ts +2 -0
- package/lib/Types/Signal.d.ts.map +1 -0
- package/lib/Types/Signal.js +2 -0
- package/lib/Types/Signal.js.map +1 -0
- package/lib/Types/Socket.d.ts +2 -0
- package/lib/Types/Socket.d.ts.map +1 -0
- package/lib/Types/Socket.js +2 -0
- package/lib/Types/Socket.js.map +1 -0
- package/lib/Types/State.d.ts +6 -0
- package/lib/Types/State.d.ts.map +1 -0
- package/lib/Types/State.js +56 -0
- package/lib/Types/State.js.map +1 -0
- package/lib/Types/USync.d.ts +2 -0
- package/lib/Types/USync.d.ts.map +1 -0
- package/lib/Types/USync.js +2 -0
- package/lib/Types/USync.js.map +1 -0
- package/lib/Types/index.d.ts +14 -0
- package/lib/Types/index.d.ts.map +1 -0
- package/lib/Types/index.js +26 -0
- package/lib/Types/index.js.map +1 -0
- package/lib/Utils/auth-utils.d.ts +58 -0
- package/lib/Utils/auth-utils.d.ts.map +1 -0
- package/lib/Utils/auth-utils.js +302 -0
- package/lib/Utils/auth-utils.js.map +1 -0
- package/lib/Utils/browser-utils.d.ts +9 -0
- package/lib/Utils/browser-utils.d.ts.map +1 -0
- package/lib/Utils/browser-utils.js +36 -0
- package/lib/Utils/browser-utils.js.map +1 -0
- package/lib/Utils/business.d.ts +50 -0
- package/lib/Utils/business.d.ts.map +1 -0
- package/lib/Utils/business.js +231 -0
- package/lib/Utils/business.js.map +1 -0
- package/lib/Utils/chat-utils.d.ts +409 -0
- package/lib/Utils/chat-utils.d.ts.map +1 -0
- package/lib/Utils/chat-utils.js +872 -0
- package/lib/Utils/chat-utils.js.map +1 -0
- package/lib/Utils/companion-reg-client-utils.d.ts +5 -0
- package/lib/Utils/companion-reg-client-utils.d.ts.map +1 -0
- package/lib/Utils/companion-reg-client-utils.js +46 -0
- package/lib/Utils/companion-reg-client-utils.js.map +1 -0
- package/lib/Utils/crypto.d.ts +40 -0
- package/lib/Utils/crypto.d.ts.map +1 -0
- package/lib/Utils/crypto.js +119 -0
- package/lib/Utils/crypto.js.map +1 -0
- package/lib/Utils/decode-wa-message.d.ts +84 -0
- package/lib/Utils/decode-wa-message.d.ts.map +1 -0
- package/lib/Utils/decode-wa-message.js +325 -0
- package/lib/Utils/decode-wa-message.js.map +1 -0
- package/lib/Utils/event-buffer.d.ts +13 -0
- package/lib/Utils/event-buffer.d.ts.map +1 -0
- package/lib/Utils/event-buffer.js +622 -0
- package/lib/Utils/event-buffer.js.map +1 -0
- package/lib/Utils/generics.d.ts +64 -0
- package/lib/Utils/generics.d.ts.map +1 -0
- package/lib/Utils/generics.js +395 -0
- package/lib/Utils/generics.js.map +1 -0
- package/lib/Utils/history.d.ts +76 -0
- package/lib/Utils/history.d.ts.map +1 -0
- package/lib/Utils/history.js +134 -0
- package/lib/Utils/history.js.map +1 -0
- package/lib/Utils/identity-change-handler.d.ts +14 -0
- package/lib/Utils/identity-change-handler.d.ts.map +1 -0
- package/lib/Utils/identity-change-handler.js +50 -0
- package/lib/Utils/identity-change-handler.js.map +1 -0
- package/lib/Utils/index.d.ts +25 -0
- package/lib/Utils/index.d.ts.map +1 -0
- package/lib/Utils/index.js +27 -0
- package/lib/Utils/index.js.map +1 -0
- package/lib/Utils/link-preview.d.ts +13 -0
- package/lib/Utils/link-preview.d.ts.map +1 -0
- package/lib/Utils/link-preview.js +85 -0
- package/lib/Utils/link-preview.js.map +1 -0
- package/lib/Utils/logger.d.ts +3 -0
- package/lib/Utils/logger.d.ts.map +1 -0
- package/lib/Utils/logger.js +3 -0
- package/lib/Utils/logger.js.map +1 -0
- package/lib/Utils/lt-hash.d.ts +7 -0
- package/lib/Utils/lt-hash.d.ts.map +1 -0
- package/lib/Utils/lt-hash.js +8 -0
- package/lib/Utils/lt-hash.js.map +1 -0
- package/lib/Utils/make-mutex.d.ts +7 -0
- package/lib/Utils/make-mutex.d.ts.map +1 -0
- package/lib/Utils/make-mutex.js +33 -0
- package/lib/Utils/make-mutex.js.map +1 -0
- package/lib/Utils/message-retry-manager.d.ts +80 -0
- package/lib/Utils/message-retry-manager.d.ts.map +1 -0
- package/lib/Utils/message-retry-manager.js +265 -0
- package/lib/Utils/message-retry-manager.js.map +1 -0
- package/lib/Utils/messages-media.d.ts +137 -0
- package/lib/Utils/messages-media.d.ts.map +1 -0
- package/lib/Utils/messages-media.js +843 -0
- package/lib/Utils/messages-media.js.map +1 -0
- package/lib/Utils/messages.d.ts +46 -0
- package/lib/Utils/messages.d.ts.map +1 -0
- package/lib/Utils/messages.js +1878 -0
- package/lib/Utils/messages.js.map +1 -0
- package/lib/Utils/noise-handler.d.ts +21 -0
- package/lib/Utils/noise-handler.d.ts.map +1 -0
- package/lib/Utils/noise-handler.js +201 -0
- package/lib/Utils/noise-handler.js.map +1 -0
- package/lib/Utils/offline-node-processor.d.ts +10 -0
- package/lib/Utils/offline-node-processor.d.ts.map +1 -0
- package/lib/Utils/offline-node-processor.js +40 -0
- package/lib/Utils/offline-node-processor.js.map +1 -0
- package/lib/Utils/pre-key-manager.d.ts +26 -0
- package/lib/Utils/pre-key-manager.d.ts.map +1 -0
- package/lib/Utils/pre-key-manager.js +106 -0
- package/lib/Utils/pre-key-manager.js.map +1 -0
- package/lib/Utils/process-message.d.ts +84 -0
- package/lib/Utils/process-message.d.ts.map +1 -0
- package/lib/Utils/process-message.js +745 -0
- package/lib/Utils/process-message.js.map +1 -0
- package/lib/Utils/reporting-utils.d.ts +13 -0
- package/lib/Utils/reporting-utils.d.ts.map +1 -0
- package/lib/Utils/reporting-utils.js +258 -0
- package/lib/Utils/reporting-utils.js.map +1 -0
- package/lib/Utils/rich-message-utils.d.ts +49 -0
- package/lib/Utils/rich-message-utils.d.ts.map +1 -0
- package/lib/Utils/rich-message-utils.js +400 -0
- package/lib/Utils/rich-message-utils.js.map +1 -0
- package/lib/Utils/session-guard.js +148 -0
- package/lib/Utils/signal.d.ts +83 -0
- package/lib/Utils/signal.d.ts.map +1 -0
- package/lib/Utils/signal.js +201 -0
- package/lib/Utils/signal.js.map +1 -0
- package/lib/Utils/stanza-ack.d.ts +17 -0
- package/lib/Utils/stanza-ack.d.ts.map +1 -0
- package/lib/Utils/stanza-ack.js +38 -0
- package/lib/Utils/stanza-ack.js.map +1 -0
- package/lib/Utils/sync-action-utils.d.ts +3 -0
- package/lib/Utils/sync-action-utils.d.ts.map +1 -0
- package/lib/Utils/sync-action-utils.js +49 -0
- package/lib/Utils/sync-action-utils.js.map +1 -0
- package/lib/Utils/tc-token-utils.d.ts +30 -0
- package/lib/Utils/tc-token-utils.d.ts.map +1 -0
- package/lib/Utils/tc-token-utils.js +163 -0
- package/lib/Utils/tc-token-utils.js.map +1 -0
- package/lib/Utils/text-sticker.js +149 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-multi-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-multi-file-auth-state.js +121 -0
- package/lib/Utils/use-multi-file-auth-state.js.map +1 -0
- package/lib/Utils/use-single-file-auth-state.d.ts +11 -0
- package/lib/Utils/use-single-file-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-single-file-auth-state.js +109 -0
- package/lib/Utils/use-single-file-auth-state.js.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts +11 -0
- package/lib/Utils/use-sqlite-auth-state.d.ts.map +1 -0
- package/lib/Utils/use-sqlite-auth-state.js +109 -0
- package/lib/Utils/use-sqlite-auth-state.js.map +1 -0
- package/lib/Utils/validate-connection.d.ts +44 -0
- package/lib/Utils/validate-connection.d.ts.map +1 -0
- package/lib/Utils/validate-connection.js +203 -0
- package/lib/Utils/validate-connection.js.map +1 -0
- package/lib/WABinary/constants.d.ts +62 -0
- package/lib/WABinary/constants.d.ts.map +1 -0
- package/lib/WABinary/constants.js +1467 -0
- package/lib/WABinary/constants.js.map +1 -0
- package/lib/WABinary/decode.d.ts +10 -0
- package/lib/WABinary/decode.d.ts.map +1 -0
- package/lib/WABinary/decode.js +262 -0
- package/lib/WABinary/decode.js.map +1 -0
- package/lib/WABinary/encode.d.ts +3 -0
- package/lib/WABinary/encode.d.ts.map +1 -0
- package/lib/WABinary/encode.js +220 -0
- package/lib/WABinary/encode.js.map +1 -0
- package/lib/WABinary/generic-utils.d.ts +77 -0
- package/lib/WABinary/generic-utils.d.ts.map +1 -0
- package/lib/WABinary/generic-utils.js +226 -0
- package/lib/WABinary/generic-utils.js.map +1 -0
- package/lib/WABinary/index.d.ts +6 -0
- package/lib/WABinary/index.d.ts.map +1 -0
- package/lib/WABinary/index.js +6 -0
- package/lib/WABinary/index.js.map +1 -0
- package/lib/WABinary/jid-utils.d.ts +29 -0
- package/lib/WABinary/jid-utils.d.ts.map +1 -0
- package/lib/WABinary/jid-utils.js +96 -0
- package/lib/WABinary/jid-utils.js.map +1 -0
- package/lib/WABinary/types.d.ts +2 -0
- package/lib/WABinary/types.d.ts.map +1 -0
- package/lib/WABinary/types.js +2 -0
- package/lib/WABinary/types.js.map +1 -0
- package/lib/WAM/BinaryInfo.d.ts +8 -0
- package/lib/WAM/BinaryInfo.d.ts.map +1 -0
- package/lib/WAM/BinaryInfo.js +10 -0
- package/lib/WAM/BinaryInfo.js.map +1 -0
- package/lib/WAM/constants.d.ts +34927 -0
- package/lib/WAM/constants.d.ts.map +1 -0
- package/lib/WAM/constants.js +22853 -0
- package/lib/WAM/constants.js.map +1 -0
- package/lib/WAM/encode.d.ts +2 -0
- package/lib/WAM/encode.d.ts.map +1 -0
- package/lib/WAM/encode.js +150 -0
- package/lib/WAM/encode.js.map +1 -0
- package/lib/WAM/index.d.ts +4 -0
- package/lib/WAM/index.d.ts.map +1 -0
- package/lib/WAM/index.js +4 -0
- package/lib/WAM/index.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts +37 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js +52 -0
- package/lib/WAUSync/Protocols/USyncContactProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts +23 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js +54 -0
- package/lib/WAUSync/Protocols/USyncDeviceProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js +27 -0
- package/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts +13 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js +38 -0
- package/lib/WAUSync/Protocols/USyncStatusProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts +10 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js +25 -0
- package/lib/WAUSync/Protocols/USyncUsernameProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts +39 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js +51 -0
- package/lib/WAUSync/Protocols/UsyncBotProfileProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts +15 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js +29 -0
- package/lib/WAUSync/Protocols/UsyncLIDProtocol.js.map +1 -0
- package/lib/WAUSync/Protocols/index.d.ts +6 -0
- package/lib/WAUSync/Protocols/index.d.ts.map +1 -0
- package/lib/WAUSync/Protocols/index.js +6 -0
- package/lib/WAUSync/Protocols/index.js.map +1 -0
- package/lib/WAUSync/USyncQuery.d.ts +21 -0
- package/lib/WAUSync/USyncQuery.d.ts.map +1 -0
- package/lib/WAUSync/USyncQuery.js +98 -0
- package/lib/WAUSync/USyncQuery.js.map +1 -0
- package/lib/WAUSync/USyncUser.d.ts +17 -0
- package/lib/WAUSync/USyncUser.d.ts.map +1 -0
- package/lib/WAUSync/USyncUser.js +31 -0
- package/lib/WAUSync/USyncUser.js.map +1 -0
- package/lib/WAUSync/index.d.ts +4 -0
- package/lib/WAUSync/index.d.ts.map +1 -0
- package/lib/WAUSync/index.js +4 -0
- package/lib/WAUSync/index.js.map +1 -0
- package/lib/index.d.ts +201 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +314 -0
- package/lib/index.js.map +1 -0
- package/lib/plugins/loader.cjs +26 -0
- package/lib/plugins/loader.js +94 -0
- package/package.json +148 -0
|
@@ -0,0 +1,1415 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
/** @module Guild */
|
|
40
|
+
const Role_1 = __importDefault(require("./Role"));
|
|
41
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
42
|
+
const GuildChannel_1 = __importDefault(require("./GuildChannel"));
|
|
43
|
+
const Member_1 = __importDefault(require("./Member"));
|
|
44
|
+
const GuildScheduledEvent_1 = __importDefault(require("./GuildScheduledEvent"));
|
|
45
|
+
const ThreadChannel_1 = __importDefault(require("./ThreadChannel"));
|
|
46
|
+
const Integration_1 = __importDefault(require("./Integration"));
|
|
47
|
+
const AutoModerationRule_1 = __importDefault(require("./AutoModerationRule"));
|
|
48
|
+
const Permission_1 = __importDefault(require("./Permission"));
|
|
49
|
+
const VoiceState_1 = __importDefault(require("./VoiceState"));
|
|
50
|
+
const StageInstance_1 = __importDefault(require("./StageInstance"));
|
|
51
|
+
const Channel_1 = __importDefault(require("./Channel"));
|
|
52
|
+
const Invite_1 = __importDefault(require("./Invite"));
|
|
53
|
+
const AuditLogEntry_1 = __importDefault(require("./AuditLogEntry"));
|
|
54
|
+
const Soundboard_1 = __importDefault(require("./Soundboard"));
|
|
55
|
+
const Constants_1 = require("../Constants");
|
|
56
|
+
const Routes = __importStar(require("../util/Routes"));
|
|
57
|
+
const TypedCollection_1 = __importDefault(require("../util/TypedCollection"));
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
59
|
+
// @ts-ignore-line
|
|
60
|
+
const Errors_1 = require("../util/Errors");
|
|
61
|
+
const SimpleCollection_1 = __importDefault(require("../util/SimpleCollection"));
|
|
62
|
+
/** Represents a Discord server. */
|
|
63
|
+
class Guild extends Base_1.default {
|
|
64
|
+
_clientMember;
|
|
65
|
+
// if the guild was retrieved from rest
|
|
66
|
+
_rest;
|
|
67
|
+
_shard;
|
|
68
|
+
/** This guild's afk voice channel. */
|
|
69
|
+
afkChannel;
|
|
70
|
+
/** The ID of this guild's afk voice channel. */
|
|
71
|
+
afkChannelID;
|
|
72
|
+
/** The seconds after which voice users will be moved to the afk channel. */
|
|
73
|
+
afkTimeout;
|
|
74
|
+
/** The application that created this guild, if applicable. */
|
|
75
|
+
application;
|
|
76
|
+
/** The ID of the application that created this guild, if applicable. */
|
|
77
|
+
applicationID;
|
|
78
|
+
/** The approximate number of members in this guild (if retrieved with counts). */
|
|
79
|
+
approximateMemberCount;
|
|
80
|
+
/** The approximate number of non-offline members in this guild (if retrieved with counts). */
|
|
81
|
+
approximatePresenceCount;
|
|
82
|
+
/** The cached audit log entries. This requires both the {@link Constants~Intents.GUILD_MODERATION | GUILD_MODERATION} intent, as well as the {@link Constants~Permissions | VIEW_AUDIT_LOG } permission. */
|
|
83
|
+
auditLogEntries;
|
|
84
|
+
/** The auto moderation rules in this guild. */
|
|
85
|
+
autoModerationRules;
|
|
86
|
+
/** The hash of this guild's banner. */
|
|
87
|
+
banner;
|
|
88
|
+
/** The channels in this guild. */
|
|
89
|
+
channels;
|
|
90
|
+
/** The default [message notifications level](https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level) of this guild. */
|
|
91
|
+
defaultMessageNotifications;
|
|
92
|
+
/** The description of this guild. */
|
|
93
|
+
description;
|
|
94
|
+
/** The discovery splash of this guild. Only present if the guild has the `DISCOVERABLE` feature. */
|
|
95
|
+
discoverySplash;
|
|
96
|
+
/** The custom emojis of this guild. */
|
|
97
|
+
emojis;
|
|
98
|
+
/** The [explicit content filter](https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level) of this guild. */
|
|
99
|
+
explicitContentFilter;
|
|
100
|
+
/** The [features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) this guild has. */
|
|
101
|
+
features;
|
|
102
|
+
/** The icon hash of this guild. */
|
|
103
|
+
icon;
|
|
104
|
+
incidentActions;
|
|
105
|
+
/** The integrations in this guild. */
|
|
106
|
+
integrations;
|
|
107
|
+
/** The guild's inventory settings. */
|
|
108
|
+
inventorySettings;
|
|
109
|
+
/** The cached invites in this guild. This will only be populated by invites created while the client is active. */
|
|
110
|
+
invites;
|
|
111
|
+
/** The date at which this guild was joined. */
|
|
112
|
+
joinedAt;
|
|
113
|
+
/** If this guild is considered large. */
|
|
114
|
+
large;
|
|
115
|
+
latestOnboardingQuestionID;
|
|
116
|
+
/** The maximum amount of members this guild can have. */
|
|
117
|
+
maxMembers;
|
|
118
|
+
/** The maximum amount of people that can be present at a time in this guild. Only present for very large guilds. */
|
|
119
|
+
maxPresences;
|
|
120
|
+
/** The maximum amount of users that can be present in a stage video channel. */
|
|
121
|
+
maxStageVideoChannelUsers;
|
|
122
|
+
/** The maximum amount of users that can be present in a video channel. */
|
|
123
|
+
maxVideoChannelUsers;
|
|
124
|
+
/** The number of members in this guild. */
|
|
125
|
+
memberCount;
|
|
126
|
+
/** The cached members in this guild. */
|
|
127
|
+
members;
|
|
128
|
+
/** The required [mfa level](https://discord.com/developers/docs/resources/guild#guild-object-mfa-level) for moderators of this guild. */
|
|
129
|
+
mfaLevel;
|
|
130
|
+
/** The name of this guild. */
|
|
131
|
+
name;
|
|
132
|
+
/** The [nsfw level](https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level) of this guild. */
|
|
133
|
+
nsfwLevel;
|
|
134
|
+
/** The owner of this guild. */
|
|
135
|
+
owner;
|
|
136
|
+
/** The ID of the owner of this guild. */
|
|
137
|
+
ownerID;
|
|
138
|
+
/** The [preferred locale](https://discord.com/developers/docs/reference#locales) of this guild. */
|
|
139
|
+
preferredLocale;
|
|
140
|
+
/** If this guild has the boost progress bar enabled. */
|
|
141
|
+
premiumProgressBarEnabled;
|
|
142
|
+
/** The number of nitro boosts this guild has. */
|
|
143
|
+
premiumSubscriptionCount;
|
|
144
|
+
/** The [boost level](https://discord.com/developers/docs/resources/guild#guild-object-premium-tier) of this guild. */
|
|
145
|
+
premiumTier;
|
|
146
|
+
/** The guild's server tag, only present for guilds received over the gateway. */
|
|
147
|
+
profile;
|
|
148
|
+
/** The channel where notices from Discord are received. Only present in guilds with the `COMMUNITY` feature. */
|
|
149
|
+
publicUpdatesChannel;
|
|
150
|
+
/** The id of the channel where notices from Discord are received. Only present in guilds with the `COMMUNITY` feature. */
|
|
151
|
+
publicUpdatesChannelID;
|
|
152
|
+
/** @deprecated The region of this guild. */
|
|
153
|
+
region;
|
|
154
|
+
/** The roles in this guild. */
|
|
155
|
+
roles;
|
|
156
|
+
/** The channel where rules/guidelines are displayed. Only present in guilds with the `COMMUNITY` feature. */
|
|
157
|
+
rulesChannel;
|
|
158
|
+
/** The id of the channel where rules/guidelines are displayed. Only present in guilds with the `COMMUNITY` feature. */
|
|
159
|
+
rulesChannelID;
|
|
160
|
+
/** The channel where safety related notices are posted. */
|
|
161
|
+
safetyAlertsChannel;
|
|
162
|
+
/** The ID if the channel where safety related notices are posted. */
|
|
163
|
+
safetyAlertsChannelID;
|
|
164
|
+
/** The scheduled events in this guild. */
|
|
165
|
+
scheduledEvents;
|
|
166
|
+
/** The soundboard sounds in this guild. */
|
|
167
|
+
soundboardSounds;
|
|
168
|
+
/** The invite splash hash of this guild. */
|
|
169
|
+
splash;
|
|
170
|
+
/** The stage instances in this guild. */
|
|
171
|
+
stageInstances;
|
|
172
|
+
/** The custom stickers of this guild. */
|
|
173
|
+
stickers;
|
|
174
|
+
/** The channel where welcome messages and boosts notices are posted. */
|
|
175
|
+
systemChannel;
|
|
176
|
+
/** The [flags](https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags) for the system channel. */
|
|
177
|
+
systemChannelFlags;
|
|
178
|
+
/** The ID of the channel where welcome messages and boosts notices are posted. */
|
|
179
|
+
systemChannelID;
|
|
180
|
+
/** The threads in this guild. */
|
|
181
|
+
threads;
|
|
182
|
+
/** If this guild is unavailable. */
|
|
183
|
+
unavailable;
|
|
184
|
+
/** The vanity url of this guild. Only present in guilds with the `VANITY_URL` feature. */
|
|
185
|
+
vanityURLCode;
|
|
186
|
+
/** The [verification level](https://discord.com/developers/docs/resources/guild#guild-object-verification-level) of this guild. */
|
|
187
|
+
verificationLevel;
|
|
188
|
+
/** The voice states of members in voice channels. */
|
|
189
|
+
voiceStates;
|
|
190
|
+
/** The welcome screen configuration. Only present in guilds with the `WELCOME_SCREEN_ENABLED` feature. */
|
|
191
|
+
welcomeScreen;
|
|
192
|
+
/** The channel the widget will generate an invite to, or `null` if set to no invite. */
|
|
193
|
+
widgetChannel;
|
|
194
|
+
/** The id of the channel the widget will generate an invite to, or `null` if set to no invite. */
|
|
195
|
+
widgetChannelID;
|
|
196
|
+
/** If the widget is enabled. */
|
|
197
|
+
widgetEnabled;
|
|
198
|
+
constructor(data, client, rest) {
|
|
199
|
+
super(data.id, client);
|
|
200
|
+
this.afkChannelID = null;
|
|
201
|
+
this.afkTimeout = 0;
|
|
202
|
+
this.applicationID = data.application_id;
|
|
203
|
+
this.auditLogEntries = new TypedCollection_1.default(AuditLogEntry_1.default, client, client.util._getLimit("auditLogEntries", this.id));
|
|
204
|
+
this.autoModerationRules = new TypedCollection_1.default(AutoModerationRule_1.default, client, client.util._getLimit("autoModerationRules", this.id));
|
|
205
|
+
this.banner = null;
|
|
206
|
+
this.channels = new TypedCollection_1.default(GuildChannel_1.default, client, client.util._getLimit("channels", this.id), {
|
|
207
|
+
construct: (channel) => {
|
|
208
|
+
client.channelGuildMap.set(channel.id, this.id);
|
|
209
|
+
return Channel_1.default.from(channel, client);
|
|
210
|
+
},
|
|
211
|
+
delete: (id) => {
|
|
212
|
+
client.channelGuildMap.delete(id);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
this.defaultMessageNotifications = data.default_message_notifications;
|
|
216
|
+
this.description = null;
|
|
217
|
+
this.discoverySplash = null;
|
|
218
|
+
this.emojis = new SimpleCollection_1.default(rawEmoji => this.client.util.convertGuildEmoji(rawEmoji), client.util._getLimit("emojis", this.id), "merge");
|
|
219
|
+
this.explicitContentFilter = data.explicit_content_filter;
|
|
220
|
+
this.features = [];
|
|
221
|
+
this.icon = null;
|
|
222
|
+
this.incidentActions = null;
|
|
223
|
+
this.integrations = new TypedCollection_1.default(Integration_1.default, client, client.util._getLimit("integrations", this.id));
|
|
224
|
+
this.inventorySettings = null;
|
|
225
|
+
this.invites = new SimpleCollection_1.default(rawInvite => Invite_1.default.withMetadata(rawInvite, client), client.util._getLimit("invites", this.id), "update", "code");
|
|
226
|
+
this.joinedAt = null;
|
|
227
|
+
this.large = (data.member_count ?? data.approximate_member_count ?? 0) >= client.shards.options.largeThreshold;
|
|
228
|
+
this.latestOnboardingQuestionID = null;
|
|
229
|
+
this.memberCount = data.member_count ?? data.approximate_member_count ?? 0;
|
|
230
|
+
this.members = new TypedCollection_1.default(Member_1.default, client, client.util._getLimit("members", this.id));
|
|
231
|
+
this.mfaLevel = data.mfa_level;
|
|
232
|
+
this.name = data.name;
|
|
233
|
+
this.nsfwLevel = data.nsfw_level;
|
|
234
|
+
this.owner = data.owner_id === null ? null : client.users.get(data.owner_id);
|
|
235
|
+
this.ownerID = data.owner_id;
|
|
236
|
+
this.preferredLocale = data.preferred_locale;
|
|
237
|
+
this.premiumProgressBarEnabled = data.premium_progress_bar_enabled;
|
|
238
|
+
this.premiumTier = data.premium_tier;
|
|
239
|
+
this.profile = null;
|
|
240
|
+
this.publicUpdatesChannelID = null;
|
|
241
|
+
this.roles = new TypedCollection_1.default(Role_1.default, client, client.util._getLimit("roles", this.id));
|
|
242
|
+
this.rulesChannelID = null;
|
|
243
|
+
this.safetyAlertsChannelID = null;
|
|
244
|
+
this.scheduledEvents = new TypedCollection_1.default(GuildScheduledEvent_1.default, client, client.util._getLimit("scheduledEvents", this.id));
|
|
245
|
+
this.soundboardSounds = new TypedCollection_1.default(Soundboard_1.default, client, client.util._getLimit("soundboardSounds", this.id));
|
|
246
|
+
this.splash = null;
|
|
247
|
+
this.stageInstances = new TypedCollection_1.default(StageInstance_1.default, client, client.util._getLimit("stageInstances", this.id));
|
|
248
|
+
this.stickers = new SimpleCollection_1.default(rawSticker => client.util.convertSticker(rawSticker), client.util._getLimit("stickers", this.id), "merge");
|
|
249
|
+
this.systemChannelID = null;
|
|
250
|
+
this.systemChannelFlags = data.system_channel_flags;
|
|
251
|
+
this.threads = new TypedCollection_1.default(ThreadChannel_1.default, client, client.util._getLimit("guildThreads", this.id), {
|
|
252
|
+
construct: (thread) => {
|
|
253
|
+
client.threadGuildMap.set(thread.id, this.id);
|
|
254
|
+
return Channel_1.default.from(thread, client);
|
|
255
|
+
},
|
|
256
|
+
delete: (id) => {
|
|
257
|
+
client.threadGuildMap.delete(id);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
this.unavailable = !!data.unavailable;
|
|
261
|
+
this.vanityURLCode = data.vanity_url_code;
|
|
262
|
+
this.verificationLevel = data.verification_level;
|
|
263
|
+
this.voiceStates = new TypedCollection_1.default(VoiceState_1.default, client, client.util._getLimit("voiceStates", this.id));
|
|
264
|
+
this.widgetChannelID = data.widget_channel_id ?? null;
|
|
265
|
+
for (const role of data.roles) {
|
|
266
|
+
this.roles.update(role, data.id);
|
|
267
|
+
}
|
|
268
|
+
this.update(data);
|
|
269
|
+
this._rest = !!rest;
|
|
270
|
+
if (data.channels) {
|
|
271
|
+
for (const channelData of data.channels) {
|
|
272
|
+
channelData.guild_id = this.id;
|
|
273
|
+
this.channels.update(channelData);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (data.threads) {
|
|
277
|
+
for (const threadData of data.threads) {
|
|
278
|
+
threadData.guild_id = this.id;
|
|
279
|
+
this.threads.update(threadData);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
if (data.members) {
|
|
283
|
+
for (const rawMember of data.members) {
|
|
284
|
+
const member = this.members.update({ ...rawMember, id: rawMember.user?.id }, this.id);
|
|
285
|
+
if (this.client["_user"] && member.id === this.client.user.id) {
|
|
286
|
+
this._clientMember = member;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (data.stage_instances) {
|
|
291
|
+
for (const stageInstance of data.stage_instances) {
|
|
292
|
+
stageInstance.guild_id = this.id;
|
|
293
|
+
this.stageInstances.update(stageInstance);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (data.presences) {
|
|
297
|
+
for (const presence of data.presences) {
|
|
298
|
+
const member = this.members.get(presence.user.id);
|
|
299
|
+
if (member) {
|
|
300
|
+
delete presence.user;
|
|
301
|
+
member.presence = {
|
|
302
|
+
clientStatus: presence.client_status,
|
|
303
|
+
guildID: presence.guild_id,
|
|
304
|
+
status: presence.status,
|
|
305
|
+
activities: presence.activities?.map(activity => ({
|
|
306
|
+
createdAt: activity.created_at,
|
|
307
|
+
name: activity.name,
|
|
308
|
+
type: activity.type,
|
|
309
|
+
applicationID: activity.application_id,
|
|
310
|
+
assets: activity.assets ? {
|
|
311
|
+
largeImage: activity.assets.large_image,
|
|
312
|
+
largeText: activity.assets.large_text,
|
|
313
|
+
smallImage: activity.assets.small_image,
|
|
314
|
+
smallText: activity.assets.small_text
|
|
315
|
+
} : undefined,
|
|
316
|
+
buttons: activity.buttons,
|
|
317
|
+
details: activity.details,
|
|
318
|
+
emoji: activity.emoji,
|
|
319
|
+
flags: activity.flags,
|
|
320
|
+
instance: activity.instance,
|
|
321
|
+
party: activity.party,
|
|
322
|
+
secrets: activity.secrets,
|
|
323
|
+
state: activity.state,
|
|
324
|
+
timestamps: activity.timestamps,
|
|
325
|
+
url: activity.url
|
|
326
|
+
}))
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
client.emit("debug", `Rogue presence (user: ${presence.user.id}, guild: ${this.id})`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (data.voice_states) {
|
|
335
|
+
for (const voiceState of data.voice_states) {
|
|
336
|
+
if (!this.members.has(voiceState.user_id) || !voiceState.channel_id) {
|
|
337
|
+
continue;
|
|
338
|
+
}
|
|
339
|
+
voiceState.guild_id = this.id;
|
|
340
|
+
this.voiceStates.update({ ...voiceState, id: voiceState.user_id });
|
|
341
|
+
const channel = this.channels.get(voiceState.channel_id);
|
|
342
|
+
const member = this.members.update({ id: voiceState.user_id, deaf: voiceState.deaf, mute: voiceState.mute }, this.id);
|
|
343
|
+
if (this._clientMember) {
|
|
344
|
+
this._clientMember["update"]({ deaf: voiceState.deaf, mute: voiceState.mute });
|
|
345
|
+
}
|
|
346
|
+
if (channel && "voiceMembers" in channel) {
|
|
347
|
+
channel.voiceMembers.add(member);
|
|
348
|
+
}
|
|
349
|
+
if (client.shards.options.seedVoiceConnections && voiceState.user_id === client.user.id && !this.client.getVoiceConnection(this.id)) {
|
|
350
|
+
this.client.joinVoiceChannel({
|
|
351
|
+
guildID: this.id,
|
|
352
|
+
channelID: voiceState.channel_id,
|
|
353
|
+
selfDeaf: voiceState.self_deaf,
|
|
354
|
+
selfMute: voiceState.self_mute,
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
356
|
+
voiceAdapterCreator: this.voiceAdapterCreator
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
toggleFeature(feature, enable, reason) {
|
|
363
|
+
const newFeatures = enable ?
|
|
364
|
+
(this.features.includes(feature) ? this.features : [...this.features, feature]) :
|
|
365
|
+
this.features.filter(name => name !== feature);
|
|
366
|
+
return this.edit({ features: newFeatures, reason });
|
|
367
|
+
}
|
|
368
|
+
// true = `memberCount`
|
|
369
|
+
updateMemberLimit(toAdd) {
|
|
370
|
+
if (this.members.limit === Infinity || this.client.options.disableMemberLimitScaling) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const original = this.members.limit;
|
|
374
|
+
const num = toAdd === true ? this.memberCount : this.members.limit + toAdd;
|
|
375
|
+
const round = 10 ** (Math.floor(Math.log10(num)) - 1);
|
|
376
|
+
if (toAdd === true) {
|
|
377
|
+
const limit = Math.round(num / round) * round + round;
|
|
378
|
+
if (this.members.limit >= limit) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
this.members.limit = limit;
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
const limit = Math.round((this.members.size + toAdd) / round) * round + round;
|
|
385
|
+
if (this.members.limit >= limit) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
this.members.limit = limit;
|
|
389
|
+
}
|
|
390
|
+
this.client.emit("debug", `The limit of the members collection of guild ${this.id} has been updated from ${original} to ${this.members.limit} to accommodate at least ${toAdd === true ? this.memberCount : this.members.size + toAdd} members.`);
|
|
391
|
+
}
|
|
392
|
+
update(data) {
|
|
393
|
+
if (data.afk_channel_id !== undefined) {
|
|
394
|
+
this.afkChannel = data.afk_channel_id === null ? null : this.client.getChannel(data.afk_channel_id);
|
|
395
|
+
this.afkChannelID = data.afk_channel_id;
|
|
396
|
+
}
|
|
397
|
+
if (data.afk_timeout !== undefined) {
|
|
398
|
+
this.afkTimeout = data.afk_timeout;
|
|
399
|
+
}
|
|
400
|
+
if (data.application_id !== undefined) {
|
|
401
|
+
this.application = this.client["_application"] && data.application_id === null ? null : (this.client.application.id === data.application_id ? this.client.application : undefined);
|
|
402
|
+
this.applicationID = data.application_id;
|
|
403
|
+
}
|
|
404
|
+
if (data.approximate_member_count !== undefined) {
|
|
405
|
+
this.approximateMemberCount = data.approximate_member_count;
|
|
406
|
+
}
|
|
407
|
+
if (data.approximate_presence_count !== undefined) {
|
|
408
|
+
this.approximatePresenceCount = data.approximate_presence_count;
|
|
409
|
+
}
|
|
410
|
+
if (data.banner !== undefined) {
|
|
411
|
+
this.banner = data.banner;
|
|
412
|
+
}
|
|
413
|
+
if (data.default_message_notifications !== undefined) {
|
|
414
|
+
this.defaultMessageNotifications = data.default_message_notifications;
|
|
415
|
+
}
|
|
416
|
+
if (data.description !== undefined) {
|
|
417
|
+
this.description = data.description;
|
|
418
|
+
}
|
|
419
|
+
if (data.discovery_splash !== undefined) {
|
|
420
|
+
this.discoverySplash = data.discovery_splash;
|
|
421
|
+
}
|
|
422
|
+
if (data.emojis !== undefined) {
|
|
423
|
+
this.emojis.clear();
|
|
424
|
+
for (const emoji of data.emojis) {
|
|
425
|
+
this.emojis.update(emoji);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (data.explicit_content_filter !== undefined) {
|
|
429
|
+
this.explicitContentFilter = data.explicit_content_filter;
|
|
430
|
+
}
|
|
431
|
+
if (data.features !== undefined) {
|
|
432
|
+
this.features = data.features;
|
|
433
|
+
}
|
|
434
|
+
if (data.icon !== undefined) {
|
|
435
|
+
this.icon = data.icon;
|
|
436
|
+
}
|
|
437
|
+
if (data.incident_actions !== undefined) {
|
|
438
|
+
this.incidentActions = data.incident_actions === null ? null : {
|
|
439
|
+
dmsDisabledUntil: data.incident_actions.dms_disabled_until,
|
|
440
|
+
invitesDisabledUntil: data.incident_actions.invites_disabled_until
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
if (data.inventory_settings !== undefined) {
|
|
444
|
+
this.inventorySettings = data.inventory_settings === null ? null : {
|
|
445
|
+
isEmojiPackCollectible: data.inventory_settings.is_emoji_pack_collectible
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
if (data.joined_at !== undefined) {
|
|
449
|
+
this.joinedAt = data.joined_at === null ? null : new Date(data.joined_at);
|
|
450
|
+
}
|
|
451
|
+
if (data.large !== undefined) {
|
|
452
|
+
this.large = data.large;
|
|
453
|
+
}
|
|
454
|
+
if (data.latest_onboarding_question_id !== undefined) {
|
|
455
|
+
this.latestOnboardingQuestionID = data.latest_onboarding_question_id;
|
|
456
|
+
}
|
|
457
|
+
if (data.max_members !== undefined) {
|
|
458
|
+
this.maxMembers = data.max_members;
|
|
459
|
+
}
|
|
460
|
+
if (data.max_presences !== undefined) {
|
|
461
|
+
this.maxPresences = data.max_presences;
|
|
462
|
+
}
|
|
463
|
+
if (data.max_stage_video_channel_users !== undefined) {
|
|
464
|
+
this.maxStageVideoChannelUsers = data.max_stage_video_channel_users;
|
|
465
|
+
}
|
|
466
|
+
if (data.max_video_channel_users !== undefined) {
|
|
467
|
+
this.maxVideoChannelUsers = data.max_video_channel_users;
|
|
468
|
+
}
|
|
469
|
+
if (data.member_count !== undefined) {
|
|
470
|
+
this.memberCount = data.member_count;
|
|
471
|
+
}
|
|
472
|
+
if (data.mfa_level !== undefined) {
|
|
473
|
+
this.mfaLevel = data.mfa_level;
|
|
474
|
+
}
|
|
475
|
+
if (data.name !== undefined) {
|
|
476
|
+
this.name = data.name;
|
|
477
|
+
}
|
|
478
|
+
if (data.nsfw_level !== undefined) {
|
|
479
|
+
this.nsfwLevel = data.nsfw_level;
|
|
480
|
+
}
|
|
481
|
+
if (data.owner_id !== undefined) {
|
|
482
|
+
this.ownerID = data.owner_id;
|
|
483
|
+
this.owner = data.owner_id === null ? null : this.client.users.get(data.owner_id);
|
|
484
|
+
}
|
|
485
|
+
if (data.preferred_locale !== undefined) {
|
|
486
|
+
this.preferredLocale = data.preferred_locale;
|
|
487
|
+
}
|
|
488
|
+
if (data.premium_progress_bar_enabled !== undefined) {
|
|
489
|
+
this.premiumProgressBarEnabled = data.premium_progress_bar_enabled;
|
|
490
|
+
}
|
|
491
|
+
if (data.premium_subscription_count !== undefined) {
|
|
492
|
+
this.premiumSubscriptionCount = data.premium_subscription_count;
|
|
493
|
+
}
|
|
494
|
+
if (data.premium_tier !== undefined) {
|
|
495
|
+
this.premiumTier = data.premium_tier;
|
|
496
|
+
}
|
|
497
|
+
if (data.profile !== undefined) {
|
|
498
|
+
this.profile = data.profile;
|
|
499
|
+
}
|
|
500
|
+
if (data.public_updates_channel_id !== undefined) {
|
|
501
|
+
this.publicUpdatesChannel = data.public_updates_channel_id === null ? null : this.client.getChannel(data.public_updates_channel_id);
|
|
502
|
+
this.publicUpdatesChannelID = data.public_updates_channel_id;
|
|
503
|
+
}
|
|
504
|
+
if (data.region !== undefined) {
|
|
505
|
+
this.region = data.region;
|
|
506
|
+
}
|
|
507
|
+
if (data.rules_channel_id !== undefined) {
|
|
508
|
+
this.rulesChannel = data.rules_channel_id === null ? null : this.client.getChannel(data.rules_channel_id);
|
|
509
|
+
this.rulesChannelID = data.rules_channel_id;
|
|
510
|
+
}
|
|
511
|
+
if (data.safety_alerts_channel_id !== undefined) {
|
|
512
|
+
this.safetyAlertsChannel = data.safety_alerts_channel_id === null ? null : this.client.getChannel(data.safety_alerts_channel_id);
|
|
513
|
+
this.safetyAlertsChannelID = data.safety_alerts_channel_id;
|
|
514
|
+
}
|
|
515
|
+
if (data.splash !== undefined) {
|
|
516
|
+
this.splash = data.splash;
|
|
517
|
+
}
|
|
518
|
+
if (data.stickers !== undefined) {
|
|
519
|
+
this.stickers.clear();
|
|
520
|
+
for (const sticker of data.stickers)
|
|
521
|
+
this.stickers.update(sticker);
|
|
522
|
+
}
|
|
523
|
+
if (data.system_channel_flags !== undefined) {
|
|
524
|
+
this.systemChannelFlags = data.system_channel_flags;
|
|
525
|
+
}
|
|
526
|
+
if (data.system_channel_id !== undefined) {
|
|
527
|
+
this.systemChannel = data.system_channel_id === null ? null : this.client.getChannel(data.system_channel_id);
|
|
528
|
+
this.systemChannelID = data.system_channel_id;
|
|
529
|
+
}
|
|
530
|
+
if (data.vanity_url_code !== undefined) {
|
|
531
|
+
this.vanityURLCode = data.vanity_url_code;
|
|
532
|
+
}
|
|
533
|
+
if (data.verification_level !== undefined) {
|
|
534
|
+
this.verificationLevel = data.verification_level;
|
|
535
|
+
}
|
|
536
|
+
if (data.welcome_screen !== undefined) {
|
|
537
|
+
this.welcomeScreen = {
|
|
538
|
+
description: data.welcome_screen.description,
|
|
539
|
+
welcomeChannels: data.welcome_screen.welcome_channels.map(channel => ({
|
|
540
|
+
channelID: channel.channel_id,
|
|
541
|
+
description: channel.description,
|
|
542
|
+
emojiID: channel.emoji_id,
|
|
543
|
+
emojiName: channel.emoji_name
|
|
544
|
+
}))
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
if (data.widget_channel_id !== undefined) {
|
|
548
|
+
this.widgetChannel = data.widget_channel_id === null ? null : this.client.getChannel(data.widget_channel_id);
|
|
549
|
+
this.widgetChannelID = data.widget_channel_id;
|
|
550
|
+
}
|
|
551
|
+
if (data.widget_enabled !== undefined) {
|
|
552
|
+
this.widgetEnabled = data.widget_enabled;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
/** The client's member for this guild. This will throw an error if the member is not cached. */
|
|
556
|
+
get clientMember() {
|
|
557
|
+
this._clientMember ??= this.client["_user"] === undefined ? undefined : this.members.get(this.client["_user"].id);
|
|
558
|
+
if (!this._clientMember) {
|
|
559
|
+
if (this._rest) {
|
|
560
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#clientMember is not present when the guild is obtained via rest.`);
|
|
561
|
+
}
|
|
562
|
+
throw new Errors_1.UncachedError(`The client's member has not been cached for ${this.constructor.name}#clientMember.`);
|
|
563
|
+
}
|
|
564
|
+
return this._clientMember;
|
|
565
|
+
}
|
|
566
|
+
/** The shard this guild is on. Gateway only. */
|
|
567
|
+
get shard() {
|
|
568
|
+
this._shard ??= this.client.shards["_forGuild"](this.id);
|
|
569
|
+
if (this.client.options.restMode) {
|
|
570
|
+
throw new TypeError(`${this.constructor.name}#shard will not be present with rest mode enabled.`);
|
|
571
|
+
}
|
|
572
|
+
if (!this.client.shards.connected) {
|
|
573
|
+
throw new TypeError(`${this.constructor.name}#shard will not be present without a gateway connection.`);
|
|
574
|
+
}
|
|
575
|
+
if (!this._shard) {
|
|
576
|
+
throw new TypeError(`Failed to determine shard for ${this.constructor.name}#shard (guild: ${this.id})`);
|
|
577
|
+
}
|
|
578
|
+
return this._shard;
|
|
579
|
+
}
|
|
580
|
+
/** The voice adapter creator for this guild that can be used with [@discordjs/voice](https://discord.js.org/#/docs/voice/main/general/welcome) to play audio in voice and stage channels. */
|
|
581
|
+
get voiceAdapterCreator() {
|
|
582
|
+
this._shard ??= this.client.shards["_forGuild"](this.id);
|
|
583
|
+
if (this.client.options.restMode) {
|
|
584
|
+
throw new TypeError(`${this.constructor.name}#voiceAdapterCreator cannot be used with rest mode enabled.`);
|
|
585
|
+
}
|
|
586
|
+
if (!this.client.shards.connected) {
|
|
587
|
+
throw new TypeError(`${this.constructor.name}#voiceAdapterCreator cannot be used without a gateway connection.`);
|
|
588
|
+
}
|
|
589
|
+
if (!this._shard) {
|
|
590
|
+
throw new TypeError(`Failed to determine shard for ${this.constructor.name}#voiceAdapterCreator (guild: ${this.id})`);
|
|
591
|
+
}
|
|
592
|
+
return (methods) => {
|
|
593
|
+
this.client.voiceAdapters.set(this.id, methods);
|
|
594
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
595
|
+
return {
|
|
596
|
+
sendPayload: (payload) => {
|
|
597
|
+
this.shard.send(payload.op, payload.d);
|
|
598
|
+
return true;
|
|
599
|
+
},
|
|
600
|
+
destroy: () => this.client.voiceAdapters.delete(this.id)
|
|
601
|
+
};
|
|
602
|
+
};
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Add a member to this guild. Requires an access token with the `guilds.join` scope.
|
|
606
|
+
*
|
|
607
|
+
* Returns the newly added member upon success, or void if the member is already in the guild.
|
|
608
|
+
* @param userID The ID of the user to add.
|
|
609
|
+
* @param options The options for adding the member.
|
|
610
|
+
*/
|
|
611
|
+
async addMember(userID, options) {
|
|
612
|
+
return this.client.rest.guilds.addMember(this.id, userID, options);
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Add a role to a member.
|
|
616
|
+
* @param memberID The ID of the member.
|
|
617
|
+
* @param roleID The ID of the role to add.
|
|
618
|
+
* @param reason The reason for adding the role.
|
|
619
|
+
*/
|
|
620
|
+
async addMemberRole(memberID, roleID, reason) {
|
|
621
|
+
return this.client.rest.guilds.addMemberRole(this.id, memberID, roleID, reason);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* The url of this guild's banner.
|
|
625
|
+
* @param format The format the url should be.
|
|
626
|
+
* @param size The dimensions of the image.
|
|
627
|
+
*/
|
|
628
|
+
bannerURL(format, size) {
|
|
629
|
+
return this.banner === null ? null : this.client.util.formatImage(Routes.BANNER(this.id, this.banner), format, size);
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Begin a prune.
|
|
633
|
+
* @param options The options for the prune.
|
|
634
|
+
*/
|
|
635
|
+
async beginPrune(options) {
|
|
636
|
+
return this.client.rest.guilds.beginPrune(this.id, options);
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Ban up to 200 members from this guild. This requires both the `BAN_MEMBERS` and `MANAGE_GUILD` permissions.
|
|
640
|
+
* If no members were banned, a {@link Constants~JSONErrorCodes.FAILED_TO_BAN_USERS | FAILED_TO_BAN_USERS } will be returned.
|
|
641
|
+
* The bot user is ignored.
|
|
642
|
+
* @param options The options for banning.
|
|
643
|
+
*/
|
|
644
|
+
async bulkBan(options) {
|
|
645
|
+
return this.client.rest.guilds.bulkBan(this.id, options);
|
|
646
|
+
}
|
|
647
|
+
/**
|
|
648
|
+
* Create an auto moderation rule for this guild.
|
|
649
|
+
* @param options The options for the rule.
|
|
650
|
+
*/
|
|
651
|
+
async createAutoModerationRule(options) {
|
|
652
|
+
return this.client.rest.guilds.createAutoModerationRule(this.id, options);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Create a ban for a user.
|
|
656
|
+
* @param userID The ID of the user.
|
|
657
|
+
* @param options The options for creating the ban.
|
|
658
|
+
*/
|
|
659
|
+
async createBan(userID, options) {
|
|
660
|
+
return this.client.rest.guilds.createBan(this.id, userID, options);
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Create a channel in this guild.
|
|
664
|
+
* @param options The options for creating the channel.
|
|
665
|
+
*/
|
|
666
|
+
async createChannel(type, options) {
|
|
667
|
+
return this.client.rest.guilds.createChannel(this.id, type, options);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Create an emoji in this guild.
|
|
671
|
+
* @param options The options for creating the emoji.
|
|
672
|
+
*/
|
|
673
|
+
async createEmoji(options) {
|
|
674
|
+
return this.client.rest.guilds.createEmoji(this.id, options);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Create a role.
|
|
678
|
+
* @param options The options for creating the role.
|
|
679
|
+
*/
|
|
680
|
+
async createRole(options) {
|
|
681
|
+
return this.client.rest.guilds.createRole(this.id, options);
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Create a scheduled event in this guild.
|
|
685
|
+
* @param options The options for creating the scheduled event.
|
|
686
|
+
*/
|
|
687
|
+
async createScheduledEvent(options) {
|
|
688
|
+
return this.client.rest.guilds.createScheduledEvent(this.id, options);
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Create a soundboard sound.
|
|
692
|
+
* @param options The options for creating the soundboard sound.
|
|
693
|
+
*/
|
|
694
|
+
async createSoundboardSound(options) {
|
|
695
|
+
return this.client.rest.guilds.createSoundboardSound(this.id, options);
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* Create a sticker.
|
|
699
|
+
* @param options The options for creating the sticker.
|
|
700
|
+
*/
|
|
701
|
+
async createSticker(options) {
|
|
702
|
+
return this.client.rest.guilds.createSticker(this.id, options);
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Create a guild template.
|
|
706
|
+
* @param options The options for creating the template.
|
|
707
|
+
*/
|
|
708
|
+
async createTemplate(options) {
|
|
709
|
+
return this.client.rest.guilds.createTemplate(this.id, options);
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Create a test entitlement for this guild.
|
|
713
|
+
* @param skuID The ID of the SKU to create an entitlement for.
|
|
714
|
+
* @param applicationID The ID of the application to create the entitlement for. If present, defaults to the logged in client's application id.
|
|
715
|
+
*/
|
|
716
|
+
async createTestEntitlement(skuID, applicationID) {
|
|
717
|
+
if (applicationID === undefined && this.client["_application"] === undefined) {
|
|
718
|
+
throw new Errors_1.UncachedError("Client#application is not present, you must provide an applicationID as a second argument. To not need to provide an ID, only call this after at least one shard is READY, or restMode is enabled.");
|
|
719
|
+
}
|
|
720
|
+
return this.client.rest.applications.createTestEntitlement(applicationID ?? this.client.application.id, {
|
|
721
|
+
ownerID: this.id,
|
|
722
|
+
ownerType: Constants_1.EntitlementOwnerTypes.GUILD,
|
|
723
|
+
skuID
|
|
724
|
+
});
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Delete an auto moderation rule in this guild.
|
|
728
|
+
* @param ruleID The ID of the rule to delete.
|
|
729
|
+
* @param reason The reason for deleting the rule.
|
|
730
|
+
*/
|
|
731
|
+
async deleteAutoModerationRule(ruleID, reason) {
|
|
732
|
+
return this.client.rest.guilds.deleteAutoModerationRule(this.id, ruleID, reason);
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Delete an emoji in this guild.
|
|
736
|
+
* @param emojiID The ID of the emoji.
|
|
737
|
+
* @param reason The reason for deleting the emoji.
|
|
738
|
+
*/
|
|
739
|
+
async deleteEmoji(emojiID, reason) {
|
|
740
|
+
return this.client.rest.guilds.deleteEmoji(this.id, emojiID, reason);
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* Delete an integration.
|
|
744
|
+
* @param integrationID The ID of the integration.
|
|
745
|
+
* @param reason The reason for deleting the integration.
|
|
746
|
+
*/
|
|
747
|
+
async deleteIntegration(integrationID, reason) {
|
|
748
|
+
return this.client.rest.guilds.deleteIntegration(this.id, integrationID, reason);
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Delete a role.
|
|
752
|
+
* @param roleID The ID of the role to delete.
|
|
753
|
+
* @param reason The reason for deleting the role.
|
|
754
|
+
*/
|
|
755
|
+
async deleteRole(roleID, reason) {
|
|
756
|
+
return this.client.rest.guilds.deleteRole(this.id, roleID, reason);
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Delete a scheduled event.
|
|
760
|
+
* @param eventID The ID of the scheduled event.
|
|
761
|
+
* @param reason The reason for deleting the scheduled event. Discord's docs do not explicitly state a reason can be provided, so it may not be used.
|
|
762
|
+
*/
|
|
763
|
+
async deleteScheduledEvent(eventID, reason) {
|
|
764
|
+
return this.client.rest.guilds.deleteScheduledEvent(this.id, eventID, reason);
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Delete a soundboard sound.
|
|
768
|
+
* @param soundID The ID of the soundboard sound.
|
|
769
|
+
* @param reason The reason for deleting the soundboard sound.
|
|
770
|
+
*/
|
|
771
|
+
async deleteSoundboardSound(soundID, reason) {
|
|
772
|
+
return this.client.rest.guilds.deleteSoundboardSound(this.id, soundID, reason);
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* Delete a sticker.
|
|
776
|
+
* @param stickerID The ID of the sticker to delete.
|
|
777
|
+
* @param reason The reason for deleting the sticker.
|
|
778
|
+
*/
|
|
779
|
+
async deleteSticker(stickerID, reason) {
|
|
780
|
+
return this.client.rest.guilds.deleteSticker(this.id, stickerID, reason);
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Delete a template.
|
|
784
|
+
* @param code The code of the template.
|
|
785
|
+
*/
|
|
786
|
+
async deleteTemplate(code) {
|
|
787
|
+
return this.client.rest.guilds.deleteTemplate(this.id, code);
|
|
788
|
+
}
|
|
789
|
+
/**
|
|
790
|
+
* Disable the `COMMUNITY` feature for this guild. Requires the **Administrator** permission.
|
|
791
|
+
* @param reason The reason for disable the feature.
|
|
792
|
+
*/
|
|
793
|
+
async disableCommunity(reason) {
|
|
794
|
+
return this.toggleFeature("COMMUNITY", false, reason);
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Disable the `DISCOVERABLE` feature for this guild. Requires the **Administrator** permission.
|
|
798
|
+
* @param reason The reason for disabling the feature.
|
|
799
|
+
*/
|
|
800
|
+
async disableDiscovery(reason) {
|
|
801
|
+
return this.toggleFeature("DISCOVERABLE", false, reason);
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Disable the `INVITES_DISABLED` feature for this guild. Requires the **Manage Guild** permission.
|
|
805
|
+
* @param reason The reason for disabling the feature.
|
|
806
|
+
*/
|
|
807
|
+
async disableInvites(reason) {
|
|
808
|
+
return this.toggleFeature("INVITES_DISABLED", false, reason);
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Disable the `RAID_ALERTS_ENABLED` feature for this guild. Requires the **Manage Guild** permission.
|
|
812
|
+
* @param reason The reason for disabling the feature.
|
|
813
|
+
*/
|
|
814
|
+
async disableRaidAlerts(reason) {
|
|
815
|
+
return this.toggleFeature("RAID_ALERTS_ENABLED", false, reason);
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* The url of this guild's discovery splash.
|
|
819
|
+
* @param format The format the url should be.
|
|
820
|
+
* @param size The dimensions of the image.
|
|
821
|
+
*/
|
|
822
|
+
discoverySplashURL(format, size) {
|
|
823
|
+
return this.discoverySplash === null ? null : this.client.util.formatImage(Routes.GUILD_DISCOVERY_SPLASH(this.id, this.discoverySplash), format, size);
|
|
824
|
+
}
|
|
825
|
+
/**
|
|
826
|
+
* Edit this guild.
|
|
827
|
+
* @param options The options for editing the guild.
|
|
828
|
+
*/
|
|
829
|
+
async edit(options) {
|
|
830
|
+
return this.client.rest.guilds.edit(this.id, options);
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Edit an existing auto moderation rule in this guild.
|
|
834
|
+
* @param ruleID The ID of the rule to edit.
|
|
835
|
+
* @param options The options for editing the rule.
|
|
836
|
+
*/
|
|
837
|
+
async editAutoModerationRule(ruleID, options) {
|
|
838
|
+
return this.client.rest.guilds.editAutoModerationRule(this.id, ruleID, options);
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Edit the positions of channels in this guild.
|
|
842
|
+
* @param options The channels to move. Unedited channels do not need to be specified.
|
|
843
|
+
*/
|
|
844
|
+
async editChannelPositions(options) {
|
|
845
|
+
return this.client.rest.guilds.editChannelPositions(this.id, options);
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Modify the current member in this guild.
|
|
849
|
+
* @param options The options for editing the member.
|
|
850
|
+
*/
|
|
851
|
+
async editCurrentMember(options) {
|
|
852
|
+
return this.client.rest.guilds.editCurrentMember(this.id, options);
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* Edit the current member's voice state in this guild. `channelID` is required, and the current member must already be in that channel. See [Discord's docs](https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state-caveats) for more information.
|
|
856
|
+
* @param options The options for editing the voice state.
|
|
857
|
+
*/
|
|
858
|
+
async editCurrentUserVoiceState(options) {
|
|
859
|
+
return this.client.rest.guilds.editCurrentUserVoiceState(this.id, options);
|
|
860
|
+
}
|
|
861
|
+
/**
|
|
862
|
+
* Edit an existing emoji in this guild.
|
|
863
|
+
* @param options The options for editing the emoji.
|
|
864
|
+
*/
|
|
865
|
+
async editEmoji(emojiID, options) {
|
|
866
|
+
return this.client.rest.guilds.editEmoji(this.id, emojiID, options);
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Edit the incident actions for this guild.
|
|
870
|
+
* @param options The options for editing the incident actions.
|
|
871
|
+
*/
|
|
872
|
+
async editIncidentActions(options) {
|
|
873
|
+
return this.client.rest.guilds.editIncidentActions(this.id, options);
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Edit a member of this guild. Use \<Guild\>.editCurrentMember if you wish to update the nick of this client using the CHANGE_NICKNAME permission.
|
|
877
|
+
* @param memberID The ID of the member.
|
|
878
|
+
* @param options The options for editing the member.
|
|
879
|
+
*/
|
|
880
|
+
async editMember(memberID, options) {
|
|
881
|
+
return this.client.rest.guilds.editMember(this.id, memberID, options);
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Edit this guild's onboarding configuration.
|
|
885
|
+
* @param options The options for editing the onboarding configuration.
|
|
886
|
+
*/
|
|
887
|
+
async editOnboarding(options) {
|
|
888
|
+
return this.client.rest.guilds.editOnboarding(this.id, options);
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Edit an existing role.
|
|
892
|
+
* @param options The options for editing the role.
|
|
893
|
+
*/
|
|
894
|
+
async editRole(roleID, options) {
|
|
895
|
+
return this.client.rest.guilds.editRole(this.id, roleID, options);
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Edit the position of roles in this guild.
|
|
899
|
+
* @param options The roles to move.
|
|
900
|
+
*/
|
|
901
|
+
async editRolePositions(options, reason) {
|
|
902
|
+
return this.client.rest.guilds.editRolePositions(this.id, options, reason);
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Edit an existing scheduled event in this guild.
|
|
906
|
+
* @param scheduledEventID The ID of the scheduled event.
|
|
907
|
+
* @param options The options for editing the scheduled event.
|
|
908
|
+
*/
|
|
909
|
+
async editScheduledEvent(scheduledEventID, options) {
|
|
910
|
+
return this.client.rest.guilds.editScheduledEvent(this.id, scheduledEventID, options);
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* Edit a soundboard sound.
|
|
914
|
+
* @param soundID The ID of the soundboard sound.
|
|
915
|
+
* @param options The options for editing the soundboard sound.
|
|
916
|
+
*/
|
|
917
|
+
async editSoundboardSound(soundID, options) {
|
|
918
|
+
return this.client.rest.guilds.editSoundboardSound(this.id, soundID, options);
|
|
919
|
+
}
|
|
920
|
+
/**
|
|
921
|
+
* Edit a sticker.
|
|
922
|
+
* @param options The options for editing the sticker.
|
|
923
|
+
*/
|
|
924
|
+
async editSticker(stickerID, options) {
|
|
925
|
+
return this.client.rest.guilds.editSticker(this.id, stickerID, options);
|
|
926
|
+
}
|
|
927
|
+
/**
|
|
928
|
+
* Edit a template.
|
|
929
|
+
* @param code The code of the template.
|
|
930
|
+
* @param options The options for editing the template.
|
|
931
|
+
*/
|
|
932
|
+
async editTemplate(code, options) {
|
|
933
|
+
return this.client.rest.guilds.editTemplate(this.id, code, options);
|
|
934
|
+
}
|
|
935
|
+
/**
|
|
936
|
+
* Edit a guild member's voice state. `channelID` is required, and the user must already be in that channel. See [Discord's docs](https://discord.com/developers/docs/resources/guild#modify-user-voice-state) for more information.
|
|
937
|
+
* @param memberID The ID of the member.
|
|
938
|
+
* @param options The options for editing the voice state.
|
|
939
|
+
*/
|
|
940
|
+
async editUserVoiceState(memberID, options) {
|
|
941
|
+
return this.client.rest.guilds.editUserVoiceState(this.id, memberID, options);
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Edit the welcome screen in this guild.
|
|
945
|
+
* @param options The options for editing the welcome screen.
|
|
946
|
+
*/
|
|
947
|
+
async editWelcomeScreen(options) {
|
|
948
|
+
return this.client.rest.guilds.editWelcomeScreen(this.id, options);
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Edit the widget of this guild.
|
|
952
|
+
* @param options The options for editing the widget.
|
|
953
|
+
*/
|
|
954
|
+
async editWidget(options) {
|
|
955
|
+
return this.client.rest.guilds.editWidget(this.id, options);
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Enable the `COMMUNITY` feature for this guild. Requires the **Administrator** permission.
|
|
959
|
+
* @param reason The reason for enabling the feature.
|
|
960
|
+
*/
|
|
961
|
+
async enableCommunity(reason) {
|
|
962
|
+
return this.toggleFeature("COMMUNITY", true, reason);
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Enable the `DISCOVERABLE` feature for this guild. Requires the **Administrator** permission. The server must also be passing all discovery requirements.
|
|
966
|
+
* @param reason The reason for enabling the feature.
|
|
967
|
+
*/
|
|
968
|
+
async enableDiscovery(reason) {
|
|
969
|
+
return this.toggleFeature("DISCOVERABLE", true, reason);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Enable the `INVITES_DISABLED` feature for this guild. Requires the **Manage Guild** permission.
|
|
973
|
+
* @param reason The reason for enabling the feature.
|
|
974
|
+
*/
|
|
975
|
+
async enableInvites(reason) {
|
|
976
|
+
return this.toggleFeature("INVITES_DISABLED", true, reason);
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* Enable the `RAID_ALERTS_ENABLED` feature for this guild. Requires the **Manage Guild** permission.
|
|
980
|
+
* @param reason The reason for enabling the feature.
|
|
981
|
+
*/
|
|
982
|
+
async enableRaidAlerts(reason) {
|
|
983
|
+
return this.toggleFeature("RAID_ALERTS_ENABLED", true, reason);
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Request members from this guild.
|
|
987
|
+
* @param options The options for fetching the members.
|
|
988
|
+
*/
|
|
989
|
+
async fetchMembers(options) {
|
|
990
|
+
return this.shard.requestGuildMembers(this.id, options);
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* Get the active threads in this guild.
|
|
994
|
+
*/
|
|
995
|
+
async getActiveThreads() {
|
|
996
|
+
return this.client.rest.guilds.getActiveThreads(this.id);
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Get this guild's audit log.
|
|
1000
|
+
* @param options The options for the audit log.
|
|
1001
|
+
*/
|
|
1002
|
+
async getAuditLog(options) {
|
|
1003
|
+
return this.client.rest.guilds.getAuditLog(this.id, options);
|
|
1004
|
+
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Get an auto moderation rule for this guild.
|
|
1007
|
+
* @param ruleID The ID of the rule to get.
|
|
1008
|
+
*/
|
|
1009
|
+
async getAutoModerationRule(ruleID) {
|
|
1010
|
+
return this.client.rest.guilds.getAutoModerationRule(this.id, ruleID);
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Get the auto moderation rules for this guild.
|
|
1014
|
+
*/
|
|
1015
|
+
async getAutoModerationRules() {
|
|
1016
|
+
return this.client.rest.guilds.getAutoModerationRules(this.id);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Get a ban in this guild.
|
|
1020
|
+
* @param userID The ID of the user to get the ban of.
|
|
1021
|
+
*/
|
|
1022
|
+
async getBan(userID) {
|
|
1023
|
+
return this.client.rest.guilds.getBan(this.id, userID);
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Get the bans in this guild.
|
|
1027
|
+
* @param options The options for getting the bans.
|
|
1028
|
+
*/
|
|
1029
|
+
async getBans(options) {
|
|
1030
|
+
return this.client.rest.guilds.getBans(this.id, options);
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Get the channels in a guild. Does not include threads. Only use this if you need to. See the `channels` collection.
|
|
1034
|
+
*/
|
|
1035
|
+
async getChannels() {
|
|
1036
|
+
return this.client.rest.guilds.getChannels(this.id);
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* Get an emoji in this guild.
|
|
1040
|
+
* @param emojiID The ID of the emoji to get.
|
|
1041
|
+
*/
|
|
1042
|
+
async getEmoji(emojiID) {
|
|
1043
|
+
return this.client.rest.guilds.getEmoji(this.id, emojiID);
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Get the emojis in this guild.
|
|
1047
|
+
*/
|
|
1048
|
+
async getEmojis() {
|
|
1049
|
+
return this.client.rest.guilds.getEmojis(this.id);
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* Get the entitlements for this guild.
|
|
1053
|
+
* @param options The options for getting the entitlements.
|
|
1054
|
+
* @param applicationID The ID of the application to create the entitlement for. If present, defaults to the logged in client's application id.
|
|
1055
|
+
*/
|
|
1056
|
+
async getEntitlements(options, applicationID) {
|
|
1057
|
+
if (applicationID === undefined && this.client["_application"] === undefined) {
|
|
1058
|
+
throw new Errors_1.UncachedError("Client#application is not present, you must provide an applicationID as a second argument. To not need to provide an ID, only call this after at least one shard is READY, or restMode is enabled.");
|
|
1059
|
+
}
|
|
1060
|
+
return this.client.rest.applications.getEntitlements(applicationID ?? this.client.application.id, { guildID: this.id, ...options });
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Get the integrations in this guild.
|
|
1064
|
+
*/
|
|
1065
|
+
async getIntegrations() {
|
|
1066
|
+
return this.client.rest.guilds.getIntegrations(this.id);
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Get the invites of this guild.
|
|
1070
|
+
*/
|
|
1071
|
+
async getInvites() {
|
|
1072
|
+
return this.client.rest.guilds.getInvites(this.id);
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Get a member of this guild.
|
|
1076
|
+
* @param memberID The ID of the member.
|
|
1077
|
+
*/
|
|
1078
|
+
async getMember(memberID) {
|
|
1079
|
+
return this.client.rest.guilds.getMember(this.id, memberID);
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Get this guild's members. This requires the `GUILD_MEMBERS` intent.
|
|
1083
|
+
* @param options The options for getting the members.
|
|
1084
|
+
*/
|
|
1085
|
+
async getMembers(options) {
|
|
1086
|
+
return this.client.rest.guilds.getMembers(this.id, options);
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Get the onboarding information for this guild.
|
|
1090
|
+
*/
|
|
1091
|
+
async getOnboarding() {
|
|
1092
|
+
return this.client.rest.guilds.getOnboarding(this.id);
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Get a preview of this guild.
|
|
1096
|
+
*/
|
|
1097
|
+
async getPreview() {
|
|
1098
|
+
return this.client.rest.guilds.getPreview(this.id);
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Get the prune count of this guild.
|
|
1102
|
+
* @param options The options for getting the prune count.
|
|
1103
|
+
*/
|
|
1104
|
+
async getPruneCount(options) {
|
|
1105
|
+
return this.client.rest.guilds.getPruneCount(this.id, options);
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Get a role in this guild. Only use this if you need to. See the `roles` collection.
|
|
1109
|
+
* @param roleID The ID of the role to get.
|
|
1110
|
+
*/
|
|
1111
|
+
async getRole(roleID) {
|
|
1112
|
+
return this.client.rest.guilds.getRole(this.id, roleID);
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Get the member count of the roles in this guild. The result is a key-value map of role id to member count.
|
|
1116
|
+
*/
|
|
1117
|
+
async getRoleMemberCounts() {
|
|
1118
|
+
return this.client.rest.guilds.getRoleMemberCounts(this.id);
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* Get the roles in this guild. Only use this if you need to. See the `roles` collection.
|
|
1122
|
+
*/
|
|
1123
|
+
async getRoles() {
|
|
1124
|
+
return this.client.rest.guilds.getRoles(this.id);
|
|
1125
|
+
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Get a scheduled event.
|
|
1128
|
+
* @param eventID The ID of the scheduled event to get.
|
|
1129
|
+
* @param withUserCount If the number of users subscribed to the event should be included.
|
|
1130
|
+
*/
|
|
1131
|
+
async getScheduledEvent(eventID, withUserCount) {
|
|
1132
|
+
return this.client.rest.guilds.getScheduledEvent(this.id, eventID, withUserCount);
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Get the users subscribed to a scheduled event.
|
|
1136
|
+
* @param eventID The ID of the scheduled event to get the users of.
|
|
1137
|
+
* @param options The options for getting the users.
|
|
1138
|
+
*/
|
|
1139
|
+
async getScheduledEventUsers(eventID, options) {
|
|
1140
|
+
return this.client.rest.guilds.getScheduledEventUsers(this.id, eventID, options);
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Get this guild's scheduled events
|
|
1144
|
+
* @param withUserCount If the number of users subscribed to the event should be included.
|
|
1145
|
+
*/
|
|
1146
|
+
async getScheduledEvents(withUserCount) {
|
|
1147
|
+
return this.client.rest.guilds.getScheduledEvents(this.id, withUserCount);
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Get a soundboard sound.
|
|
1151
|
+
* @param soundID The ID of the soundboard sound to get.
|
|
1152
|
+
*/
|
|
1153
|
+
async getSoundboardSound(soundID) {
|
|
1154
|
+
return this.client.rest.guilds.getSoundboardSound(this.id, soundID);
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* Get this guild's soundboard sounds.
|
|
1158
|
+
*/
|
|
1159
|
+
async getSoundboardSounds() {
|
|
1160
|
+
return this.client.rest.guilds.getSoundboardSounds(this.id);
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* Get a sticker. Response will include a user if the client has the `MANAGE_EMOJIS_AND_STICKERS` permissions.
|
|
1164
|
+
* @param stickerID The ID of the sticker to get.
|
|
1165
|
+
*/
|
|
1166
|
+
async getSticker(stickerID) {
|
|
1167
|
+
return this.client.rest.guilds.getSticker(this.id, stickerID);
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Get this guild's stickers. Stickers will include a user if the client has the `MANAGE_EMOJIS_AND_STICKERS` permissions.
|
|
1171
|
+
*/
|
|
1172
|
+
async getStickers() {
|
|
1173
|
+
return this.client.rest.guilds.getStickers(this.id);
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* Get this guild's templates.
|
|
1177
|
+
*/
|
|
1178
|
+
async getTemplates() {
|
|
1179
|
+
return this.client.rest.guilds.getTemplates(this.id);
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Get the vanity url of this guild.
|
|
1183
|
+
*/
|
|
1184
|
+
async getVanityURL() {
|
|
1185
|
+
return this.client.rest.guilds.getVanityURL(this.id);
|
|
1186
|
+
}
|
|
1187
|
+
/**
|
|
1188
|
+
* Get the list of usable voice regions for this guild. This will return VIP servers when the guild is VIP-enabled.
|
|
1189
|
+
*/
|
|
1190
|
+
async getVoiceRegions() {
|
|
1191
|
+
return this.client.rest.guilds.getVoiceRegions(this.id);
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Get the voice state of a member.
|
|
1195
|
+
* @param memberID The ID of the member. Use `@me` for the bot user.
|
|
1196
|
+
*/
|
|
1197
|
+
async getVoiceState(memberID) {
|
|
1198
|
+
return this.client.rest.guilds.getVoiceState(this.id, memberID);
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Get the webhooks in this guild.
|
|
1202
|
+
*/
|
|
1203
|
+
async getWebhooks() {
|
|
1204
|
+
return this.client.rest.webhooks.getForGuild(this.id);
|
|
1205
|
+
}
|
|
1206
|
+
/**
|
|
1207
|
+
* Get the welcome screen for this guild.
|
|
1208
|
+
*/
|
|
1209
|
+
async getWelcomeScreen() {
|
|
1210
|
+
return this.client.rest.guilds.getWelcomeScreen(this.id);
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Get the widget of this guild.
|
|
1214
|
+
*/
|
|
1215
|
+
async getWidget() {
|
|
1216
|
+
return this.client.rest.guilds.getWidget(this.id);
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Get the widget image of this guild.
|
|
1220
|
+
* @param style The style of the image.
|
|
1221
|
+
*/
|
|
1222
|
+
async getWidgetImage(style) {
|
|
1223
|
+
return this.client.rest.guilds.getWidgetImage(this.id, style);
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Get the raw JSON widget of this guild.
|
|
1227
|
+
*/
|
|
1228
|
+
async getWidgetJSON() {
|
|
1229
|
+
return this.client.rest.guilds.getWidgetJSON(this.id);
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Get this guild's widget settings.
|
|
1233
|
+
*/
|
|
1234
|
+
async getWidgetSettings() {
|
|
1235
|
+
return this.client.rest.guilds.getWidgetSettings(this.id);
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* The url of this guild's icon.
|
|
1239
|
+
* @param format The format the url should be.
|
|
1240
|
+
* @param size The dimensions of the image.
|
|
1241
|
+
*/
|
|
1242
|
+
iconURL(format, size) {
|
|
1243
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.GUILD_ICON(this.id, this.icon), format, size);
|
|
1244
|
+
}
|
|
1245
|
+
/**
|
|
1246
|
+
* Join a voice or stage channel.
|
|
1247
|
+
* @param options The options to join the channel with.
|
|
1248
|
+
*/
|
|
1249
|
+
joinChannel(options) {
|
|
1250
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument
|
|
1251
|
+
return this.client.joinVoiceChannel({
|
|
1252
|
+
...options,
|
|
1253
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
1254
|
+
voiceAdapterCreator: this.voiceAdapterCreator,
|
|
1255
|
+
guildID: this.id
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* Leave this guild.
|
|
1260
|
+
*/
|
|
1261
|
+
async leave() {
|
|
1262
|
+
return this.client.rest.users.leaveGuild(this.id);
|
|
1263
|
+
}
|
|
1264
|
+
/** Leave the connected voice or stage channel on this guild. */
|
|
1265
|
+
leaveChannel() {
|
|
1266
|
+
return this.client.leaveVoiceChannel(this.id);
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* Search this guild's members.
|
|
1270
|
+
* @param options The options to search with.
|
|
1271
|
+
* @param retryOnIndexNotAvailable If the search should be retried if Discord replies with an index unavailable response. This will retry at most one time, waiting for `retry_after` or 15-45 seconds.
|
|
1272
|
+
*/
|
|
1273
|
+
async memberSearch(options, retryOnIndexNotAvailable = true) {
|
|
1274
|
+
return this.client.rest.guilds.memberSearch(this.id, options, retryOnIndexNotAvailable);
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Get the permissions of a member. If providing an id, the member must be cached.
|
|
1278
|
+
* @param member The member to get the permissions of.
|
|
1279
|
+
*/
|
|
1280
|
+
permissionsOf(member) {
|
|
1281
|
+
if (typeof member === "string") {
|
|
1282
|
+
member = this.members.get(member);
|
|
1283
|
+
}
|
|
1284
|
+
if (!member) {
|
|
1285
|
+
throw new Errors_1.UncachedError(`Cannot use ${this.constructor.name}#permissionsOf with an ID when the member is not cached.`);
|
|
1286
|
+
}
|
|
1287
|
+
if (member.id === this.ownerID) {
|
|
1288
|
+
return new Permission_1.default(Constants_1.AllPermissions);
|
|
1289
|
+
}
|
|
1290
|
+
else {
|
|
1291
|
+
let permissions = this.roles.get(this.id).permissions.allow;
|
|
1292
|
+
if (permissions & Constants_1.Permissions.ADMINISTRATOR) {
|
|
1293
|
+
return new Permission_1.default(Constants_1.AllPermissions);
|
|
1294
|
+
}
|
|
1295
|
+
for (const id of member.roles) {
|
|
1296
|
+
const role = this.roles.get(id);
|
|
1297
|
+
if (!role) {
|
|
1298
|
+
continue;
|
|
1299
|
+
}
|
|
1300
|
+
if (role.permissions.allow & Constants_1.Permissions.ADMINISTRATOR) {
|
|
1301
|
+
permissions = Constants_1.AllPermissions;
|
|
1302
|
+
break;
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
permissions |= role.permissions.allow;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
return new Permission_1.default(permissions);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
/**
|
|
1312
|
+
* Remove a ban.
|
|
1313
|
+
* @param userID The ID of the user to remove the ban from.
|
|
1314
|
+
* @param reason The reason for removing the ban.
|
|
1315
|
+
*/
|
|
1316
|
+
async removeBan(userID, reason) {
|
|
1317
|
+
return this.client.rest.guilds.removeBan(this.id, userID, reason);
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Remove a member from this guild.
|
|
1321
|
+
* @param memberID The ID of the user to remove.
|
|
1322
|
+
* @param reason The reason for the removal.
|
|
1323
|
+
*/
|
|
1324
|
+
async removeMember(memberID, reason) {
|
|
1325
|
+
return this.client.rest.guilds.removeMember(this.id, memberID, reason);
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Remove a role from a member.
|
|
1329
|
+
* @param memberID The ID of the member.
|
|
1330
|
+
* @param roleID The ID of the role to remove.
|
|
1331
|
+
* @param reason The reason for removing the role.
|
|
1332
|
+
*/
|
|
1333
|
+
async removeMemberRole(memberID, roleID, reason) {
|
|
1334
|
+
return this.client.rest.guilds.removeMemberRole(this.id, memberID, roleID, reason);
|
|
1335
|
+
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Search the username & nicknames of members in this guild. See {@link Guild#memberSearch | memberSearch} for a more detailed search.
|
|
1338
|
+
* @param options The options for the search.
|
|
1339
|
+
*/
|
|
1340
|
+
async searchMembers(options) {
|
|
1341
|
+
return this.client.rest.guilds.searchMembers(this.id, options);
|
|
1342
|
+
}
|
|
1343
|
+
/**
|
|
1344
|
+
* The url of this guild's invite splash.
|
|
1345
|
+
* @param format The format the url should be.
|
|
1346
|
+
* @param size The dimensions of the image.
|
|
1347
|
+
*/
|
|
1348
|
+
splashURL(format, size) {
|
|
1349
|
+
return this.splash === null ? null : this.client.util.formatImage(Routes.GUILD_SPLASH(this.id, this.splash), format, size);
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* Sync a guild template.
|
|
1353
|
+
* @param code The code of the template to sync.
|
|
1354
|
+
*/
|
|
1355
|
+
async syncTemplate(code) {
|
|
1356
|
+
return this.client.rest.guilds.syncTemplate(this.id, code);
|
|
1357
|
+
}
|
|
1358
|
+
toJSON() {
|
|
1359
|
+
return {
|
|
1360
|
+
...super.toJSON(),
|
|
1361
|
+
afkChannelID: this.afkChannelID,
|
|
1362
|
+
afkTimeout: this.afkTimeout,
|
|
1363
|
+
application: this.applicationID ?? undefined,
|
|
1364
|
+
approximateMemberCount: this.approximateMemberCount,
|
|
1365
|
+
approximatePresenceCount: this.approximatePresenceCount,
|
|
1366
|
+
autoModerationRules: this.autoModerationRules.map(rule => rule.toJSON()),
|
|
1367
|
+
banner: this.banner,
|
|
1368
|
+
channels: this.channels.map(channel => channel.id),
|
|
1369
|
+
defaultMessageNotifications: this.defaultMessageNotifications,
|
|
1370
|
+
description: this.description,
|
|
1371
|
+
discoverySplash: this.discoverySplash,
|
|
1372
|
+
emojis: this.emojis.toArray(),
|
|
1373
|
+
explicitContentFilter: this.explicitContentFilter,
|
|
1374
|
+
features: this.features,
|
|
1375
|
+
icon: this.icon,
|
|
1376
|
+
incidentActions: this.incidentActions,
|
|
1377
|
+
joinedAt: this.joinedAt?.getTime() ?? null,
|
|
1378
|
+
large: this.large,
|
|
1379
|
+
maxMembers: this.maxMembers,
|
|
1380
|
+
maxPresences: this.maxPresences,
|
|
1381
|
+
maxStageVideoChannelUsers: this.maxStageVideoChannelUsers,
|
|
1382
|
+
maxVideoChannelUsers: this.maxVideoChannelUsers,
|
|
1383
|
+
memberCount: this.memberCount,
|
|
1384
|
+
members: this.members.map(member => member.id),
|
|
1385
|
+
mfaLevel: this.mfaLevel,
|
|
1386
|
+
name: this.name,
|
|
1387
|
+
nsfwLevel: this.nsfwLevel,
|
|
1388
|
+
ownerID: this.ownerID,
|
|
1389
|
+
preferredLocale: this.preferredLocale,
|
|
1390
|
+
premiumProgressBarEnabled: this.premiumProgressBarEnabled,
|
|
1391
|
+
premiumSubscriptionCount: this.premiumSubscriptionCount,
|
|
1392
|
+
premiumTier: this.premiumTier,
|
|
1393
|
+
profile: this.profile,
|
|
1394
|
+
publicUpdatesChannelID: this.publicUpdatesChannelID,
|
|
1395
|
+
region: this.region,
|
|
1396
|
+
roles: this.roles.map(role => role.toJSON()),
|
|
1397
|
+
rulesChannelID: this.rulesChannelID,
|
|
1398
|
+
scheduledEvents: this.scheduledEvents.map(event => event.toJSON()),
|
|
1399
|
+
splash: this.splash,
|
|
1400
|
+
stageInstances: this.stageInstances.map(instance => instance.toJSON()),
|
|
1401
|
+
stickers: this.stickers.toArray(),
|
|
1402
|
+
systemChannelID: this.systemChannelID,
|
|
1403
|
+
systemChannelFlags: this.systemChannelFlags,
|
|
1404
|
+
threads: this.threads.map(thread => thread.id),
|
|
1405
|
+
unavailable: this.unavailable,
|
|
1406
|
+
vanityURLCode: this.vanityURLCode,
|
|
1407
|
+
verificationLevel: this.verificationLevel,
|
|
1408
|
+
voiceStates: this.voiceStates.map(state => state.toJSON()),
|
|
1409
|
+
welcomeScreen: this.welcomeScreen,
|
|
1410
|
+
widgetChannelID: this.widgetChannelID,
|
|
1411
|
+
widgetEnabled: this.widgetEnabled
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
}
|
|
1415
|
+
exports.default = Guild;
|