@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,263 @@
|
|
|
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 ModalSubmitInteraction */
|
|
7
|
+
const Interaction_1 = __importDefault(require("./Interaction"));
|
|
8
|
+
const Member_1 = __importDefault(require("./Member"));
|
|
9
|
+
const User_1 = __importDefault(require("./User"));
|
|
10
|
+
const Permission_1 = __importDefault(require("./Permission"));
|
|
11
|
+
const Message_1 = __importDefault(require("./Message"));
|
|
12
|
+
const GuildChannel_1 = __importDefault(require("./GuildChannel"));
|
|
13
|
+
const InteractionResolvedChannel_1 = __importDefault(require("./InteractionResolvedChannel"));
|
|
14
|
+
const Role_1 = __importDefault(require("./Role"));
|
|
15
|
+
const Attachment_1 = __importDefault(require("./Attachment"));
|
|
16
|
+
const Constants_1 = require("../Constants");
|
|
17
|
+
const TypedCollection_1 = __importDefault(require("../util/TypedCollection"));
|
|
18
|
+
const Errors_1 = require("../util/Errors");
|
|
19
|
+
const MessageInteractionResponse_1 = __importDefault(require("../util/interactions/MessageInteractionResponse"));
|
|
20
|
+
const ModalSubmitInteractionComponentsWrapper_1 = __importDefault(require("../util/interactions/ModalSubmitInteractionComponentsWrapper"));
|
|
21
|
+
/** Represents a modal submit interaction. */
|
|
22
|
+
class ModalSubmitInteraction extends Interaction_1.default {
|
|
23
|
+
constructor(data, client) {
|
|
24
|
+
super(data, client);
|
|
25
|
+
if (data.message !== undefined && data.guild_id !== undefined) {
|
|
26
|
+
data.message.guild_id = data.guild_id;
|
|
27
|
+
}
|
|
28
|
+
this.appPermissions = new Permission_1.default(data.app_permissions ?? "0");
|
|
29
|
+
this.attachmentSizeLimit = data.attachment_size_limit;
|
|
30
|
+
this.authorizingIntegrationOwners = data.authorizing_integration_owners;
|
|
31
|
+
this.channelID = data.channel_id;
|
|
32
|
+
this.context = data.context;
|
|
33
|
+
this.entitlements = data.entitlements?.map(entitlement => client.util.updateEntitlement(entitlement)) ?? [];
|
|
34
|
+
this.guildID = (data.guild_id ?? null);
|
|
35
|
+
this.guildLocale = data.guild_locale;
|
|
36
|
+
this.guildPartial = data.guild;
|
|
37
|
+
this.locale = data.locale;
|
|
38
|
+
this.member = (data.member === undefined ? null : this.client.util.updateMember(data.guild_id, data.member.user.id, data.member));
|
|
39
|
+
this.memberPermissions = (data.member === undefined ? null : new Permission_1.default(data.member.permissions));
|
|
40
|
+
if (data.message !== undefined) {
|
|
41
|
+
this.message = (this.channel && "messages" in this.channel && this.channel.messages.update(data.message)) || new Message_1.default(data.message, client);
|
|
42
|
+
}
|
|
43
|
+
this.user = client.users.update(data.user ?? data.member.user);
|
|
44
|
+
const resolved = {
|
|
45
|
+
attachments: new TypedCollection_1.default(Attachment_1.default, client),
|
|
46
|
+
channels: new TypedCollection_1.default(InteractionResolvedChannel_1.default, client),
|
|
47
|
+
members: new TypedCollection_1.default(Member_1.default, client),
|
|
48
|
+
roles: new TypedCollection_1.default(Role_1.default, client),
|
|
49
|
+
users: new TypedCollection_1.default(User_1.default, client)
|
|
50
|
+
};
|
|
51
|
+
if (data.data.resolved) {
|
|
52
|
+
if (data.data.resolved.attachments) {
|
|
53
|
+
for (const attachment of Object.values(data.data.resolved.attachments))
|
|
54
|
+
resolved.attachments.add(new Attachment_1.default(attachment, client));
|
|
55
|
+
}
|
|
56
|
+
if (data.data.resolved.channels) {
|
|
57
|
+
for (const channel of Object.values(data.data.resolved.channels))
|
|
58
|
+
resolved.channels.update(channel);
|
|
59
|
+
}
|
|
60
|
+
if (data.data.resolved.members) {
|
|
61
|
+
for (const [id, member] of Object.entries(data.data.resolved.members)) {
|
|
62
|
+
const m = member;
|
|
63
|
+
m.user = data.data.resolved.users[id];
|
|
64
|
+
resolved.members.add(client.util.updateMember(data.guild_id, id, m));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (data.data.resolved.roles) {
|
|
68
|
+
for (const role of Object.values(data.data.resolved.roles)) {
|
|
69
|
+
try {
|
|
70
|
+
resolved.roles.add(this.guild?.roles.update(role, this.guildID) ?? new Role_1.default(role, client, this.guildID));
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
resolved.roles.add(new Role_1.default(role, client, this.guildID));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (data.data.resolved.users) {
|
|
78
|
+
for (const user of Object.values(data.data.resolved.users))
|
|
79
|
+
resolved.users.add(client.users.update(user));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.data = {
|
|
83
|
+
components: new ModalSubmitInteractionComponentsWrapper_1.default(resolved, client.util.modalSubmitComponentsToParsed(data.data.components)),
|
|
84
|
+
customID: data.data.custom_id,
|
|
85
|
+
resolved
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** The channel this interaction was sent from. */
|
|
89
|
+
get channel() {
|
|
90
|
+
return this._cachedChannel ?? (this._cachedChannel = this.client.getChannel(this.channelID));
|
|
91
|
+
}
|
|
92
|
+
/** The guild this interaction was sent from, if applicable. This will throw an error if the guild is not cached. */
|
|
93
|
+
get guild() {
|
|
94
|
+
if (this.guildID !== null && this._cachedGuild !== null) {
|
|
95
|
+
this._cachedGuild ?? (this._cachedGuild = this.client.guilds.get(this.guildID));
|
|
96
|
+
if (!this._cachedGuild) {
|
|
97
|
+
if (this.client.options.restMode) {
|
|
98
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present when rest mode is enabled.`);
|
|
99
|
+
}
|
|
100
|
+
if (!this.client.shards.connected) {
|
|
101
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present without a gateway connection.`);
|
|
102
|
+
}
|
|
103
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present.`);
|
|
104
|
+
}
|
|
105
|
+
return this._cachedGuild;
|
|
106
|
+
}
|
|
107
|
+
return this._cachedGuild === null ? this._cachedGuild : (this._cachedGuild = null);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Create a followup message.
|
|
111
|
+
* Note that the returned class is not a message. It is a wrapper around the interaction response. The {@link MessageInteractionResponse#getMessage | getMessage} function can be used to get the message.
|
|
112
|
+
* @param options The options for creating the followup message.
|
|
113
|
+
*/
|
|
114
|
+
async createFollowup(options) {
|
|
115
|
+
const message = await this.client.rest.interactions.createFollowupMessage(this.applicationID, this.token, options);
|
|
116
|
+
return new MessageInteractionResponse_1.default(this, message, "followup", null);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Create a message through this interaction. This is an initial response, and more than one initial response cannot be used. Use {@link ModalSubmitInteraction#createFollowup | createFollowup}.
|
|
120
|
+
* Note that the returned class is not a message. It is a wrapper around the interaction response. The {@link MessageInteractionResponse#getMessage | getMessage} function can be used to get the message.
|
|
121
|
+
* @param options The options for the message.
|
|
122
|
+
*/
|
|
123
|
+
async createMessage(options) {
|
|
124
|
+
if (this.acknowledged) {
|
|
125
|
+
throw new TypeError("Interactions cannot have more than one initial response.");
|
|
126
|
+
}
|
|
127
|
+
this.acknowledged = true;
|
|
128
|
+
const cb = await this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.CHANNEL_MESSAGE_WITH_SOURCE, data: options }, true);
|
|
129
|
+
return new MessageInteractionResponse_1.default(this, null, "initial", cb);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Defer this interaction. This is an initial response, and more than one initial response cannot be used.
|
|
133
|
+
* @param flags The [flags](https://discord.com/developers/docs/resources/channel#message-object-message-flags) to respond with.
|
|
134
|
+
*/
|
|
135
|
+
async defer(flags) {
|
|
136
|
+
if (this.acknowledged) {
|
|
137
|
+
throw new TypeError("Interactions cannot have more than one initial response.");
|
|
138
|
+
}
|
|
139
|
+
this.acknowledged = true;
|
|
140
|
+
return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE, data: { flags } }, true);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Defer this interaction with a `DEFERRED_UPDATE_MESSAGE` response. This is an initial response, and more than one initial response cannot be used.
|
|
144
|
+
* @param flags The [flags](https://discord.com/developers/docs/resources/channel#message-object-message-flags) to respond with.
|
|
145
|
+
*/
|
|
146
|
+
async deferUpdate(flags) {
|
|
147
|
+
if (this.acknowledged) {
|
|
148
|
+
throw new TypeError("Interactions cannot have more than one initial response.");
|
|
149
|
+
}
|
|
150
|
+
this.acknowledged = true;
|
|
151
|
+
return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.DEFERRED_UPDATE_MESSAGE, data: { flags } }, true);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Delete a follow-up message.
|
|
155
|
+
* @param messageID The ID of the message.
|
|
156
|
+
*/
|
|
157
|
+
async deleteFollowup(messageID) {
|
|
158
|
+
return this.client.rest.interactions.deleteFollowupMessage(this.applicationID, this.token, messageID);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Delete the original interaction response.
|
|
162
|
+
*/
|
|
163
|
+
async deleteOriginal() {
|
|
164
|
+
return this.client.rest.interactions.deleteOriginalMessage(this.applicationID, this.token);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Edit a followup message.
|
|
168
|
+
* @param messageID The ID of the message.
|
|
169
|
+
* @param options The options for editing the followup message.
|
|
170
|
+
*/
|
|
171
|
+
async editFollowup(messageID, options) {
|
|
172
|
+
return this.client.rest.interactions.editFollowupMessage(this.applicationID, this.token, messageID, options);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Edit the original interaction response.
|
|
176
|
+
* @param options The options for editing the original message.
|
|
177
|
+
*/
|
|
178
|
+
async editOriginal(options) {
|
|
179
|
+
return this.client.rest.interactions.editOriginalMessage(this.applicationID, this.token, options);
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Edit the message this interaction is from. If this interaction has already been acknowledged, use `createFollowup`.
|
|
183
|
+
* @param options The options for editing the message.
|
|
184
|
+
*/
|
|
185
|
+
async editParent(options) {
|
|
186
|
+
if (this.acknowledged) {
|
|
187
|
+
throw new TypeError("Interactions cannot have more than one initial response.");
|
|
188
|
+
}
|
|
189
|
+
this.acknowledged = true;
|
|
190
|
+
return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.UPDATE_MESSAGE, data: options }, true);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Get a followup message.
|
|
194
|
+
* @param messageID The ID of the message.
|
|
195
|
+
*/
|
|
196
|
+
async getFollowup(messageID) {
|
|
197
|
+
return this.client.rest.interactions.getFollowupMessage(this.applicationID, this.token, messageID);
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get the original interaction response.
|
|
201
|
+
*/
|
|
202
|
+
async getOriginal() {
|
|
203
|
+
return this.client.rest.interactions.getOriginalMessage(this.applicationID, this.token);
|
|
204
|
+
}
|
|
205
|
+
/** Whether this interaction belongs to a cached guild channel. The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
|
|
206
|
+
inCachedGuildChannel() {
|
|
207
|
+
return this.channel instanceof GuildChannel_1.default;
|
|
208
|
+
}
|
|
209
|
+
/** Whether this interaction belongs to a private channel (PrivateChannel or uncached). The only difference on using this method over a simple if statement is to easily update all the interaction properties typing definitions based on the channel it belongs to. */
|
|
210
|
+
inPrivateChannel() {
|
|
211
|
+
return this.guildID === null;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Launch the bot's activity. This is an initial response, and more than one initial response cannot be used.
|
|
215
|
+
*/
|
|
216
|
+
async launchActivity() {
|
|
217
|
+
if (this.acknowledged) {
|
|
218
|
+
throw new TypeError("Interactions cannot have more than one initial response.");
|
|
219
|
+
}
|
|
220
|
+
this.acknowledged = true;
|
|
221
|
+
return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.LAUNCH_ACTIVITY }, true);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Show a "premium required" response to the user. This is an initial response, and more than one initial response cannot be used.
|
|
225
|
+
* @deprecated The {@link Constants~InteractionResponseTypes.PREMIUM_REQUIRED | PREMIUM_REQUIRED} interaction response type is now deprecated in favor of using {@link Types/Channels~PremiumButton | custom premium buttons}.
|
|
226
|
+
*/
|
|
227
|
+
async premiumRequired() {
|
|
228
|
+
if (this.acknowledged) {
|
|
229
|
+
throw new TypeError("Interactions cannot have more than one initial response.");
|
|
230
|
+
}
|
|
231
|
+
this.acknowledged = true;
|
|
232
|
+
return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.PREMIUM_REQUIRED }, true);
|
|
233
|
+
}
|
|
234
|
+
async reply(content, options) {
|
|
235
|
+
if (typeof content === "string") {
|
|
236
|
+
options = {
|
|
237
|
+
...options,
|
|
238
|
+
content
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
else
|
|
242
|
+
options = content;
|
|
243
|
+
return this.acknowledged ? this.createFollowup(options) : this.createMessage(options);
|
|
244
|
+
}
|
|
245
|
+
toJSON() {
|
|
246
|
+
return {
|
|
247
|
+
...super.toJSON(),
|
|
248
|
+
appPermissions: this.appPermissions.toJSON(),
|
|
249
|
+
attachmentSizeLimit: this.attachmentSizeLimit,
|
|
250
|
+
authorizingIntegrationOwners: this.authorizingIntegrationOwners,
|
|
251
|
+
channelID: this.channelID,
|
|
252
|
+
context: this.context,
|
|
253
|
+
data: this.data,
|
|
254
|
+
guildID: this.guildID ?? undefined,
|
|
255
|
+
guildLocale: this.guildLocale,
|
|
256
|
+
locale: this.locale,
|
|
257
|
+
member: this.member?.toJSON(),
|
|
258
|
+
type: this.type,
|
|
259
|
+
user: this.user.toJSON()
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
exports.default = ModalSubmitInteraction;
|
|
@@ -0,0 +1,203 @@
|
|
|
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
|
+
const Team_1 = __importDefault(require("./Team"));
|
|
48
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
49
|
+
const Routes = __importStar(require("../util/Routes"));
|
|
50
|
+
const Errors_1 = require("../util/Errors");
|
|
51
|
+
/** Represents an oauth application. */
|
|
52
|
+
class OAuthApplication extends Base_1.default {
|
|
53
|
+
constructor(data, client) {
|
|
54
|
+
super(data.id, client);
|
|
55
|
+
this.botPublic = !!data.bot_public;
|
|
56
|
+
this.botRequireCodeGrant = !!data.bot_require_code_grant;
|
|
57
|
+
this.coverImage = null;
|
|
58
|
+
this.description = data.description;
|
|
59
|
+
this.flags = data.flags;
|
|
60
|
+
this.guildID = data.guild_id ?? null;
|
|
61
|
+
this.icon = null;
|
|
62
|
+
this.integrationTypes = [];
|
|
63
|
+
this.integrationTypesConfig = {};
|
|
64
|
+
this.name = data.name;
|
|
65
|
+
this.owner = client.users.update(data.owner);
|
|
66
|
+
this.ownerID = data.owner.id;
|
|
67
|
+
this.rpcOrigins = [];
|
|
68
|
+
this.team = null;
|
|
69
|
+
this.type = data.type;
|
|
70
|
+
this.verifyKey = data.verify_key;
|
|
71
|
+
this.update(data);
|
|
72
|
+
}
|
|
73
|
+
update(data) {
|
|
74
|
+
super.update(data);
|
|
75
|
+
if (data.bot_public !== undefined) {
|
|
76
|
+
this.botPublic = data.bot_public;
|
|
77
|
+
}
|
|
78
|
+
if (data.bot_require_code_grant !== undefined) {
|
|
79
|
+
this.botRequireCodeGrant = data.bot_require_code_grant;
|
|
80
|
+
}
|
|
81
|
+
if (data.cover_image !== undefined) {
|
|
82
|
+
this.coverImage = data.cover_image;
|
|
83
|
+
}
|
|
84
|
+
if (data.custom_install_url !== undefined) {
|
|
85
|
+
this.customInstallURL = data.custom_install_url;
|
|
86
|
+
}
|
|
87
|
+
if (data.description !== undefined) {
|
|
88
|
+
this.description = data.description;
|
|
89
|
+
}
|
|
90
|
+
if (data.flags !== undefined) {
|
|
91
|
+
this.flags = data.flags;
|
|
92
|
+
}
|
|
93
|
+
this.guildID = data.guild_id === undefined ? null : data.guild_id;
|
|
94
|
+
if (data.icon !== undefined) {
|
|
95
|
+
this.icon = data.icon;
|
|
96
|
+
}
|
|
97
|
+
if (data.install_params !== undefined) {
|
|
98
|
+
this.installParams = data.install_params;
|
|
99
|
+
}
|
|
100
|
+
if (data.integration_types !== undefined) {
|
|
101
|
+
this.integrationTypes = data.integration_types;
|
|
102
|
+
}
|
|
103
|
+
if (data.integration_types_config !== undefined) {
|
|
104
|
+
this.integrationTypesConfig = Object.fromEntries(Object.entries(data.integration_types_config).map(([key, value]) => [key, { oauth2InstallParams: value.oauth2_install_params }]));
|
|
105
|
+
}
|
|
106
|
+
if (data.name !== undefined) {
|
|
107
|
+
this.name = data.name;
|
|
108
|
+
}
|
|
109
|
+
if (data.owner !== undefined) {
|
|
110
|
+
this.owner = this.client.users.update(data.owner);
|
|
111
|
+
this.ownerID = data.owner.id;
|
|
112
|
+
}
|
|
113
|
+
if (data.primary_sku_id !== undefined) {
|
|
114
|
+
this.primarySKUID = data.primary_sku_id;
|
|
115
|
+
}
|
|
116
|
+
if (data.privacy_policy_url !== undefined) {
|
|
117
|
+
this.privacyPolicyURL = data.privacy_policy_url;
|
|
118
|
+
}
|
|
119
|
+
if (data.rpc_origins !== undefined) {
|
|
120
|
+
this.rpcOrigins = data.rpc_origins;
|
|
121
|
+
}
|
|
122
|
+
if (data.slug !== undefined) {
|
|
123
|
+
this.slug = data.slug;
|
|
124
|
+
}
|
|
125
|
+
if (data.tags !== undefined) {
|
|
126
|
+
this.tags = data.tags;
|
|
127
|
+
}
|
|
128
|
+
if (data.team !== undefined) {
|
|
129
|
+
this.team = data.team ? new Team_1.default(data.team, this.client) : null;
|
|
130
|
+
}
|
|
131
|
+
if (data.terms_of_service_url !== undefined) {
|
|
132
|
+
this.termsOfServiceURL = data.terms_of_service_url;
|
|
133
|
+
}
|
|
134
|
+
if (data.type !== undefined) {
|
|
135
|
+
this.type = data.type;
|
|
136
|
+
}
|
|
137
|
+
if (data.verify_key !== undefined) {
|
|
138
|
+
this.verifyKey = data.verify_key;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
/** If this application is a game sold on Discord, the guild to which it has been linked. This will throw an error if the guild is not cached. */
|
|
142
|
+
get guild() {
|
|
143
|
+
if (this.guildID !== null && this._cachedGuild !== null) {
|
|
144
|
+
this._cachedGuild ?? (this._cachedGuild = this.client.guilds.get(this.guildID));
|
|
145
|
+
if (!this._cachedGuild) {
|
|
146
|
+
if (this.client.options.restMode) {
|
|
147
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present when rest mode is enabled.`);
|
|
148
|
+
}
|
|
149
|
+
if (!this.client.shards.connected) {
|
|
150
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present without a gateway connection.`);
|
|
151
|
+
}
|
|
152
|
+
throw new Errors_1.UncachedError(`${this.constructor.name}#guild is not present.`);
|
|
153
|
+
}
|
|
154
|
+
return this._cachedGuild;
|
|
155
|
+
}
|
|
156
|
+
return this._cachedGuild === null ? this._cachedGuild : (this._cachedGuild = null);
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The url of this application's cover image.
|
|
160
|
+
* @param format The format the url should be.
|
|
161
|
+
* @param size The dimensions of the image.
|
|
162
|
+
*/
|
|
163
|
+
coverImageURL(format, size) {
|
|
164
|
+
return this.coverImage === null ? null : this.client.util.formatImage(Routes.APPLICATION_COVER(this.id, this.coverImage), format, size);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The url of this application's icon.
|
|
168
|
+
* @param format The format the url should be.
|
|
169
|
+
* @param size The dimensions of the image.
|
|
170
|
+
*/
|
|
171
|
+
iconURL(format, size) {
|
|
172
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.APPLICATION_ICON(this.id, this.icon), format, size);
|
|
173
|
+
}
|
|
174
|
+
toJSON() {
|
|
175
|
+
return {
|
|
176
|
+
...super.toJSON(),
|
|
177
|
+
botPublic: this.botPublic,
|
|
178
|
+
botRequireCodeGrant: this.botRequireCodeGrant,
|
|
179
|
+
coverImage: this.coverImage,
|
|
180
|
+
customInstallURL: this.customInstallURL,
|
|
181
|
+
description: this.description,
|
|
182
|
+
flags: this.flags,
|
|
183
|
+
guildID: this.guildID,
|
|
184
|
+
icon: this.icon,
|
|
185
|
+
installParams: this.installParams,
|
|
186
|
+
integrationTypes: this.integrationTypes,
|
|
187
|
+
integrationTypesConfig: this.integrationTypesConfig,
|
|
188
|
+
name: this.name,
|
|
189
|
+
owner: this.owner.toJSON(),
|
|
190
|
+
ownerID: this.ownerID,
|
|
191
|
+
primarySKUID: this.primarySKUID,
|
|
192
|
+
privacyPolicyURL: this.privacyPolicyURL,
|
|
193
|
+
rpcOrigins: this.rpcOrigins,
|
|
194
|
+
slug: this.slug,
|
|
195
|
+
tags: this.tags,
|
|
196
|
+
team: this.team?.toJSON() ?? null,
|
|
197
|
+
termsOfServiceURL: this.termsOfServiceURL,
|
|
198
|
+
type: this.type,
|
|
199
|
+
verifyKey: this.verifyKey
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
exports.default = OAuthApplication;
|
|
@@ -0,0 +1,98 @@
|
|
|
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 OAuthGuild */
|
|
48
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
49
|
+
const Permission_1 = __importDefault(require("./Permission"));
|
|
50
|
+
const Routes = __importStar(require("../util/Routes"));
|
|
51
|
+
/** Represents a guild retrieved via oauth. */
|
|
52
|
+
class OAuthGuild extends Base_1.default {
|
|
53
|
+
constructor(data, client) {
|
|
54
|
+
super(data.id, client);
|
|
55
|
+
this.approximateMemberCount = data.approximate_member_count;
|
|
56
|
+
this.approximatePresenceCount = data.approximate_presence_count;
|
|
57
|
+
this.banner = data.banner;
|
|
58
|
+
this.features = data.features;
|
|
59
|
+
this.name = data.name;
|
|
60
|
+
this.icon = data.icon;
|
|
61
|
+
this.owner = data.owner;
|
|
62
|
+
this.permissions = new Permission_1.default(data.permissions);
|
|
63
|
+
}
|
|
64
|
+
/** The complete guild this OAuthGuild represents, if cached. */
|
|
65
|
+
get completeGuild() {
|
|
66
|
+
return this._cachedCompleteGuild ?? (this._cachedCompleteGuild = this.client.guilds.get(this.id));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The url of this guild's banner.
|
|
70
|
+
* @param format The format the url should be.
|
|
71
|
+
* @param size The dimensions of the image.
|
|
72
|
+
*/
|
|
73
|
+
bannerURL(format, size) {
|
|
74
|
+
return this.banner === null ? null : this.client.util.formatImage(Routes.BANNER(this.id, this.banner), format, size);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The url of this guild's icon.
|
|
78
|
+
* @param format The format the url should be.
|
|
79
|
+
* @param size The dimensions of the image.
|
|
80
|
+
*/
|
|
81
|
+
iconURL(format, size) {
|
|
82
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.GUILD_ICON(this.id, this.icon), format, size);
|
|
83
|
+
}
|
|
84
|
+
toJSON() {
|
|
85
|
+
return {
|
|
86
|
+
...super.toJSON(),
|
|
87
|
+
approximateMemberCount: this.approximateMemberCount,
|
|
88
|
+
approximatePresenceCount: this.approximatePresenceCount,
|
|
89
|
+
banner: this.banner,
|
|
90
|
+
features: this.features,
|
|
91
|
+
icon: this.icon,
|
|
92
|
+
name: this.name,
|
|
93
|
+
owner: this.owner,
|
|
94
|
+
permissions: this.permissions.toJSON()
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.default = OAuthGuild;
|
|
@@ -0,0 +1,97 @@
|
|
|
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 PartialApplication */
|
|
48
|
+
const Base_1 = __importDefault(require("./Base"));
|
|
49
|
+
const Routes = __importStar(require("../util/Routes"));
|
|
50
|
+
/** Represents a partial application. */
|
|
51
|
+
class PartialApplication extends Base_1.default {
|
|
52
|
+
constructor(data, client) {
|
|
53
|
+
super(data.id, client);
|
|
54
|
+
this.description = data.description;
|
|
55
|
+
this.icon = null;
|
|
56
|
+
this.name = data.name;
|
|
57
|
+
this.verifyKey = data.verify_key;
|
|
58
|
+
this.update(data);
|
|
59
|
+
}
|
|
60
|
+
update(data) {
|
|
61
|
+
if (data.bot_public !== undefined) {
|
|
62
|
+
this.botPublic = data.bot_public;
|
|
63
|
+
}
|
|
64
|
+
if (data.bot_require_code_grant !== undefined) {
|
|
65
|
+
this.botRequireCodeGrant = data.bot_require_code_grant;
|
|
66
|
+
}
|
|
67
|
+
if (data.description !== undefined) {
|
|
68
|
+
this.description = data.description;
|
|
69
|
+
}
|
|
70
|
+
if (data.icon !== undefined) {
|
|
71
|
+
this.icon = data.icon;
|
|
72
|
+
}
|
|
73
|
+
if (data.name !== undefined) {
|
|
74
|
+
this.name = data.name;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The url of this application's icon.
|
|
79
|
+
* @param format The format the url should be.
|
|
80
|
+
* @param size The dimensions of the image.
|
|
81
|
+
*/
|
|
82
|
+
iconURL(format, size) {
|
|
83
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.APPLICATION_COVER(this.id, this.icon), format, size);
|
|
84
|
+
}
|
|
85
|
+
toJSON() {
|
|
86
|
+
return {
|
|
87
|
+
...super.toJSON(),
|
|
88
|
+
botPublic: this.botPublic,
|
|
89
|
+
botRequireCodeGrant: this.botRequireCodeGrant,
|
|
90
|
+
description: this.description,
|
|
91
|
+
icon: this.icon,
|
|
92
|
+
name: this.name,
|
|
93
|
+
verifyKey: this.verifyKey
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.default = PartialApplication;
|