@deffa5556/bail 1.0.6 → 1.0.7
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/cjs/WAProto/index.cjs +106053 -0
- package/cjs/deffa/config.cjs +14 -0
- package/cjs/deffa/plugins/ai/deepseekr1.cjs +35 -0
- package/cjs/deffa/plugins/ai/gita.cjs +26 -0
- package/cjs/deffa/plugins/ai/glm47flash.cjs +35 -0
- package/cjs/deffa/plugins/ai/gptoss120b.cjs +35 -0
- package/cjs/deffa/plugins/ai/qwq32b.cjs +35 -0
- package/cjs/deffa/plugins/berita/antara.cjs +25 -0
- package/cjs/deffa/plugins/berita/cnbcindonesia.cjs +25 -0
- package/cjs/deffa/plugins/berita/cnn.cjs +25 -0
- package/cjs/deffa/plugins/berita/kompas.cjs +25 -0
- package/cjs/deffa/plugins/berita/liputan6.cjs +25 -0
- package/cjs/deffa/plugins/berita/merdeka.cjs +25 -0
- package/cjs/deffa/plugins/berita/sindonews.cjs +25 -0
- package/cjs/deffa/plugins/berita/tribunnews.cjs +25 -0
- package/cjs/deffa/plugins/downloader/douyin.cjs +30 -0
- package/cjs/deffa/plugins/downloader/facebook.cjs +30 -0
- package/cjs/deffa/plugins/downloader/github.cjs +35 -0
- package/cjs/deffa/plugins/downloader/lahelu.cjs +30 -0
- package/cjs/deffa/plugins/downloader/snackvideo.cjs +30 -0
- package/cjs/deffa/plugins/downloader/soundcloud.cjs +30 -0
- package/cjs/deffa/plugins/downloader/tiktok.cjs +30 -0
- package/cjs/deffa/plugins/downloader/tiktokhd.cjs +30 -0
- package/cjs/deffa/plugins/downloader/twitter.cjs +30 -0
- package/cjs/deffa/plugins/downloader/ummy.cjs +36 -0
- package/cjs/deffa/plugins/index.cjs +213 -0
- package/cjs/deffa/plugins/info/bmkg.cjs +34 -0
- package/cjs/deffa/plugins/info/cuaca.cjs +31 -0
- package/cjs/deffa/plugins/info/jadwaltv.cjs +29 -0
- package/cjs/deffa/plugins/maker/brat.cjs +45 -0
- package/cjs/deffa/plugins/maker/bratvid.cjs +52 -0
- package/cjs/deffa/plugins/search/8font.cjs +28 -0
- package/cjs/deffa/plugins/search/applemusic.cjs +28 -0
- package/cjs/deffa/plugins/search/bimg.cjs +30 -0
- package/cjs/deffa/plugins/search/brave.cjs +34 -0
- package/cjs/deffa/plugins/search/duckduckgo.cjs +28 -0
- package/cjs/deffa/plugins/search/lahelu.cjs +28 -0
- package/cjs/deffa/plugins/search/mangatoon.cjs +28 -0
- package/cjs/deffa/plugins/search/mcpedl.cjs +28 -0
- package/cjs/deffa/plugins/search/myinstants.cjs +28 -0
- package/cjs/deffa/plugins/search/otakotaku.cjs +28 -0
- package/cjs/deffa/plugins/search/pinterest.cjs +30 -0
- package/cjs/deffa/plugins/search/resep.cjs +28 -0
- package/cjs/deffa/plugins/search/seegore.cjs +30 -0
- package/cjs/deffa/plugins/search/soundcloud.cjs +28 -0
- package/cjs/deffa/plugins/search/youtube.cjs +28 -0
- package/cjs/deffa/plugins/stalk/github.cjs +38 -0
- package/cjs/deffa/plugins/stalk/pinterest.cjs +37 -0
- package/cjs/deffa/plugins/stalk/threads.cjs +34 -0
- package/cjs/deffa/plugins/stalk/tiktok.cjs +37 -0
- package/cjs/deffa/plugins/stalk/twitter.cjs +37 -0
- package/cjs/deffa/plugins/stalk/youtube.cjs +37 -0
- package/cjs/lib/Defaults/index.cjs +158 -0
- package/cjs/lib/Discord/Client.cjs +263 -0
- package/cjs/lib/Discord/Constants.cjs +1842 -0
- package/cjs/lib/Discord/connect-dc.cjs +11 -0
- package/cjs/lib/Discord/esm-bridge.cjs +136 -0
- package/cjs/lib/Discord/gateway/Dispatcher.cjs +93 -0
- package/cjs/lib/Discord/gateway/Shard.cjs +695 -0
- package/cjs/lib/Discord/gateway/ShardManager.cjs +344 -0
- package/cjs/lib/Discord/gateway/compression/base.cjs +13 -0
- package/cjs/lib/Discord/gateway/compression/config.cjs +47 -0
- package/cjs/lib/Discord/gateway/compression/pako.cjs +44 -0
- package/cjs/lib/Discord/gateway/compression/zlib-native.cjs +47 -0
- package/cjs/lib/Discord/gateway/compression/zlib-sync.cjs +31 -0
- package/cjs/lib/Discord/gateway/compression/zstd-napi.cjs +80 -0
- package/cjs/lib/Discord/gateway/compression/zstd-native.cjs +46 -0
- package/cjs/lib/Discord/gateway/events.cjs +956 -0
- package/cjs/lib/Discord/index.cjs +238 -0
- package/cjs/lib/Discord/rest/Bucket.cjs +69 -0
- package/cjs/lib/Discord/rest/DiscordHTTPError.cjs +63 -0
- package/cjs/lib/Discord/rest/DiscordRESTError.cjs +84 -0
- package/cjs/lib/Discord/rest/OAuthHelper.cjs +226 -0
- package/cjs/lib/Discord/rest/RESTManager.cjs +116 -0
- package/cjs/lib/Discord/rest/RequestHandler.cjs +320 -0
- package/cjs/lib/Discord/rest/SequentialBucket.cjs +69 -0
- package/cjs/lib/Discord/routes/Applications.cjs +625 -0
- package/cjs/lib/Discord/routes/Channels.cjs +1199 -0
- package/cjs/lib/Discord/routes/Guilds.cjs +1792 -0
- package/cjs/lib/Discord/routes/Interactions.cjs +212 -0
- package/cjs/lib/Discord/routes/Lobbies.cjs +197 -0
- package/cjs/lib/Discord/routes/Miscellaneous.cjs +120 -0
- package/cjs/lib/Discord/routes/OAuth.cjs +350 -0
- package/cjs/lib/Discord/routes/Users.cjs +107 -0
- package/cjs/lib/Discord/routes/Webhooks.cjs +308 -0
- package/cjs/lib/Discord/structures/AnnouncementChannel.cjs +46 -0
- package/cjs/lib/Discord/structures/AnnouncementThreadChannel.cjs +28 -0
- package/cjs/lib/Discord/structures/Application.cjs +345 -0
- package/cjs/lib/Discord/structures/ApplicationCommand.cjs +109 -0
- package/cjs/lib/Discord/structures/Attachment.cjs +46 -0
- package/cjs/lib/Discord/structures/AuditLogEntry.cjs +41 -0
- package/cjs/lib/Discord/structures/AutoModerationRule.cjs +117 -0
- package/cjs/lib/Discord/structures/AutocompleteInteraction.cjs +90 -0
- package/cjs/lib/Discord/structures/Base.cjs +56 -0
- package/cjs/lib/Discord/structures/BaseEntitlement.cjs +40 -0
- package/cjs/lib/Discord/structures/CategoryChannel.cjs +102 -0
- package/cjs/lib/Discord/structures/Channel.cjs +89 -0
- package/cjs/lib/Discord/structures/ClientApplication.cjs +269 -0
- package/cjs/lib/Discord/structures/CommandInteraction.cjs +294 -0
- package/cjs/lib/Discord/structures/ComponentInteraction.cjs +306 -0
- package/cjs/lib/Discord/structures/Entitlement.cjs +24 -0
- package/cjs/lib/Discord/structures/ExtendedUser.cjs +48 -0
- package/cjs/lib/Discord/structures/ForumChannel.cjs +20 -0
- package/cjs/lib/Discord/structures/GroupChannel.cjs +160 -0
- package/cjs/lib/Discord/structures/Guild.cjs +1289 -0
- package/cjs/lib/Discord/structures/GuildChannel.cjs +82 -0
- package/cjs/lib/Discord/structures/GuildPreview.cjs +141 -0
- package/cjs/lib/Discord/structures/GuildScheduledEvent.cjs +166 -0
- package/cjs/lib/Discord/structures/GuildTemplate.cjs +96 -0
- package/cjs/lib/Discord/structures/Integration.cjs +123 -0
- package/cjs/lib/Discord/structures/Interaction.cjs +78 -0
- package/cjs/lib/Discord/structures/InteractionResolvedChannel.cjs +36 -0
- package/cjs/lib/Discord/structures/Invite.cjs +196 -0
- package/cjs/lib/Discord/structures/InviteGuild.cjs +117 -0
- package/cjs/lib/Discord/structures/InviteRole.cjs +88 -0
- package/cjs/lib/Discord/structures/Lobby.cjs +84 -0
- package/cjs/lib/Discord/structures/LobbyMember.cjs +30 -0
- package/cjs/lib/Discord/structures/MediaChannel.cjs +20 -0
- package/cjs/lib/Discord/structures/Member.cjs +300 -0
- package/cjs/lib/Discord/structures/Message.cjs +553 -0
- package/cjs/lib/Discord/structures/ModalSubmitInteraction.cjs +263 -0
- package/cjs/lib/Discord/structures/OAuthApplication.cjs +203 -0
- package/cjs/lib/Discord/structures/OAuthGuild.cjs +98 -0
- package/cjs/lib/Discord/structures/PartialApplication.cjs +97 -0
- package/cjs/lib/Discord/structures/Permission.cjs +61 -0
- package/cjs/lib/Discord/structures/PermissionOverwrite.cjs +46 -0
- package/cjs/lib/Discord/structures/PingInteraction.cjs +27 -0
- package/cjs/lib/Discord/structures/Poll.cjs +69 -0
- package/cjs/lib/Discord/structures/PrimaryGuild.cjs +93 -0
- package/cjs/lib/Discord/structures/PrivateChannel.cjs +131 -0
- package/cjs/lib/Discord/structures/PrivateThreadChannel.cjs +28 -0
- package/cjs/lib/Discord/structures/PublicThreadChannel.cjs +36 -0
- package/cjs/lib/Discord/structures/Role.cjs +126 -0
- package/cjs/lib/Discord/structures/SKU.cjs +58 -0
- package/cjs/lib/Discord/structures/Soundboard.cjs +58 -0
- package/cjs/lib/Discord/structures/StageChannel.cjs +45 -0
- package/cjs/lib/Discord/structures/StageInstance.cjs +80 -0
- package/cjs/lib/Discord/structures/Subscription.cjs +21 -0
- package/cjs/lib/Discord/structures/Team.cjs +70 -0
- package/cjs/lib/Discord/structures/TestEntitlement.cjs +22 -0
- package/cjs/lib/Discord/structures/TextChannel.cjs +48 -0
- package/cjs/lib/Discord/structures/TextableChannel.cjs +265 -0
- package/cjs/lib/Discord/structures/TextableVoiceChannel.cjs +70 -0
- package/cjs/lib/Discord/structures/ThreadChannel.cjs +276 -0
- package/cjs/lib/Discord/structures/ThreadOnlyChannel.cjs +205 -0
- package/cjs/lib/Discord/structures/ThreadableChannel.cjs +57 -0
- package/cjs/lib/Discord/structures/UnavailableGuild.cjs +21 -0
- package/cjs/lib/Discord/structures/User.cjs +223 -0
- package/cjs/lib/Discord/structures/VoiceChannel.cjs +34 -0
- package/cjs/lib/Discord/structures/VoiceState.cjs +113 -0
- package/cjs/lib/Discord/structures/Webhook.cjs +224 -0
- package/cjs/lib/Discord/util/Collection.cjs +77 -0
- package/cjs/lib/Discord/util/Errors.cjs +81 -0
- package/cjs/lib/Discord/util/QueryBuilder.cjs +20 -0
- package/cjs/lib/Discord/util/Routes.cjs +293 -0
- package/cjs/lib/Discord/util/SimpleCollection.cjs +78 -0
- package/cjs/lib/Discord/util/Time.cjs +92 -0
- package/cjs/lib/Discord/util/TypedCollection.cjs +78 -0
- package/cjs/lib/Discord/util/TypedEmitter.cjs +20 -0
- package/cjs/lib/Discord/util/Util.cjs +906 -0
- package/cjs/lib/Discord/util/interactions/InteractionOptionsWrapper.cjs +207 -0
- package/cjs/lib/Discord/util/interactions/MessageInteractionResponse.cjs +26 -0
- package/cjs/lib/Discord/util/interactions/ModalSubmitInteractionComponentsWrapper.cjs +98 -0
- package/cjs/lib/Discord/util/interactions/SelectMenuValuesWrapper.cjs +77 -0
- package/cjs/lib/Discord/util/interactions/shared.cjs +20 -0
- package/cjs/lib/Discord/util/warning.cjs +34 -0
- package/cjs/lib/Signal/Group/ciphertext-message.cjs +16 -0
- package/cjs/lib/Signal/Group/group-session-builder.cjs +67 -0
- package/cjs/lib/Signal/Group/group_cipher.cjs +86 -0
- package/cjs/lib/Signal/Group/index.cjs +58 -0
- package/cjs/lib/Signal/Group/keyhelper.cjs +56 -0
- package/cjs/lib/Signal/Group/sender-chain-key.cjs +30 -0
- package/cjs/lib/Signal/Group/sender-key-distribution-message.cjs +67 -0
- package/cjs/lib/Signal/Group/sender-key-message.cjs +70 -0
- package/cjs/lib/Signal/Group/sender-key-name.cjs +52 -0
- package/cjs/lib/Signal/Group/sender-key-record.cjs +45 -0
- package/cjs/lib/Signal/Group/sender-key-state.cjs +88 -0
- package/cjs/lib/Signal/Group/sender-message-key.cjs +30 -0
- package/cjs/lib/Signal/libsignal.cjs +467 -0
- package/cjs/lib/Signal/lid-mapping.cjs +281 -0
- package/cjs/lib/Socket/Client/index.cjs +19 -0
- package/cjs/lib/Socket/Client/types.cjs +15 -0
- package/cjs/lib/Socket/Client/websocket.cjs +61 -0
- package/cjs/lib/Socket/business.cjs +384 -0
- package/cjs/lib/Socket/chats.cjs +1221 -0
- package/cjs/lib/Socket/communities.cjs +440 -0
- package/cjs/lib/Socket/groups.cjs +353 -0
- package/cjs/lib/Socket/index.cjs +14 -0
- package/cjs/lib/Socket/messages-recv.cjs +1772 -0
- package/cjs/lib/Socket/messages-send.cjs +1376 -0
- package/cjs/lib/Socket/mex.cjs +46 -0
- package/cjs/lib/Socket/newsletter.cjs +230 -0
- package/cjs/lib/Socket/socket.cjs +976 -0
- package/cjs/lib/Store/index.cjs +20 -0
- package/cjs/lib/Store/make-in-memory-store.cjs +470 -0
- package/cjs/lib/Store/make-ordered-dictionary.cjs +82 -0
- package/cjs/lib/Store/object-repository.cjs +28 -0
- package/cjs/lib/Telegram/button.cjs +147 -0
- package/cjs/lib/Telegram/composer.cjs +582 -0
- package/cjs/lib/Telegram/context.cjs +853 -0
- package/cjs/lib/Telegram/core/helpers/args.cjs +57 -0
- package/cjs/lib/Telegram/core/helpers/check.cjs +55 -0
- package/cjs/lib/Telegram/core/helpers/compact.cjs +16 -0
- package/cjs/lib/Telegram/core/helpers/deunionize.cjs +12 -0
- package/cjs/lib/Telegram/core/helpers/formatting.cjs +91 -0
- package/cjs/lib/Telegram/core/helpers/util.cjs +50 -0
- package/cjs/lib/Telegram/core/network/client.cjs +338 -0
- package/cjs/lib/Telegram/core/network/error.cjs +21 -0
- package/cjs/lib/Telegram/core/network/multipart-stream.cjs +79 -0
- package/cjs/lib/Telegram/core/network/polling.cjs +87 -0
- package/cjs/lib/Telegram/core/network/webhook.cjs +54 -0
- package/cjs/lib/Telegram/core/types/typegram.cjs +31 -0
- package/cjs/lib/Telegram/deffa-telegraf.cjs +264 -0
- package/cjs/lib/Telegram/esm-bridge.cjs +20 -0
- package/cjs/lib/Telegram/filters.cjs +69 -0
- package/cjs/lib/Telegram/format.cjs +58 -0
- package/cjs/lib/Telegram/future.cjs +140 -0
- package/cjs/lib/Telegram/index.cjs +67 -0
- package/cjs/lib/Telegram/input.cjs +61 -0
- package/cjs/lib/Telegram/markup.cjs +129 -0
- package/cjs/lib/Telegram/middleware.cjs +2 -0
- package/cjs/lib/Telegram/reactions.cjs +84 -0
- package/cjs/lib/Telegram/router.cjs +46 -0
- package/cjs/lib/Telegram/scenes/base.cjs +39 -0
- package/cjs/lib/Telegram/scenes/context.cjs +104 -0
- package/cjs/lib/Telegram/scenes/index.cjs +21 -0
- package/cjs/lib/Telegram/scenes/stage.cjs +49 -0
- package/cjs/lib/Telegram/scenes/wizard/context.cjs +31 -0
- package/cjs/lib/Telegram/scenes/wizard/index.cjs +45 -0
- package/cjs/lib/Telegram/scenes.cjs +21 -0
- package/cjs/lib/Telegram/session.cjs +166 -0
- package/cjs/lib/Telegram/telegram-types.cjs +6 -0
- package/cjs/lib/Telegram/telegram.cjs +945 -0
- package/cjs/lib/Telegram/types.cjs +2 -0
- package/cjs/lib/Telegram/utils.cjs +5 -0
- package/cjs/lib/Types/Auth.cjs +3 -0
- package/cjs/lib/Types/Bussines.cjs +3 -0
- package/cjs/lib/Types/Call.cjs +3 -0
- package/cjs/lib/Types/Chat.cjs +11 -0
- package/cjs/lib/Types/Contact.cjs +3 -0
- package/cjs/lib/Types/Events.cjs +4 -0
- package/cjs/lib/Types/GroupMetadata.cjs +3 -0
- package/cjs/lib/Types/Label.cjs +26 -0
- package/cjs/lib/Types/LabelAssociation.cjs +8 -0
- package/cjs/lib/Types/Message.cjs +19 -0
- package/cjs/lib/Types/Mex.cjs +40 -0
- package/cjs/lib/Types/Product.cjs +3 -0
- package/cjs/lib/Types/RichType.cjs +24 -0
- package/cjs/lib/Types/Signal.cjs +4 -0
- package/cjs/lib/Types/Socket.cjs +4 -0
- package/cjs/lib/Types/State.cjs +54 -0
- package/cjs/lib/Types/USync.cjs +4 -0
- package/cjs/lib/Types/index.cjs +42 -0
- package/cjs/lib/Utils/auth-utils.cjs +312 -0
- package/cjs/lib/Utils/browser-utils.cjs +39 -0
- package/cjs/lib/Utils/business.cjs +241 -0
- package/cjs/lib/Utils/chat-utils.cjs +890 -0
- package/cjs/lib/Utils/companion-reg-client-utils.cjs +51 -0
- package/cjs/lib/Utils/crypto.cjs +170 -0
- package/cjs/lib/Utils/decode-wa-message.cjs +330 -0
- package/cjs/lib/Utils/event-buffer.cjs +629 -0
- package/cjs/lib/Utils/generics.cjs +427 -0
- package/cjs/lib/Utils/history.cjs +141 -0
- package/cjs/lib/Utils/identity-change-handler.cjs +56 -0
- package/cjs/lib/Utils/index.cjs +43 -0
- package/cjs/lib/Utils/link-preview.cjs +122 -0
- package/cjs/lib/Utils/logger.cjs +8 -0
- package/cjs/lib/Utils/lt-hash.cjs +11 -0
- package/cjs/lib/Utils/make-mutex.cjs +38 -0
- package/cjs/lib/Utils/message-retry-manager.cjs +267 -0
- package/cjs/lib/Utils/messages-media.cjs +906 -0
- package/cjs/lib/Utils/messages.cjs +1909 -0
- package/cjs/lib/Utils/noise-handler.cjs +205 -0
- package/cjs/lib/Utils/offline-node-processor.cjs +43 -0
- package/cjs/lib/Utils/pre-key-manager.cjs +113 -0
- package/cjs/lib/Utils/process-message.cjs +755 -0
- package/cjs/lib/Utils/reporting-utils.cjs +263 -0
- package/cjs/lib/Utils/rich-message-utils.cjs +434 -0
- package/cjs/lib/Utils/session-guard.cjs +163 -0
- package/cjs/lib/Utils/signal.cjs +214 -0
- package/cjs/lib/Utils/stanza-ack.cjs +41 -0
- package/cjs/lib/Utils/sync-action-utils.cjs +54 -0
- package/cjs/lib/Utils/tc-token-utils.cjs +174 -0
- package/cjs/lib/Utils/text-sticker.cjs +174 -0
- package/cjs/lib/Utils/use-multi-file-auth-state.cjs +125 -0
- package/cjs/lib/Utils/use-single-file-auth-state.cjs +113 -0
- package/cjs/lib/Utils/use-sqlite-auth-state.cjs +145 -0
- package/cjs/lib/Utils/validate-connection.cjs +210 -0
- package/cjs/lib/WABinary/constants.cjs +1470 -0
- package/cjs/lib/WABinary/decode.cjs +301 -0
- package/cjs/lib/WABinary/encode.cjs +257 -0
- package/cjs/lib/WABinary/generic-utils.cjs +240 -0
- package/cjs/lib/WABinary/index.cjs +22 -0
- package/cjs/lib/WABinary/jid-utils.cjs +114 -0
- package/cjs/lib/WABinary/types.cjs +37 -0
- package/cjs/lib/WAM/BinaryInfo.cjs +14 -0
- package/cjs/lib/WAM/constants.cjs +22856 -0
- package/cjs/lib/WAM/encode.cjs +154 -0
- package/cjs/lib/WAM/index.cjs +20 -0
- package/cjs/lib/WAUSync/Protocols/USyncContactProtocol.cjs +56 -0
- package/cjs/lib/WAUSync/Protocols/USyncDeviceProtocol.cjs +58 -0
- package/cjs/lib/WAUSync/Protocols/USyncDisappearingModeProtocol.cjs +31 -0
- package/cjs/lib/WAUSync/Protocols/USyncStatusProtocol.cjs +42 -0
- package/cjs/lib/WAUSync/Protocols/USyncUsernameProtocol.cjs +29 -0
- package/cjs/lib/WAUSync/Protocols/UsyncBotProfileProtocol.cjs +55 -0
- package/cjs/lib/WAUSync/Protocols/UsyncLIDProtocol.cjs +33 -0
- package/cjs/lib/WAUSync/Protocols/index.cjs +22 -0
- package/cjs/lib/WAUSync/USyncQuery.cjs +102 -0
- package/cjs/lib/WAUSync/USyncUser.cjs +35 -0
- package/cjs/lib/WAUSync/index.cjs +20 -0
- package/cjs/lib/index.cjs +372 -0
- package/cjs/lib/plugins/loader.cjs +117 -0
- package/lib/Defaults/index.js +1 -1
- package/package.json +11 -6
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const Permission_1 = __importDefault(require("./Permission"));
|
|
7
|
+
const Channel_1 = __importDefault(require("./Channel"));
|
|
8
|
+
/** Represents a channel from an interaction option. This can be any guild channel, or a direct message. */
|
|
9
|
+
class InteractionResolvedChannel extends Channel_1.default {
|
|
10
|
+
constructor(data, client) {
|
|
11
|
+
super(data, client);
|
|
12
|
+
this.appPermissions = new Permission_1.default(data.permissions ?? "0");
|
|
13
|
+
this.name = data.name;
|
|
14
|
+
this.parentID = data.parent_id ?? null;
|
|
15
|
+
this.threadMetadata = data.thread_metadata ? {
|
|
16
|
+
archiveTimestamp: new Date(data.thread_metadata.archive_timestamp),
|
|
17
|
+
archived: !!data.thread_metadata.archived,
|
|
18
|
+
autoArchiveDuration: data.thread_metadata.auto_archive_duration,
|
|
19
|
+
createTimestamp: data.thread_metadata.create_timestamp ? new Date(data.thread_metadata.create_timestamp) : null,
|
|
20
|
+
locked: !!data.thread_metadata.locked,
|
|
21
|
+
invitable: data.thread_metadata.invitable
|
|
22
|
+
} : null;
|
|
23
|
+
}
|
|
24
|
+
/** The complete channel this channel option represents, if it's cached. */
|
|
25
|
+
get completeChannel() {
|
|
26
|
+
return this._cachedCompleteChannel ?? (this._cachedCompleteChannel = this.client.getChannel(this.id));
|
|
27
|
+
}
|
|
28
|
+
/** The parent of this channel, if this represents a thread. */
|
|
29
|
+
get parent() {
|
|
30
|
+
if (this.parentID !== null && this._cachedParent !== null) {
|
|
31
|
+
return this._cachedParent ?? (this._cachedParent = this.client.getChannel(this.parentID));
|
|
32
|
+
}
|
|
33
|
+
return this._cachedParent === null ? this._cachedParent : (this._cachedParent = null);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = InteractionResolvedChannel;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/** @module Invite */
|
|
7
|
+
const Channel_1 = __importDefault(require("./Channel"));
|
|
8
|
+
const Guild_1 = __importDefault(require("./Guild"));
|
|
9
|
+
const GuildScheduledEvent_1 = __importDefault(require("./GuildScheduledEvent"));
|
|
10
|
+
const PartialApplication_1 = __importDefault(require("./PartialApplication"));
|
|
11
|
+
const InviteGuild_1 = __importDefault(require("./InviteGuild"));
|
|
12
|
+
const InviteRole_1 = __importDefault(require("./InviteRole"));
|
|
13
|
+
const GuildChannel_1 = __importDefault(require("./GuildChannel"));
|
|
14
|
+
const Constants_1 = require("../Constants");
|
|
15
|
+
/** Represents an invite. */
|
|
16
|
+
class Invite {
|
|
17
|
+
constructor(data, client) {
|
|
18
|
+
Object.defineProperty(this, "client", {
|
|
19
|
+
value: client,
|
|
20
|
+
enumerable: false,
|
|
21
|
+
writable: false,
|
|
22
|
+
configurable: false
|
|
23
|
+
});
|
|
24
|
+
this.channelID = (data.channel_id ?? data.channel?.id) ?? null;
|
|
25
|
+
this.code = data.code;
|
|
26
|
+
this.flags = data.flags ?? 0;
|
|
27
|
+
this.guild = null;
|
|
28
|
+
this.guildID = data.guild_id ?? null;
|
|
29
|
+
this.expiresAt = (data.expires_at ? new Date(data.expires_at) : undefined);
|
|
30
|
+
this.targetType = data.target_type;
|
|
31
|
+
this.type = data.type;
|
|
32
|
+
this.update(data);
|
|
33
|
+
}
|
|
34
|
+
static withCounts(data, client) {
|
|
35
|
+
return new Invite(data, client);
|
|
36
|
+
}
|
|
37
|
+
static withCountsAndScheduledEvent(data, client) {
|
|
38
|
+
return new Invite(data, client);
|
|
39
|
+
}
|
|
40
|
+
static withMetadata(data, client) {
|
|
41
|
+
return new Invite(data, client);
|
|
42
|
+
}
|
|
43
|
+
static withScheduledEvent(data, client) {
|
|
44
|
+
return new Invite(data, client);
|
|
45
|
+
}
|
|
46
|
+
update(data) {
|
|
47
|
+
if (data.approximate_member_count !== undefined) {
|
|
48
|
+
this.approximateMemberCount = data.approximate_member_count;
|
|
49
|
+
}
|
|
50
|
+
if (data.approximate_presence_count !== undefined) {
|
|
51
|
+
this.approximatePresenceCount = data.approximate_presence_count;
|
|
52
|
+
}
|
|
53
|
+
if (data.flags !== undefined) {
|
|
54
|
+
this.flags = data.flags;
|
|
55
|
+
}
|
|
56
|
+
if (data.guild) {
|
|
57
|
+
if (this.guild === null) {
|
|
58
|
+
this.guild = new InviteGuild_1.default(data.guild, this.client);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this.guild["update"](data.guild);
|
|
62
|
+
}
|
|
63
|
+
if (this.client.guilds.has(data.guild.id)) {
|
|
64
|
+
this.client.guilds.update(data.guild);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (this.channelID === null) {
|
|
68
|
+
this._cachedChannel = null;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
let channel;
|
|
72
|
+
channel = this.client.getChannel(this.channelID);
|
|
73
|
+
if (data.channel !== undefined) {
|
|
74
|
+
if (channel && channel instanceof Channel_1.default) {
|
|
75
|
+
channel["update"](data.channel);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
channel = data.channel;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
this._cachedChannel = channel;
|
|
82
|
+
}
|
|
83
|
+
if (data.inviter !== undefined) {
|
|
84
|
+
this.inviter = this.client.users.update(data.inviter);
|
|
85
|
+
}
|
|
86
|
+
if (data.roles !== undefined) {
|
|
87
|
+
this.roles = data.roles?.map(role => new InviteRole_1.default(role, this.client, data.guild_id, this.guild));
|
|
88
|
+
}
|
|
89
|
+
if (data.stage_instance !== undefined) {
|
|
90
|
+
this.stageInstance = {
|
|
91
|
+
members: data.stage_instance.members.map(member => this.client.util.updateMember(this.guildID, member.user.id, member)),
|
|
92
|
+
participantCount: data.stage_instance.participant_count,
|
|
93
|
+
speakerCount: data.stage_instance.speaker_count,
|
|
94
|
+
topic: data.stage_instance.topic
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
if (data.target_application !== undefined) {
|
|
98
|
+
this.targetApplication = new PartialApplication_1.default(data.target_application, this.client);
|
|
99
|
+
}
|
|
100
|
+
if (data.guild_scheduled_event !== undefined) {
|
|
101
|
+
this.guildScheduledEvent = this.guild instanceof Guild_1.default ? this.guild.scheduledEvents.update(data.guild_scheduled_event) : new GuildScheduledEvent_1.default(data.guild_scheduled_event, this.client);
|
|
102
|
+
}
|
|
103
|
+
if (data.target_user !== undefined) {
|
|
104
|
+
this.targetUser = this.client.users.update(data.target_user);
|
|
105
|
+
}
|
|
106
|
+
if ("created_at" in data) {
|
|
107
|
+
if (data.created_at !== undefined) {
|
|
108
|
+
this.createdAt = new Date(data.created_at);
|
|
109
|
+
}
|
|
110
|
+
if (data.uses !== undefined) {
|
|
111
|
+
this.uses = data.uses;
|
|
112
|
+
}
|
|
113
|
+
if (data.max_uses !== undefined) {
|
|
114
|
+
this.maxUses = data.max_uses;
|
|
115
|
+
}
|
|
116
|
+
if (data.max_age !== undefined) {
|
|
117
|
+
this.maxAge = data.max_age;
|
|
118
|
+
}
|
|
119
|
+
if (data.temporary !== undefined) {
|
|
120
|
+
this.temporary = data.temporary;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/** The channel this invite leads to. If the channel is not cached, this will be a partial with only `id`, `name`, and `type`. */
|
|
125
|
+
get channel() {
|
|
126
|
+
if (this.channelID !== null) {
|
|
127
|
+
if (this._cachedChannel instanceof Channel_1.default) {
|
|
128
|
+
return this._cachedChannel;
|
|
129
|
+
}
|
|
130
|
+
const cachedChannel = this.client.getChannel(this.channelID);
|
|
131
|
+
return cachedChannel ? (this._cachedChannel = cachedChannel) : this._cachedChannel;
|
|
132
|
+
}
|
|
133
|
+
return this._cachedChannel === null ? this._cachedChannel : (this._cachedChannel = null);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Delete this invite.
|
|
137
|
+
* @param reason The reason for deleting this invite.
|
|
138
|
+
*/
|
|
139
|
+
async deleteInvite(reason) {
|
|
140
|
+
return this.client.rest.channels.deleteInvite(this.code, reason);
|
|
141
|
+
}
|
|
142
|
+
/** Get the target users for this invite. Requires being the inviter or having the `MANAGE_GUILD` or `VIEW_AUDIT_LOG` permission. */
|
|
143
|
+
async getTargetUsers() {
|
|
144
|
+
return this.client.rest.channels.getInviteTargetUsers(this.code);
|
|
145
|
+
}
|
|
146
|
+
/** et the target users job status for this invite. Requires being the inviter or having the `MANAGE_GUILD` or `VIEW_AUDIT_LOG` permission. */
|
|
147
|
+
async getTargetUsersJobStatus() {
|
|
148
|
+
return this.client.rest.channels.getInviteTargetUsersJobStatus(this.code);
|
|
149
|
+
}
|
|
150
|
+
/** Whether this invite belongs to a cached channel. The only difference on using this method over a simple if statement is to easily update all the invite properties typing definitions based on the channel it belongs to. */
|
|
151
|
+
inCachedChannel() {
|
|
152
|
+
return this.channel instanceof Channel_1.default;
|
|
153
|
+
}
|
|
154
|
+
inCachedGuildChannel() {
|
|
155
|
+
return this.channel instanceof GuildChannel_1.default;
|
|
156
|
+
}
|
|
157
|
+
inDMChannel() {
|
|
158
|
+
return this.channel !== null && Constants_1.DMInviteChannelTypes.includes(this.channel.type);
|
|
159
|
+
}
|
|
160
|
+
toJSON() {
|
|
161
|
+
return {
|
|
162
|
+
approximateMemberCount: this.approximateMemberCount,
|
|
163
|
+
approximatePresenceCount: this.approximatePresenceCount,
|
|
164
|
+
channelID: this.channelID ?? undefined,
|
|
165
|
+
code: this.code,
|
|
166
|
+
createdAt: this.createdAt?.getTime(),
|
|
167
|
+
expiresAt: this.expiresAt?.getTime(),
|
|
168
|
+
guild: this.guild?.toJSON(),
|
|
169
|
+
guildID: this.guildID ?? undefined,
|
|
170
|
+
guildScheduledEvent: this.guildScheduledEvent?.toJSON(),
|
|
171
|
+
inviter: this.inviter?.toJSON(),
|
|
172
|
+
maxAge: this.maxAge,
|
|
173
|
+
maxUses: this.maxUses,
|
|
174
|
+
roles: this.roles?.map(role => role.toJSON()),
|
|
175
|
+
stageInstance: this.stageInstance ? {
|
|
176
|
+
members: this.stageInstance.members.map(member => member.id),
|
|
177
|
+
participantCount: this.stageInstance.participantCount,
|
|
178
|
+
speakerCount: this.stageInstance.speakerCount,
|
|
179
|
+
topic: this.stageInstance.topic
|
|
180
|
+
} : undefined,
|
|
181
|
+
targetApplication: this.targetApplication?.toJSON(),
|
|
182
|
+
targetType: this.targetType,
|
|
183
|
+
targetUser: this.targetUser?.toJSON(),
|
|
184
|
+
temporary: this.temporary,
|
|
185
|
+
uses: this.uses
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Update the target users for this invite. Requires being the inviter or having the `MANAGE_GUILD` permission.
|
|
190
|
+
* @param users The IDs of the users to allow accepting the invite.
|
|
191
|
+
*/
|
|
192
|
+
async updateInviteTargetUsers(users) {
|
|
193
|
+
return this.client.rest.channels.updateInviteTargetUsers(this.code, users);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
exports.default = Invite;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function (o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined)
|
|
4
|
+
k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function (o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined)
|
|
12
|
+
k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function (o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function (o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function (o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o)
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(o, k))
|
|
26
|
+
ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule)
|
|
33
|
+
return mod;
|
|
34
|
+
var result = {};
|
|
35
|
+
if (mod != null)
|
|
36
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++)
|
|
37
|
+
if (k[i] !== "default")
|
|
38
|
+
__createBinding(result, mod, k[i]);
|
|
39
|
+
__setModuleDefault(result, mod);
|
|
40
|
+
return result;
|
|
41
|
+
};
|
|
42
|
+
})();
|
|
43
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
44
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
45
|
+
};
|
|
46
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
|
+
/** @module InviteGuild */
|
|
48
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
49
|
+
const Routes = __importStar(require("../util/Routes"));
|
|
50
|
+
/** Represents a guild received via an invite. */
|
|
51
|
+
class InviteGuild extends Base_1.default {
|
|
52
|
+
constructor(data, client) {
|
|
53
|
+
super(data.id, client);
|
|
54
|
+
this.banner = data.banner;
|
|
55
|
+
this.description = data.description;
|
|
56
|
+
this.features = data.features;
|
|
57
|
+
this.name = data.name;
|
|
58
|
+
this.nsfwLevel = data.nsfw_level;
|
|
59
|
+
this.icon = data.icon;
|
|
60
|
+
this.premiumSubscriptionCount = data.premium_subscription_count;
|
|
61
|
+
this.splash = data.splash;
|
|
62
|
+
this.vanityURLCode = data.vanity_url_code;
|
|
63
|
+
this.verificationLevel = data.verification_level;
|
|
64
|
+
}
|
|
65
|
+
/** The complete guild this InviteGuild represents, if cached. */
|
|
66
|
+
get completeGuild() {
|
|
67
|
+
return this._cachedCompleteGuild ?? (this._cachedCompleteGuild = this.client.guilds.get(this.id));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The url of this guild's banner.
|
|
71
|
+
* @param format The format the url should be.
|
|
72
|
+
* @param size The dimensions of the image.
|
|
73
|
+
*/
|
|
74
|
+
bannerURL(format, size) {
|
|
75
|
+
return this.banner === null ? null : this.client.util.formatImage(Routes.BANNER(this.id, this.banner), format, size);
|
|
76
|
+
}
|
|
77
|
+
/** Get the complete guild this InviteGuild represents. */
|
|
78
|
+
async getCompleteGuild() {
|
|
79
|
+
if (this.completeGuild)
|
|
80
|
+
return this.completeGuild;
|
|
81
|
+
const guild = await this.client.rest.guilds.get(this.id);
|
|
82
|
+
this._cachedCompleteGuild = guild;
|
|
83
|
+
return guild;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The url of this guild's icon.
|
|
87
|
+
* @param format The format the url should be.
|
|
88
|
+
* @param size The dimensions of the image.
|
|
89
|
+
*/
|
|
90
|
+
iconURL(format, size) {
|
|
91
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.GUILD_ICON(this.id, this.icon), format, size);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The url of this guild's invite splash.
|
|
95
|
+
* @param format The format the url should be.
|
|
96
|
+
* @param size The dimensions of the image.
|
|
97
|
+
*/
|
|
98
|
+
splashURL(format, size) {
|
|
99
|
+
return this.splash === null ? null : this.client.util.formatImage(Routes.GUILD_SPLASH(this.id, this.splash), format, size);
|
|
100
|
+
}
|
|
101
|
+
toJSON() {
|
|
102
|
+
return {
|
|
103
|
+
...super.toJSON(),
|
|
104
|
+
banner: this.banner,
|
|
105
|
+
description: this.description,
|
|
106
|
+
features: this.features,
|
|
107
|
+
icon: this.icon,
|
|
108
|
+
name: this.name,
|
|
109
|
+
nsfwLevel: this.nsfwLevel,
|
|
110
|
+
premiumSubscriptionCount: this.premiumSubscriptionCount,
|
|
111
|
+
splash: this.splash,
|
|
112
|
+
vanityURLCode: this.vanityURLCode,
|
|
113
|
+
verificationLevel: this.verificationLevel
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.default = InviteGuild;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/** @module InviteRole */
|
|
7
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
8
|
+
const Permission_1 = __importDefault(require("./Permission"));
|
|
9
|
+
const Errors_1 = require("../util/Errors");
|
|
10
|
+
/** Represents a partial role for an invite. */
|
|
11
|
+
class InviteRole extends Base_1.default {
|
|
12
|
+
constructor(data, client, guildID, guild) {
|
|
13
|
+
super(data.id, client);
|
|
14
|
+
this.color = data.color;
|
|
15
|
+
this.colors = {
|
|
16
|
+
primaryColor: data.colors.primary_color,
|
|
17
|
+
secondaryColor: data.colors.secondary_color,
|
|
18
|
+
tertiaryColor: data.colors.tertiary_color
|
|
19
|
+
};
|
|
20
|
+
this.guild = guild;
|
|
21
|
+
this.guildID = guildID;
|
|
22
|
+
this.icon = data.icon ?? null;
|
|
23
|
+
this.name = data.name;
|
|
24
|
+
this.permissions = new Permission_1.default(data.permissions);
|
|
25
|
+
this.position = data.position;
|
|
26
|
+
this.unicodeEmoji = null;
|
|
27
|
+
this.update(data);
|
|
28
|
+
}
|
|
29
|
+
/** The guild this role is in. This will throw an error if the guild is not cached. */
|
|
30
|
+
get completeGuild() {
|
|
31
|
+
this._cachedGuild ?? (this._cachedGuild = this.client.guilds.get(this.guildID));
|
|
32
|
+
if (!this._cachedGuild) {
|
|
33
|
+
if (this.client.options.restMode) {
|
|
34
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#completeGuild is not present when rest mode is enabled.`);
|
|
35
|
+
}
|
|
36
|
+
if (!this.client.shards.connected) {
|
|
37
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#completeGuild is not present without a gateway connection.`);
|
|
38
|
+
}
|
|
39
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#completeGuild is not present.`);
|
|
40
|
+
}
|
|
41
|
+
return this._cachedGuild;
|
|
42
|
+
}
|
|
43
|
+
/** The complete role this InviteRole represents, if cached. */
|
|
44
|
+
get completeRole() {
|
|
45
|
+
return this._cachedCompleteRole ?? (this._cachedCompleteRole = this.client.guilds.get(this.guildID)?.roles.get(this.id));
|
|
46
|
+
}
|
|
47
|
+
/** A string that will mention this role. */
|
|
48
|
+
get mention() {
|
|
49
|
+
return `<@&${this.id}>`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Delete this role.
|
|
53
|
+
* @param reason The reason for deleting the role.
|
|
54
|
+
*/
|
|
55
|
+
async delete(reason) {
|
|
56
|
+
return this.client.rest.guilds.deleteRole(this.guildID, this.id, reason);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Edit this role.
|
|
60
|
+
* @param options The options for editing the role.
|
|
61
|
+
*/
|
|
62
|
+
async edit(options) {
|
|
63
|
+
return this.client.rest.guilds.editRole(this.guildID, this.id, options);
|
|
64
|
+
}
|
|
65
|
+
/** Get the complete role this InviteRole represents. */
|
|
66
|
+
async getCompleteRole() {
|
|
67
|
+
if (this.completeRole)
|
|
68
|
+
return this.completeRole;
|
|
69
|
+
const role = await this.client.rest.guilds.getRole(this.guildID, this.id);
|
|
70
|
+
this._cachedCompleteRole = role;
|
|
71
|
+
return role;
|
|
72
|
+
}
|
|
73
|
+
toJSON() {
|
|
74
|
+
return {
|
|
75
|
+
...super.toJSON(),
|
|
76
|
+
color: this.color,
|
|
77
|
+
colors: this.colors,
|
|
78
|
+
guild: this.guild.toJSON(),
|
|
79
|
+
guildID: this.guildID,
|
|
80
|
+
icon: this.icon,
|
|
81
|
+
name: this.name,
|
|
82
|
+
permissions: this.permissions.toJSON(),
|
|
83
|
+
position: this.position,
|
|
84
|
+
unicodeEmoji: this.unicodeEmoji
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.default = InviteRole;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/** @module Lobby */
|
|
7
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
8
|
+
const GuildChannel_1 = __importDefault(require("./GuildChannel"));
|
|
9
|
+
const LobbyMember_1 = __importDefault(require("./LobbyMember"));
|
|
10
|
+
class Lobby extends Base_1.default {
|
|
11
|
+
constructor(data, client) {
|
|
12
|
+
super(data.id, client);
|
|
13
|
+
this.applicationID = data.application_id;
|
|
14
|
+
this.linkedChannel = data.linked_channel ? client.util.updateChannel(data.linked_channel) : undefined;
|
|
15
|
+
this.members = data.members.map(member => new LobbyMember_1.default(member, client, this.id));
|
|
16
|
+
this.metadata = data.metadata;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Add a member to this lobby.
|
|
20
|
+
* @param userID The ID of the user to add to the lobby.
|
|
21
|
+
* @param options The options for adding the member to the lobby.
|
|
22
|
+
*/
|
|
23
|
+
async addMember(userID, options) {
|
|
24
|
+
return this.client.rest.lobbies.addMember(this.id, userID, options);
|
|
25
|
+
}
|
|
26
|
+
/** Delete this lobby. */
|
|
27
|
+
async delete() {
|
|
28
|
+
return this.client.rest.lobbies.delete(this.id);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Edit this lobby.
|
|
32
|
+
* @param options The options for editing the lobby.
|
|
33
|
+
*/
|
|
34
|
+
async edit(options) {
|
|
35
|
+
return this.client.rest.lobbies.edit(this.id, options);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Leave this lobby. This requires bearer token authentication.
|
|
39
|
+
* @param accessToken An optional access token to use instead of the client's token. This overrides the client's auth.
|
|
40
|
+
*/
|
|
41
|
+
async leave(accessToken) {
|
|
42
|
+
return this.client.rest.lobbies.leave(this.id, accessToken);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Link this lobby to a channel. This requires bearer token authentication and the `CAN_LINK_LOBBY` flag on the member.
|
|
46
|
+
* @param channelID The ID of the channel to link the lobby to.
|
|
47
|
+
* @param accessToken An optional access token to use instead of the client's token. This overrides the client's auth.
|
|
48
|
+
*/
|
|
49
|
+
async linkChannel(channelID, accessToken) {
|
|
50
|
+
return this.client.rest.lobbies.linkChannel(this.id, channelID, accessToken);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Remove a member from this lobby.
|
|
54
|
+
* @param userID The ID of the user to remove from the lobby.
|
|
55
|
+
*/
|
|
56
|
+
async removeMember(userID) {
|
|
57
|
+
return this.client.rest.lobbies.removeMember(this.id, userID);
|
|
58
|
+
}
|
|
59
|
+
toJSON() {
|
|
60
|
+
return {
|
|
61
|
+
...super.toJSON(),
|
|
62
|
+
applicationID: this.applicationID,
|
|
63
|
+
linkedChannel: this.linkedChannel ? (this.linkedChannel instanceof GuildChannel_1.default ? this.linkedChannel.toJSON() : this.linkedChannel) : undefined,
|
|
64
|
+
members: this.members.map(member => member.toJSON()),
|
|
65
|
+
metadata: this.metadata
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Unlink this lobby from a channel. This requires bearer token authentication and the `CAN_LINK_LOBBY` flag on the member.
|
|
70
|
+
* @param accessToken An optional access token to use instead of the client's token. This overrides the client's auth.
|
|
71
|
+
*/
|
|
72
|
+
async unlinkChannel(accessToken) {
|
|
73
|
+
return this.client.rest.lobbies.unlinkChannel(this.id, accessToken);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Update the moderation metadata for a message in this lobby.
|
|
77
|
+
* @param messageID The ID of the message to update the metadata for.
|
|
78
|
+
* @param metadata The metadata to set for the message.
|
|
79
|
+
*/
|
|
80
|
+
async updateMessageModerationMetadata(messageID, metadata) {
|
|
81
|
+
return this.client.rest.lobbies.updateMessageModerationMetadata(this.id, messageID, metadata);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.default = Lobby;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/** @module LobbyMember */
|
|
7
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
8
|
+
class LobbyMember extends Base_1.default {
|
|
9
|
+
constructor(data, client, lobbyID) {
|
|
10
|
+
super(data.id, client);
|
|
11
|
+
this.flags = data.flags;
|
|
12
|
+
this.lobbyID = lobbyID;
|
|
13
|
+
this.metadata = data.metadata;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Remove this member from the lobby.
|
|
17
|
+
*/
|
|
18
|
+
async remove() {
|
|
19
|
+
return this.client.rest.lobbies.removeMember(this.lobbyID, this.id);
|
|
20
|
+
}
|
|
21
|
+
toJSON() {
|
|
22
|
+
return {
|
|
23
|
+
...super.toJSON(),
|
|
24
|
+
flags: this.flags,
|
|
25
|
+
lobbyID: this.lobbyID,
|
|
26
|
+
metadata: this.metadata
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = LobbyMember;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
/** @module MediaChannel */
|
|
7
|
+
const ThreadOnlyChannel_1 = __importDefault(require("./ThreadOnlyChannel"));
|
|
8
|
+
/** Represents a media channel. */
|
|
9
|
+
class MediaChannel extends ThreadOnlyChannel_1.default {
|
|
10
|
+
constructor(data, client) {
|
|
11
|
+
super(data, client);
|
|
12
|
+
}
|
|
13
|
+
toJSON() {
|
|
14
|
+
return {
|
|
15
|
+
...super.toJSON(),
|
|
16
|
+
type: this.type
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.default = MediaChannel;
|