@deffa5556/bail 1.0.6 → 1.0.9
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/lib/Socket/socket.js +3 -3
- package/lib/Telegram/esm-bridge.mjs +1 -1
- package/package.json +11 -6
|
@@ -0,0 +1,90 @@
|
|
|
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 AutocompleteInteraction */
|
|
7
|
+
const Interaction_1 = __importDefault(require("./Interaction.cjs"));
|
|
8
|
+
const Permission_1 = __importDefault(require("./Permission.cjs"));
|
|
9
|
+
const GuildChannel_1 = __importDefault(require("./GuildChannel.cjs"));
|
|
10
|
+
const Constants_1 = require("../Constants.cjs");
|
|
11
|
+
const InteractionOptionsWrapper_1 = __importDefault(require("../util/interactions/InteractionOptionsWrapper.cjs"));
|
|
12
|
+
const Errors_1 = require("../util/Errors.cjs");
|
|
13
|
+
/** Represents an autocomplete interaction. */
|
|
14
|
+
class AutocompleteInteraction extends Interaction_1.default {
|
|
15
|
+
constructor(data, client) {
|
|
16
|
+
super(data, client);
|
|
17
|
+
this.appPermissions = new Permission_1.default(data.app_permissions ?? "0");
|
|
18
|
+
this.attachmentSizeLimit = data.attachment_size_limit;
|
|
19
|
+
this.authorizingIntegrationOwners = data.authorizing_integration_owners;
|
|
20
|
+
this.channelID = data.channel_id;
|
|
21
|
+
this.context = data.context;
|
|
22
|
+
this.data = {
|
|
23
|
+
guildID: data.data.guild_id,
|
|
24
|
+
id: data.data.id,
|
|
25
|
+
name: data.data.name,
|
|
26
|
+
options: new InteractionOptionsWrapper_1.default(data.data.options ?? [], null),
|
|
27
|
+
type: data.data.type
|
|
28
|
+
};
|
|
29
|
+
this.entitlements = data.entitlements?.map(entitlement => client.util.updateEntitlement(entitlement)) ?? [];
|
|
30
|
+
this.guildID = (data.guild_id ?? null);
|
|
31
|
+
this.guildLocale = data.guild_locale;
|
|
32
|
+
this.guildPartial = data.guild;
|
|
33
|
+
this.locale = data.locale;
|
|
34
|
+
this.member = (data.member === undefined ? null : this.client.util.updateMember(data.guild_id, data.member.user.id, data.member));
|
|
35
|
+
this.memberPermissions = (data.member === undefined ? null : new Permission_1.default(data.member.permissions));
|
|
36
|
+
this.user = client.users.update(data.user ?? data.member.user);
|
|
37
|
+
}
|
|
38
|
+
/** The channel this interaction was sent from. */
|
|
39
|
+
get channel() {
|
|
40
|
+
return this._cachedChannel ?? (this._cachedChannel = this.client.getChannel(this.channelID));
|
|
41
|
+
}
|
|
42
|
+
/** The guild this interaction was sent from, if applicable. This will throw an error if the guild is not cached. */
|
|
43
|
+
get guild() {
|
|
44
|
+
if (this.guildID !== null && this._cachedGuild !== null) {
|
|
45
|
+
this._cachedGuild ?? (this._cachedGuild = this.client.guilds.get(this.guildID));
|
|
46
|
+
if (!this._cachedGuild) {
|
|
47
|
+
throw new Errors_1.UncachedError(this, "guild", "GUILDS", this.client);
|
|
48
|
+
}
|
|
49
|
+
return this._cachedGuild;
|
|
50
|
+
}
|
|
51
|
+
return this._cachedGuild === null ? this._cachedGuild : (this._cachedGuild = null);
|
|
52
|
+
}
|
|
53
|
+
/** 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. */
|
|
54
|
+
inCachedGuildChannel() {
|
|
55
|
+
return this.channel instanceof GuildChannel_1.default;
|
|
56
|
+
}
|
|
57
|
+
/** 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. */
|
|
58
|
+
inPrivateChannel() {
|
|
59
|
+
return this.guildID === null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Acknowledge this interaction with a set of choices. This is an initial response, and more than one initial response cannot be used.
|
|
63
|
+
* @param choices The choices to send.
|
|
64
|
+
*/
|
|
65
|
+
async result(choices) {
|
|
66
|
+
if (this.acknowledged) {
|
|
67
|
+
throw new TypeError("Interactions cannot have more than one initial response.");
|
|
68
|
+
}
|
|
69
|
+
this.acknowledged = true;
|
|
70
|
+
return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.APPLICATION_COMMAND_AUTOCOMPLETE_RESULT, data: { choices } }, true);
|
|
71
|
+
}
|
|
72
|
+
toJSON() {
|
|
73
|
+
return {
|
|
74
|
+
...super.toJSON(),
|
|
75
|
+
appPermissions: this.appPermissions.toJSON(),
|
|
76
|
+
attachmentSizeLimit: this.attachmentSizeLimit,
|
|
77
|
+
authorizingIntegrationOwners: this.authorizingIntegrationOwners,
|
|
78
|
+
channelID: this.channelID,
|
|
79
|
+
context: this.context,
|
|
80
|
+
data: this.data,
|
|
81
|
+
guildID: this.guildID ?? undefined,
|
|
82
|
+
guildLocale: this.guildLocale,
|
|
83
|
+
locale: this.locale,
|
|
84
|
+
member: this.member?.toJSON(),
|
|
85
|
+
type: this.type,
|
|
86
|
+
user: this.user.toJSON()
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.default = AutocompleteInteraction;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_util_1 = require("node:util");
|
|
4
|
+
const DISCORD_EPOCH = 1420070400000n;
|
|
5
|
+
/** A base class which most other classes extend. */
|
|
6
|
+
class Base {
|
|
7
|
+
constructor(id, client) {
|
|
8
|
+
this.id = id;
|
|
9
|
+
Object.defineProperty(this, "client", {
|
|
10
|
+
value: client,
|
|
11
|
+
enumerable: false,
|
|
12
|
+
writable: false,
|
|
13
|
+
configurable: false
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
static generateID(timestamp = Date.now()) {
|
|
17
|
+
if (timestamp instanceof Date) {
|
|
18
|
+
timestamp = timestamp.getTime();
|
|
19
|
+
}
|
|
20
|
+
const ms = BigInt(timestamp);
|
|
21
|
+
return ((ms - DISCORD_EPOCH) << 22n).toString();
|
|
22
|
+
}
|
|
23
|
+
static getCreatedAt(id) {
|
|
24
|
+
return new Date(Base.getDiscordEpoch(id) + Number(DISCORD_EPOCH));
|
|
25
|
+
}
|
|
26
|
+
static getDiscordEpoch(id) {
|
|
27
|
+
return Number(BigInt(id) / 4194304n);
|
|
28
|
+
}
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
|
|
30
|
+
update(data) { }
|
|
31
|
+
get createdAt() {
|
|
32
|
+
return Base.getCreatedAt(this.id);
|
|
33
|
+
}
|
|
34
|
+
/** @hidden */
|
|
35
|
+
[node_util_1.inspect.custom]() {
|
|
36
|
+
// https://stackoverflow.com/questions/5905492/dynamic-function-name-in-javascript
|
|
37
|
+
const copy = new { [this.constructor.name]: class {
|
|
38
|
+
} }[this.constructor.name]();
|
|
39
|
+
for (const key in this) {
|
|
40
|
+
if (Object.hasOwn(this, key) && !key.startsWith("_") && this[key] !== undefined) {
|
|
41
|
+
copy[key] = this[key];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return copy;
|
|
45
|
+
}
|
|
46
|
+
toJSON() {
|
|
47
|
+
return {
|
|
48
|
+
createdAt: this.createdAt.getTime(),
|
|
49
|
+
id: this.id
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
toString() {
|
|
53
|
+
return `[${this.constructor.name} ${this.id}]`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.default = Base;
|
|
@@ -0,0 +1,40 @@
|
|
|
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 Base_1 = __importDefault(require("./Base.cjs"));
|
|
7
|
+
/** Represents a base entitlement. See {@link TestEntitlement | TestEntitlement} and {@link Entitlement | Entitlement}. */
|
|
8
|
+
class BaseEntitlement extends Base_1.default {
|
|
9
|
+
constructor(data, client) {
|
|
10
|
+
super(data.id, client);
|
|
11
|
+
this.applicationID = data.application_id;
|
|
12
|
+
this.consumed = data.consumed;
|
|
13
|
+
this.deleted = data.deleted;
|
|
14
|
+
this.giftCodeFlags = data.gift_code_flags;
|
|
15
|
+
this.guildID = data.guild_id;
|
|
16
|
+
this.promotionID = data.promotion_id;
|
|
17
|
+
this.skuID = data.sku_id;
|
|
18
|
+
this.type = data.type;
|
|
19
|
+
this.userID = data.user_id;
|
|
20
|
+
}
|
|
21
|
+
/** Mark this entitlement as consumed. */
|
|
22
|
+
async consume() {
|
|
23
|
+
return this.client.rest.applications.consumeEntitlement(this.applicationID, this.id);
|
|
24
|
+
}
|
|
25
|
+
toJSON() {
|
|
26
|
+
return {
|
|
27
|
+
...super.toJSON(),
|
|
28
|
+
applicationID: this.applicationID,
|
|
29
|
+
consumed: this.consumed,
|
|
30
|
+
deleted: this.deleted,
|
|
31
|
+
giftCodeFlags: this.giftCodeFlags,
|
|
32
|
+
guildID: this.guildID,
|
|
33
|
+
promotionID: this.promotionID,
|
|
34
|
+
skuID: this.skuID,
|
|
35
|
+
type: this.type,
|
|
36
|
+
userID: this.userID
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.default = BaseEntitlement;
|
|
@@ -0,0 +1,102 @@
|
|
|
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 CategoryChannel */
|
|
7
|
+
const PermissionOverwrite_1 = __importDefault(require("./PermissionOverwrite.cjs"));
|
|
8
|
+
const GuildChannel_1 = __importDefault(require("./GuildChannel.cjs"));
|
|
9
|
+
const Permission_1 = __importDefault(require("./Permission.cjs"));
|
|
10
|
+
const Constants_1 = require("../Constants.cjs");
|
|
11
|
+
const TypedCollection_1 = __importDefault(require("../util/TypedCollection.cjs"));
|
|
12
|
+
const Errors_1 = require("../util/Errors.cjs");
|
|
13
|
+
const Collection_1 = __importDefault(require("../util/Collection.cjs"));
|
|
14
|
+
/** Represents a guild category channel. */
|
|
15
|
+
class CategoryChannel extends GuildChannel_1.default {
|
|
16
|
+
constructor(data, client) {
|
|
17
|
+
super(data, client);
|
|
18
|
+
this.permissionOverwrites = new TypedCollection_1.default(PermissionOverwrite_1.default, client);
|
|
19
|
+
this.position = data.position;
|
|
20
|
+
this.update(data);
|
|
21
|
+
}
|
|
22
|
+
update(data) {
|
|
23
|
+
super.update(data);
|
|
24
|
+
if (data.position !== undefined) {
|
|
25
|
+
this.position = data.position;
|
|
26
|
+
}
|
|
27
|
+
if (data.permission_overwrites !== undefined) {
|
|
28
|
+
for (const id of this.permissionOverwrites.keys()) {
|
|
29
|
+
if (!data.permission_overwrites.some(overwrite => overwrite.id === id)) {
|
|
30
|
+
this.permissionOverwrites.delete(id);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
for (const overwrite of data.permission_overwrites) {
|
|
34
|
+
this.permissionOverwrites.update(overwrite);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/** The channels in this category. The returned collection is disposable. */
|
|
39
|
+
get channels() {
|
|
40
|
+
return new Collection_1.default(this.guild.channels.filter(channel => channel.parentID === this.id).map(channel => [channel.id, channel]));
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Delete a permission overwrite on this channel.
|
|
44
|
+
* @param overwriteID The ID of the permission overwrite to delete.
|
|
45
|
+
* @param reason The reason for deleting the permission overwrite.
|
|
46
|
+
*/
|
|
47
|
+
async deletePermission(overwriteID, reason) {
|
|
48
|
+
return this.client.rest.channels.deletePermission(this.id, overwriteID, reason);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Edit a permission overwrite on this channel.
|
|
52
|
+
* @param overwriteID The ID of the permission overwrite to edit.
|
|
53
|
+
* @param options The options for editing the permission overwrite.
|
|
54
|
+
*/
|
|
55
|
+
async editPermission(overwriteID, options) {
|
|
56
|
+
return this.client.rest.channels.editPermission(this.id, overwriteID, options);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get the permissions of a member. If providing an id, the member must be cached.
|
|
60
|
+
* @param member The member to get the permissions of.
|
|
61
|
+
*/
|
|
62
|
+
permissionsOf(member) {
|
|
63
|
+
if (typeof member === "string") {
|
|
64
|
+
member = this.guild.members.get(member);
|
|
65
|
+
}
|
|
66
|
+
if (!member) {
|
|
67
|
+
throw new Errors_1.UncachedError(`Cannot use ${this.constructor.name}#permissionsOf with an ID when the member is not cached.`);
|
|
68
|
+
}
|
|
69
|
+
let permission = this.guild.permissionsOf(member).allow;
|
|
70
|
+
if (permission & Constants_1.Permissions.ADMINISTRATOR) {
|
|
71
|
+
return new Permission_1.default(Constants_1.AllPermissions);
|
|
72
|
+
}
|
|
73
|
+
let overwrite = this.permissionOverwrites.get(this.guildID);
|
|
74
|
+
if (overwrite) {
|
|
75
|
+
permission = (permission & ~overwrite.deny) | overwrite.allow;
|
|
76
|
+
}
|
|
77
|
+
let deny = 0n;
|
|
78
|
+
let allow = 0n;
|
|
79
|
+
for (const id of member.roles) {
|
|
80
|
+
if ((overwrite = this.permissionOverwrites.get(id))) {
|
|
81
|
+
deny |= overwrite.deny;
|
|
82
|
+
allow |= overwrite.allow;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
permission = (permission & ~deny) | allow;
|
|
86
|
+
overwrite = this.permissionOverwrites.get(member.id);
|
|
87
|
+
if (overwrite) {
|
|
88
|
+
permission = (permission & ~overwrite.deny) | overwrite.allow;
|
|
89
|
+
}
|
|
90
|
+
return new Permission_1.default(permission);
|
|
91
|
+
}
|
|
92
|
+
toJSON() {
|
|
93
|
+
return {
|
|
94
|
+
...super.toJSON(),
|
|
95
|
+
channels: this.channels.map(channel => channel.id),
|
|
96
|
+
permissionOverwrites: this.permissionOverwrites.map(overwrite => overwrite.toJSON()),
|
|
97
|
+
position: this.position,
|
|
98
|
+
type: this.type
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.default = CategoryChannel;
|
|
@@ -0,0 +1,89 @@
|
|
|
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 Channel */
|
|
7
|
+
const Base_1 = __importDefault(require("./Base.cjs"));
|
|
8
|
+
const Constants_1 = require("../Constants.cjs");
|
|
9
|
+
/** Represents a channel. */
|
|
10
|
+
class Channel extends Base_1.default {
|
|
11
|
+
constructor(data, client) {
|
|
12
|
+
super(data.id, client);
|
|
13
|
+
this.type = data.type;
|
|
14
|
+
}
|
|
15
|
+
static from(data, client) {
|
|
16
|
+
switch (data.type) {
|
|
17
|
+
case Constants_1.ChannelTypes.GUILD_TEXT: {
|
|
18
|
+
return new TextChannel(data, client);
|
|
19
|
+
}
|
|
20
|
+
case Constants_1.ChannelTypes.DM: {
|
|
21
|
+
return new PrivateChannel(data, client);
|
|
22
|
+
}
|
|
23
|
+
case Constants_1.ChannelTypes.GUILD_VOICE: {
|
|
24
|
+
return new VoiceChannel(data, client);
|
|
25
|
+
}
|
|
26
|
+
case Constants_1.ChannelTypes.GROUP_DM: {
|
|
27
|
+
return new GroupChannel(data, client);
|
|
28
|
+
}
|
|
29
|
+
case Constants_1.ChannelTypes.GUILD_CATEGORY: {
|
|
30
|
+
return new CategoryChannel(data, client);
|
|
31
|
+
}
|
|
32
|
+
case Constants_1.ChannelTypes.GUILD_ANNOUNCEMENT: {
|
|
33
|
+
return new AnnouncementChannel(data, client);
|
|
34
|
+
}
|
|
35
|
+
case Constants_1.ChannelTypes.ANNOUNCEMENT_THREAD: {
|
|
36
|
+
return new AnnouncementThreadChannel(data, client);
|
|
37
|
+
}
|
|
38
|
+
case Constants_1.ChannelTypes.PUBLIC_THREAD: {
|
|
39
|
+
return new PublicThreadChannel(data, client);
|
|
40
|
+
}
|
|
41
|
+
case Constants_1.ChannelTypes.PRIVATE_THREAD: {
|
|
42
|
+
return new PrivateThreadChannel(data, client);
|
|
43
|
+
}
|
|
44
|
+
case Constants_1.ChannelTypes.GUILD_STAGE_VOICE: {
|
|
45
|
+
return new StageChannel(data, client);
|
|
46
|
+
}
|
|
47
|
+
case Constants_1.ChannelTypes.GUILD_FORUM: {
|
|
48
|
+
return new ForumChannel(data, client);
|
|
49
|
+
}
|
|
50
|
+
case Constants_1.ChannelTypes.GUILD_MEDIA: {
|
|
51
|
+
return new MediaChannel(data, client);
|
|
52
|
+
}
|
|
53
|
+
default: {
|
|
54
|
+
return new Channel(data, client);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** A string that will mention this channel. */
|
|
59
|
+
get mention() {
|
|
60
|
+
return `<#${this.id}>`;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Close a direct message, leave a group channel, or delete a guild channel.
|
|
64
|
+
*/
|
|
65
|
+
async delete() {
|
|
66
|
+
await this.client.rest.channels.delete(this.id);
|
|
67
|
+
}
|
|
68
|
+
toJSON() {
|
|
69
|
+
return {
|
|
70
|
+
...super.toJSON(),
|
|
71
|
+
type: this.type
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.default = Channel;
|
|
76
|
+
// Yes this sucks, but it works. That's the important part. Circular imports are hell.
|
|
77
|
+
/* eslint-disable @typescript-eslint/no-var-requires, unicorn/prefer-module */
|
|
78
|
+
const TextChannel = require("./TextChannel.cjs").default;
|
|
79
|
+
const PrivateChannel = require("./PrivateChannel.cjs").default;
|
|
80
|
+
const VoiceChannel = require("./VoiceChannel.cjs").default;
|
|
81
|
+
const CategoryChannel = require("./CategoryChannel.cjs").default;
|
|
82
|
+
const GroupChannel = require("./GroupChannel.cjs").default;
|
|
83
|
+
const AnnouncementChannel = require("./AnnouncementChannel.cjs").default;
|
|
84
|
+
const PublicThreadChannel = require("./PublicThreadChannel.cjs").default;
|
|
85
|
+
const PrivateThreadChannel = require("./PrivateThreadChannel.cjs").default;
|
|
86
|
+
const AnnouncementThreadChannel = require("./AnnouncementThreadChannel.cjs").default;
|
|
87
|
+
const StageChannel = require("./StageChannel.cjs").default;
|
|
88
|
+
const ForumChannel = require("./ForumChannel.cjs").default;
|
|
89
|
+
const MediaChannel = require("./MediaChannel.cjs").default;
|
|
@@ -0,0 +1,269 @@
|
|
|
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 ClientApplication */
|
|
7
|
+
const Base_1 = __importDefault(require("./Base.cjs"));
|
|
8
|
+
const TestEntitlement_1 = __importDefault(require("./TestEntitlement.cjs"));
|
|
9
|
+
const Entitlement_1 = __importDefault(require("./Entitlement.cjs"));
|
|
10
|
+
const BaseEntitlement_1 = __importDefault(require("./BaseEntitlement.cjs"));
|
|
11
|
+
const TypedCollection_1 = __importDefault(require("../util/TypedCollection.cjs"));
|
|
12
|
+
/** A representation of the authorized client's application (typically received via gateway). */
|
|
13
|
+
class ClientApplication extends Base_1.default {
|
|
14
|
+
constructor(data, client) {
|
|
15
|
+
super(data.id, client);
|
|
16
|
+
this.entitlements = new TypedCollection_1.default(BaseEntitlement_1.default, client, Infinity, {
|
|
17
|
+
construct: (entitlement) => {
|
|
18
|
+
if ("subscription_id" in entitlement && entitlement.subscription_id) {
|
|
19
|
+
return new Entitlement_1.default(entitlement, client);
|
|
20
|
+
}
|
|
21
|
+
return new TestEntitlement_1.default(entitlement, client);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
this.flags = data.flags;
|
|
25
|
+
this.update(data);
|
|
26
|
+
}
|
|
27
|
+
update(data) {
|
|
28
|
+
if (data.flags !== undefined) {
|
|
29
|
+
this.flags = data.flags;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Overwrite all existing global application commands.
|
|
34
|
+
* @param options The commands.
|
|
35
|
+
*/
|
|
36
|
+
async bulkEditGlobalCommands(options) {
|
|
37
|
+
return this.client.rest.applications.bulkEditGlobalCommands(this.id, options);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Overwrite all existing application commands in a guild.
|
|
41
|
+
* @param guildID The ID of the guild.
|
|
42
|
+
* @param options The commands.
|
|
43
|
+
*/
|
|
44
|
+
async bulkEditGuildCommands(guildID, options) {
|
|
45
|
+
return this.client.rest.applications.bulkEditGuildCommands(this.id, guildID, options);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Mark an entitlement as consumed.
|
|
49
|
+
* @param entitlementID The ID of the entitlement to consume.
|
|
50
|
+
*/
|
|
51
|
+
async consumeEntitlement(entitlementID) {
|
|
52
|
+
return this.client.rest.applications.consumeEntitlement(this.id, entitlementID);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create an emoji for this application.
|
|
56
|
+
* @param options The options for creating the emoji.
|
|
57
|
+
* @caching This method **does not** cache its result.
|
|
58
|
+
*/
|
|
59
|
+
async createEmoji(options) {
|
|
60
|
+
return this.client.rest.applications.createEmoji(this.id, options);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Create a global application command.
|
|
64
|
+
* @param options The options for creating the command.
|
|
65
|
+
*/
|
|
66
|
+
async createGlobalCommand(options) {
|
|
67
|
+
return this.client.rest.applications.createGlobalCommand(this.id, options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Create a guild application command.
|
|
71
|
+
* @param guildID The ID of the guild.
|
|
72
|
+
* @param options The options for creating the command.
|
|
73
|
+
*/
|
|
74
|
+
async createGuildCommand(guildID, options) {
|
|
75
|
+
return this.client.rest.applications.createGuildCommand(this.id, guildID, options);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Create a test entitlement.
|
|
79
|
+
* @param options The options for creating the test entitlement.
|
|
80
|
+
*/
|
|
81
|
+
async createTestEntitlement(options) {
|
|
82
|
+
return this.client.rest.applications.createTestEntitlement(this.id, options);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Delete an emoji for this application.
|
|
86
|
+
* @param emojiID The ID of the emoji to be deleted.
|
|
87
|
+
* @caching This method **does not** cache its result.
|
|
88
|
+
*/
|
|
89
|
+
async deleteEmoji(emojiID) {
|
|
90
|
+
return this.client.rest.applications.deleteEmoji(this.id, emojiID);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Delete a global application command.
|
|
94
|
+
* @param commandID The ID of the command.
|
|
95
|
+
*/
|
|
96
|
+
async deleteGlobalCommand(commandID) {
|
|
97
|
+
return this.client.rest.applications.deleteGlobalCommand(this.id, commandID);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Delete a guild application command.
|
|
101
|
+
* @param guildID The ID of the guild.
|
|
102
|
+
* @param commandID The ID of the command.
|
|
103
|
+
*/
|
|
104
|
+
async deleteGuildCommand(guildID, commandID) {
|
|
105
|
+
return this.client.rest.applications.deleteGuildCommand(this.id, guildID, commandID);
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Delete a test entitlement.
|
|
109
|
+
* @param entitlementID The ID of the entitlement to delete.
|
|
110
|
+
*/
|
|
111
|
+
async deleteTestEntitlement(entitlementID) {
|
|
112
|
+
return this.client.rest.applications.deleteTestEntitlement(this.id, entitlementID);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Edit this application.
|
|
116
|
+
* @param options The options for editing the application.
|
|
117
|
+
*/
|
|
118
|
+
async edit(options) {
|
|
119
|
+
return this.client.rest.applications.editCurrent(options);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Edit an existing emoji for this application.
|
|
123
|
+
* @param emojiID The ID of the emoji to be edited.
|
|
124
|
+
* @param options The options for editing the emoji.
|
|
125
|
+
* @caching This method **does not** cache its result.
|
|
126
|
+
*/
|
|
127
|
+
async editEmoji(emojiID, options) {
|
|
128
|
+
return this.client.rest.applications.editEmoji(this.id, emojiID, options);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Edit a global application command.
|
|
132
|
+
* @param commandID The ID of the command.
|
|
133
|
+
* @param options The options for editing the command.
|
|
134
|
+
*/
|
|
135
|
+
async editGlobalCommand(commandID, options) {
|
|
136
|
+
return this.client.rest.applications.editGlobalCommand(this.id, commandID, options);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Edit a guild application command.
|
|
140
|
+
* @param guildID The ID of the guild.
|
|
141
|
+
* @param commandID The ID of the command.
|
|
142
|
+
* @param options The options for editing the command.
|
|
143
|
+
*/
|
|
144
|
+
async editGuildCommand(guildID, commandID, options) {
|
|
145
|
+
return this.client.rest.applications.editGuildCommand(this.id, guildID, commandID, options);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Edit a guild application command's permissions. This requires a bearer token with the `applications.commands.permissions.update` scope.
|
|
149
|
+
* @param guildID The ID of the guild.
|
|
150
|
+
* @param commandID The ID of the command.
|
|
151
|
+
* @param options The options for editing the permissions.
|
|
152
|
+
*/
|
|
153
|
+
async editGuildCommandPermissions(guildID, commandID, options) {
|
|
154
|
+
return this.client.rest.applications.editGuildCommandPermissions(this.id, guildID, commandID, options);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Get an activity instance.
|
|
158
|
+
* @param instanceID The ID of the instance.
|
|
159
|
+
*/
|
|
160
|
+
async getActivityInstance(instanceID) {
|
|
161
|
+
return this.client.rest.applications.getActivityInstance(this.id, instanceID);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Get an emoji for this application.
|
|
165
|
+
* @param emojiID The ID of the emoji to get.
|
|
166
|
+
*/
|
|
167
|
+
async getEmoji(emojiID) {
|
|
168
|
+
return this.client.rest.applications.getEmoji(this.id, emojiID);
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Get the emojis for this application.
|
|
172
|
+
*/
|
|
173
|
+
async getEmojis() {
|
|
174
|
+
return this.client.rest.applications.getEmojis(this.id);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Get the entitlements for this application.
|
|
178
|
+
* @param options The options for getting the entitlements.
|
|
179
|
+
*/
|
|
180
|
+
async getEntitlements(options = {}) {
|
|
181
|
+
return this.client.rest.applications.getEntitlements(this.id, options);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Get a global application command.
|
|
185
|
+
* @param commandID The ID of the command.
|
|
186
|
+
* @param options The options for getting the command.
|
|
187
|
+
*/
|
|
188
|
+
async getGlobalCommand(commandID, options) {
|
|
189
|
+
return this.client.rest.applications.getGlobalCommand(this.id, commandID, options);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Get this application's global commands.
|
|
193
|
+
* @param options The options for getting the command.
|
|
194
|
+
*/
|
|
195
|
+
async getGlobalCommands(options) {
|
|
196
|
+
return this.client.rest.applications.getGlobalCommands(this.id, options);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get a global application command.
|
|
200
|
+
* @param guildID The ID of the guild.
|
|
201
|
+
* @param commandID The ID of the command.
|
|
202
|
+
* @param options The options for getting the command.
|
|
203
|
+
*/
|
|
204
|
+
async getGuildCommand(guildID, commandID, options) {
|
|
205
|
+
return this.client.rest.applications.getGuildCommand(this.id, guildID, commandID, options);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Get this application's commands in a specific guild.
|
|
209
|
+
* @param guildID The ID of the guild.
|
|
210
|
+
* @param options The options for getting the command.
|
|
211
|
+
*/
|
|
212
|
+
async getGuildCommands(guildID, options) {
|
|
213
|
+
return this.client.rest.applications.getGuildCommands(this.id, guildID, options);
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Get a command's permissions in a guild.
|
|
217
|
+
* @param guildID The ID of the guild.
|
|
218
|
+
* @param commandID The ID of the command.
|
|
219
|
+
*/
|
|
220
|
+
async getGuildPermission(guildID, commandID) {
|
|
221
|
+
return this.client.rest.applications.getGuildPermission(this.id, guildID, commandID);
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Get the permissions for all commands in a guild.
|
|
225
|
+
* @param guildID The ID of the guild.
|
|
226
|
+
*/
|
|
227
|
+
async getGuildPermissions(guildID) {
|
|
228
|
+
return this.client.rest.applications.getGuildPermissions(this.id, guildID);
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Get this application's role connection metadata records.
|
|
232
|
+
*/
|
|
233
|
+
async getRoleConnectionsMetadata() {
|
|
234
|
+
return this.client.rest.oauth.getRoleConnectionsMetadata(this.id);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Get the SKUs for this application.
|
|
238
|
+
*/
|
|
239
|
+
async getSKUs() {
|
|
240
|
+
return this.client.rest.applications.getSKUs(this.id);
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Get the authenticated user's role connection object for this application. This requires the `role_connections.write` scope.
|
|
244
|
+
*/
|
|
245
|
+
async getUserRoleConnection() {
|
|
246
|
+
return this.client.rest.oauth.getUserRoleConnection(this.id);
|
|
247
|
+
}
|
|
248
|
+
toJSON() {
|
|
249
|
+
return {
|
|
250
|
+
...super.toJSON(),
|
|
251
|
+
flags: this.flags
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Update this application's role connections metadata.
|
|
256
|
+
* @param metadata The metadata records.
|
|
257
|
+
*/
|
|
258
|
+
async updateRoleConnectionsMetadata(metadata) {
|
|
259
|
+
return this.client.rest.oauth.updateRoleConnectionsMetadata(this.id, metadata);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Update the authenticated user's role connection object for an application. This requires the `role_connections.write` scope.
|
|
263
|
+
* @param data The metadata to update.
|
|
264
|
+
*/
|
|
265
|
+
async updateUserRoleConnection(data) {
|
|
266
|
+
return this.client.rest.oauth.updateUserRoleConnection(this.id, data);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
exports.default = ClientApplication;
|