oceanic.js 1.10.3-dev.c6c9f52 → 1.10.3-dev.ca8b6e8
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/dist/lib/Client.d.ts +99 -0
- package/dist/lib/Client.js +263 -0
- package/dist/lib/Constants.d.ts +1215 -0
- package/dist/lib/Constants.js +1513 -0
- package/dist/lib/gateway/Shard.d.ts +83 -0
- package/dist/lib/gateway/Shard.js +1621 -0
- package/dist/lib/gateway/ShardManager.d.ts +29 -0
- package/dist/lib/gateway/ShardManager.js +300 -0
- package/dist/lib/index.d.ts +84 -0
- package/dist/lib/index.js +168 -0
- package/dist/lib/rest/Bucket.d.ts +33 -0
- package/dist/lib/rest/Bucket.js +78 -0
- package/dist/lib/rest/DiscordHTTPError.d.ts +16 -0
- package/dist/lib/rest/DiscordHTTPError.js +65 -0
- package/dist/lib/rest/DiscordRESTError.d.ts +19 -0
- package/dist/lib/rest/DiscordRESTError.js +89 -0
- package/dist/lib/rest/OAuthHelper.d.ts +62 -0
- package/dist/lib/rest/OAuthHelper.js +183 -0
- package/dist/lib/rest/RESTManager.d.ts +42 -0
- package/dist/lib/rest/RESTManager.js +82 -0
- package/dist/lib/rest/RequestHandler.d.ts +28 -0
- package/dist/lib/rest/RequestHandler.js +313 -0
- package/dist/lib/rest/SequentialBucket.d.ts +25 -0
- package/dist/lib/rest/SequentialBucket.js +76 -0
- package/dist/lib/routes/Applications.d.ts +171 -0
- package/dist/lib/routes/Applications.js +447 -0
- package/dist/lib/routes/Channels.d.ts +408 -0
- package/dist/lib/routes/Channels.js +1160 -0
- package/dist/lib/routes/Guilds.d.ts +606 -0
- package/dist/lib/routes/Guilds.js +1669 -0
- package/dist/lib/routes/Interactions.d.ts +74 -0
- package/dist/lib/routes/Interactions.js +141 -0
- package/dist/lib/routes/Miscellaneous.d.ts +31 -0
- package/dist/lib/routes/Miscellaneous.js +69 -0
- package/dist/lib/routes/OAuth.d.ts +108 -0
- package/dist/lib/routes/OAuth.js +312 -0
- package/dist/lib/routes/Users.d.ts +32 -0
- package/dist/lib/routes/Users.js +59 -0
- package/dist/lib/routes/Webhooks.d.ts +128 -0
- package/dist/lib/routes/Webhooks.js +265 -0
- package/dist/lib/structures/AnnouncementChannel.d.ts +36 -0
- package/dist/lib/structures/AnnouncementChannel.js +47 -0
- package/dist/lib/structures/AnnouncementThreadChannel.d.ts +18 -0
- package/dist/lib/structures/AnnouncementThreadChannel.js +27 -0
- package/dist/lib/structures/Application.d.ts +102 -0
- package/dist/lib/structures/Application.js +189 -0
- package/dist/lib/structures/ApplicationCommand.d.ts +74 -0
- package/dist/lib/structures/ApplicationCommand.js +141 -0
- package/dist/lib/structures/Attachment.d.ts +34 -0
- package/dist/lib/structures/Attachment.js +64 -0
- package/dist/lib/structures/AuditLogEntry.d.ts +25 -0
- package/dist/lib/structures/AuditLogEntry.js +53 -0
- package/dist/lib/structures/AutoModerationRule.d.ts +49 -0
- package/dist/lib/structures/AutoModerationRule.js +139 -0
- package/dist/lib/structures/AutocompleteInteraction.d.ts +62 -0
- package/dist/lib/structures/AutocompleteInteraction.js +115 -0
- package/dist/lib/structures/Base.d.ts +20 -0
- package/dist/lib/structures/Base.js +58 -0
- package/dist/lib/structures/BaseEntitlement.d.ts +19 -0
- package/dist/lib/structures/BaseEntitlement.js +44 -0
- package/dist/lib/structures/CategoryChannel.d.ts +41 -0
- package/dist/lib/structures/CategoryChannel.js +105 -0
- package/dist/lib/structures/Channel.d.ts +20 -0
- package/dist/lib/structures/Channel.js +91 -0
- package/dist/lib/structures/ClientApplication.d.ts +153 -0
- package/dist/lib/structures/ClientApplication.js +220 -0
- package/dist/lib/structures/CommandInteraction.d.ts +127 -0
- package/dist/lib/structures/CommandInteraction.js +297 -0
- package/dist/lib/structures/ComponentInteraction.d.ts +137 -0
- package/dist/lib/structures/ComponentInteraction.js +311 -0
- package/dist/lib/structures/Entitlement.d.ts +12 -0
- package/dist/lib/structures/Entitlement.js +26 -0
- package/dist/lib/structures/ExtendedUser.d.ts +26 -0
- package/dist/lib/structures/ExtendedUser.js +57 -0
- package/dist/lib/structures/ForumChannel.d.ts +11 -0
- package/dist/lib/structures/ForumChannel.js +19 -0
- package/dist/lib/structures/GroupChannel.d.ts +62 -0
- package/dist/lib/structures/GroupChannel.js +133 -0
- package/dist/lib/structures/Guild.d.ts +654 -0
- package/dist/lib/structures/Guild.js +1319 -0
- package/dist/lib/structures/GuildChannel.d.ts +34 -0
- package/dist/lib/structures/GuildChannel.js +75 -0
- package/dist/lib/structures/GuildPreview.d.ts +50 -0
- package/dist/lib/structures/GuildPreview.js +119 -0
- package/dist/lib/structures/GuildScheduledEvent.d.ts +60 -0
- package/dist/lib/structures/GuildScheduledEvent.js +154 -0
- package/dist/lib/structures/GuildTemplate.d.ts +55 -0
- package/dist/lib/structures/GuildTemplate.js +126 -0
- package/dist/lib/structures/Integration.d.ts +54 -0
- package/dist/lib/structures/Integration.js +156 -0
- package/dist/lib/structures/Interaction.d.ts +40 -0
- package/dist/lib/structures/Interaction.js +90 -0
- package/dist/lib/structures/InteractionResolvedChannel.d.ts +28 -0
- package/dist/lib/structures/InteractionResolvedChannel.js +45 -0
- package/dist/lib/structures/Invite.d.ts +64 -0
- package/dist/lib/structures/Invite.js +193 -0
- package/dist/lib/structures/InviteGuild.d.ts +52 -0
- package/dist/lib/structures/InviteGuild.js +88 -0
- package/dist/lib/structures/MediaChannel.d.ts +11 -0
- package/dist/lib/structures/MediaChannel.js +19 -0
- package/dist/lib/structures/Member.d.ts +122 -0
- package/dist/lib/structures/Member.js +255 -0
- package/dist/lib/structures/Message.d.ts +194 -0
- package/dist/lib/structures/Message.js +477 -0
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +128 -0
- package/dist/lib/structures/ModalSubmitInteraction.js +240 -0
- package/dist/lib/structures/OAuthApplication.d.ts +79 -0
- package/dist/lib/structures/OAuthApplication.js +210 -0
- package/dist/lib/structures/OAuthGuild.d.ts +35 -0
- package/dist/lib/structures/OAuthGuild.js +61 -0
- package/dist/lib/structures/PartialApplication.d.ts +30 -0
- package/dist/lib/structures/PartialApplication.js +67 -0
- package/dist/lib/structures/Permission.d.ts +21 -0
- package/dist/lib/structures/Permission.js +68 -0
- package/dist/lib/structures/PermissionOverwrite.d.ts +26 -0
- package/dist/lib/structures/PermissionOverwrite.js +49 -0
- package/dist/lib/structures/PingInteraction.d.ts +16 -0
- package/dist/lib/structures/PingInteraction.js +26 -0
- package/dist/lib/structures/Poll.d.ts +28 -0
- package/dist/lib/structures/Poll.js +78 -0
- package/dist/lib/structures/PrivateChannel.d.ts +90 -0
- package/dist/lib/structures/PrivateChannel.js +131 -0
- package/dist/lib/structures/PrivateThreadChannel.d.ts +18 -0
- package/dist/lib/structures/PrivateThreadChannel.js +27 -0
- package/dist/lib/structures/PublicThreadChannel.d.ts +21 -0
- package/dist/lib/structures/PublicThreadChannel.js +37 -0
- package/dist/lib/structures/Role.d.ts +52 -0
- package/dist/lib/structures/Role.js +137 -0
- package/dist/lib/structures/SKU.d.ts +32 -0
- package/dist/lib/structures/SKU.js +53 -0
- package/dist/lib/structures/StageChannel.d.ts +33 -0
- package/dist/lib/structures/StageChannel.js +44 -0
- package/dist/lib/structures/StageInstance.d.ts +36 -0
- package/dist/lib/structures/StageInstance.js +94 -0
- package/dist/lib/structures/Team.d.ts +22 -0
- package/dist/lib/structures/Team.js +67 -0
- package/dist/lib/structures/TestEntitlement.d.ts +10 -0
- package/dist/lib/structures/TestEntitlement.js +21 -0
- package/dist/lib/structures/TextChannel.d.ts +34 -0
- package/dist/lib/structures/TextChannel.js +46 -0
- package/dist/lib/structures/TextableChannel.d.ts +158 -0
- package/dist/lib/structures/TextableChannel.js +276 -0
- package/dist/lib/structures/TextableVoiceChannel.d.ts +39 -0
- package/dist/lib/structures/TextableVoiceChannel.js +81 -0
- package/dist/lib/structures/ThreadChannel.d.ts +159 -0
- package/dist/lib/structures/ThreadChannel.js +295 -0
- package/dist/lib/structures/ThreadOnlyChannel.d.ts +99 -0
- package/dist/lib/structures/ThreadOnlyChannel.js +233 -0
- package/dist/lib/structures/ThreadableChannel.d.ts +36 -0
- package/dist/lib/structures/ThreadableChannel.js +58 -0
- package/dist/lib/structures/UnavailableGuild.d.ts +11 -0
- package/dist/lib/structures/UnavailableGuild.js +21 -0
- package/dist/lib/structures/User.d.ts +82 -0
- package/dist/lib/structures/User.js +168 -0
- package/dist/lib/structures/VoiceChannel.d.ts +20 -0
- package/dist/lib/structures/VoiceChannel.js +35 -0
- package/dist/lib/structures/VoiceState.d.ts +51 -0
- package/dist/lib/structures/VoiceState.js +140 -0
- package/dist/lib/structures/Webhook.d.ts +129 -0
- package/dist/lib/structures/Webhook.js +206 -0
- package/dist/lib/types/applications.d.ts +466 -0
- package/dist/lib/types/audit-log.d.ts +122 -0
- package/dist/lib/types/auto-moderation.d.ts +99 -0
- package/dist/lib/types/channels.d.ts +1244 -0
- package/dist/lib/types/client.d.ts +228 -0
- package/dist/lib/types/events.d.ts +265 -0
- package/dist/lib/types/gateway-raw.d.ts +584 -0
- package/dist/lib/types/gateway.d.ts +351 -0
- package/dist/lib/types/guild-template.d.ts +33 -0
- package/dist/lib/types/guilds.d.ts +855 -0
- package/dist/lib/types/index.d.ts +18 -0
- package/dist/lib/types/interactions.d.ts +377 -0
- package/dist/lib/types/json.d.ts +742 -0
- package/dist/lib/types/misc.d.ts +28 -0
- package/dist/lib/types/oauth.d.ts +201 -0
- package/dist/lib/types/request-handler.d.ts +52 -0
- package/dist/lib/types/scheduled-events.d.ts +88 -0
- package/dist/lib/types/shared.d.ts +9 -0
- package/dist/lib/types/users.d.ts +45 -0
- package/dist/lib/types/voice.d.ts +45 -0
- package/dist/lib/types/webhooks.d.ts +74 -0
- package/dist/lib/util/Collection.d.ts +47 -0
- package/dist/lib/util/Collection.js +78 -0
- package/dist/lib/util/Errors.d.ts +29 -0
- package/dist/lib/util/Errors.js +56 -0
- package/dist/lib/util/Routes.d.ts +127 -0
- package/dist/lib/util/Routes.js +248 -0
- package/dist/lib/util/SimpleCollection.d.ts +12 -0
- package/dist/lib/util/SimpleCollection.js +81 -0
- package/dist/lib/util/TypedCollection.d.ts +24 -0
- package/dist/lib/util/TypedCollection.js +76 -0
- package/dist/lib/util/TypedEmitter.d.ts +19 -0
- package/dist/lib/util/TypedEmitter.js +19 -0
- package/dist/lib/util/Util.d.ts +58 -0
- package/dist/lib/util/Util.js +535 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.d.ts +170 -0
- package/dist/lib/util/interactions/InteractionOptionsWrapper.js +213 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +24 -0
- package/dist/lib/util/interactions/MessageInteractionResponse.js +28 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.d.ts +24 -0
- package/dist/lib/util/interactions/ModalSubmitInteractionComponentsWrapper.js +34 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.d.ts +60 -0
- package/dist/lib/util/interactions/SelectMenuValuesWrapper.js +124 -0
- package/dist/package.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/** @module OAuthGuild */
|
|
5
|
+
const Base_1 = tslib_1.__importDefault(require("./Base"));
|
|
6
|
+
const Permission_1 = tslib_1.__importDefault(require("./Permission"));
|
|
7
|
+
const Routes = tslib_1.__importStar(require("../util/Routes"));
|
|
8
|
+
/** Represents a guild retrieved via oauth. */
|
|
9
|
+
class OAuthGuild extends Base_1.default {
|
|
10
|
+
_cachedCompleteGuild;
|
|
11
|
+
/** The approximate number of members in this guild (if retrieved with counts). */
|
|
12
|
+
approximateMemberCount;
|
|
13
|
+
/** The approximate number of non-offline members in this guild (if retrieved with counts). */
|
|
14
|
+
approximatePresenceCount;
|
|
15
|
+
/** The [features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) this guild has. */
|
|
16
|
+
features;
|
|
17
|
+
/** The icon hash of this guild. */
|
|
18
|
+
icon;
|
|
19
|
+
/** The name of this guild. */
|
|
20
|
+
name;
|
|
21
|
+
/** If the user is the owner of this guild. */
|
|
22
|
+
owner;
|
|
23
|
+
/** The permissions of the user in this guild. */
|
|
24
|
+
permissions;
|
|
25
|
+
constructor(data, client) {
|
|
26
|
+
super(data.id, client);
|
|
27
|
+
this.approximateMemberCount = data.approximate_member_count;
|
|
28
|
+
this.approximatePresenceCount = data.approximate_presence_count;
|
|
29
|
+
this.features = data.features;
|
|
30
|
+
this.name = data.name;
|
|
31
|
+
this.icon = data.icon;
|
|
32
|
+
this.owner = data.owner;
|
|
33
|
+
this.permissions = new Permission_1.default(data.permissions);
|
|
34
|
+
}
|
|
35
|
+
/** The complete guild this OAuthGuild represents, if cached. */
|
|
36
|
+
get completeGuild() {
|
|
37
|
+
return this._cachedCompleteGuild ??= this.client.guilds.get(this.id);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The url of this guild's icon.
|
|
41
|
+
* @param format The format the url should be.
|
|
42
|
+
* @param size The dimensions of the image.
|
|
43
|
+
*/
|
|
44
|
+
iconURL(format, size) {
|
|
45
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.GUILD_ICON(this.id, this.icon), format, size);
|
|
46
|
+
}
|
|
47
|
+
toJSON() {
|
|
48
|
+
return {
|
|
49
|
+
...super.toJSON(),
|
|
50
|
+
approximateMemberCount: this.approximateMemberCount,
|
|
51
|
+
approximatePresenceCount: this.approximatePresenceCount,
|
|
52
|
+
features: this.features,
|
|
53
|
+
icon: this.icon,
|
|
54
|
+
name: this.name,
|
|
55
|
+
owner: this.owner,
|
|
56
|
+
permissions: this.permissions.toJSON()
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.default = OAuthGuild;
|
|
61
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiT0F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Cw2QkFxREMifQ==
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @module PartialApplication */
|
|
2
|
+
import Base from "./Base";
|
|
3
|
+
import type Client from "../Client";
|
|
4
|
+
import type { ImageFormat } from "../Constants";
|
|
5
|
+
import type { RawPartialApplication } from "../types/applications";
|
|
6
|
+
import type { JSONPartialApplication } from "../types/json";
|
|
7
|
+
/** Represents a partial application. */
|
|
8
|
+
export default class PartialApplication extends Base {
|
|
9
|
+
/** When false, only the application's owners can invite the bot to guilds. */
|
|
10
|
+
botPublic?: boolean;
|
|
11
|
+
/** When true, the applications bot will only join upon the completion of the full oauth2 code grant flow. */
|
|
12
|
+
botRequireCodeGrant?: boolean;
|
|
13
|
+
/** The description of the application. */
|
|
14
|
+
description: string;
|
|
15
|
+
/** The icon hash of the application. */
|
|
16
|
+
icon: string | null;
|
|
17
|
+
/** The name of the application. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** The bot's hex encoded public key. */
|
|
20
|
+
verifyKey?: string;
|
|
21
|
+
constructor(data: RawPartialApplication, client: Client);
|
|
22
|
+
protected update(data: RawPartialApplication): void;
|
|
23
|
+
/**
|
|
24
|
+
* The url of this application's icon.
|
|
25
|
+
* @param format The format the url should be.
|
|
26
|
+
* @param size The dimensions of the image.
|
|
27
|
+
*/
|
|
28
|
+
iconURL(format?: ImageFormat, size?: number): string | null;
|
|
29
|
+
toJSON(): JSONPartialApplication;
|
|
30
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/** @module PartialApplication */
|
|
5
|
+
const Base_1 = tslib_1.__importDefault(require("./Base"));
|
|
6
|
+
const Routes = tslib_1.__importStar(require("../util/Routes"));
|
|
7
|
+
/** Represents a partial application. */
|
|
8
|
+
class PartialApplication extends Base_1.default {
|
|
9
|
+
/** When false, only the application's owners can invite the bot to guilds. */
|
|
10
|
+
botPublic;
|
|
11
|
+
/** When true, the applications bot will only join upon the completion of the full oauth2 code grant flow. */
|
|
12
|
+
botRequireCodeGrant;
|
|
13
|
+
/** The description of the application. */
|
|
14
|
+
description;
|
|
15
|
+
/** The icon hash of the application. */
|
|
16
|
+
icon;
|
|
17
|
+
/** The name of the application. */
|
|
18
|
+
name;
|
|
19
|
+
/** The bot's hex encoded public key. */
|
|
20
|
+
verifyKey;
|
|
21
|
+
constructor(data, client) {
|
|
22
|
+
super(data.id, client);
|
|
23
|
+
this.description = data.description;
|
|
24
|
+
this.icon = null;
|
|
25
|
+
this.name = data.name;
|
|
26
|
+
this.verifyKey = data.verify_key;
|
|
27
|
+
this.update(data);
|
|
28
|
+
}
|
|
29
|
+
update(data) {
|
|
30
|
+
if (data.bot_public !== undefined) {
|
|
31
|
+
this.botPublic = data.bot_public;
|
|
32
|
+
}
|
|
33
|
+
if (data.bot_require_code_grant !== undefined) {
|
|
34
|
+
this.botRequireCodeGrant = data.bot_require_code_grant;
|
|
35
|
+
}
|
|
36
|
+
if (data.description !== undefined) {
|
|
37
|
+
this.description = data.description;
|
|
38
|
+
}
|
|
39
|
+
if (data.icon !== undefined) {
|
|
40
|
+
this.icon = data.icon;
|
|
41
|
+
}
|
|
42
|
+
if (data.name !== undefined) {
|
|
43
|
+
this.name = data.name;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The url of this application's icon.
|
|
48
|
+
* @param format The format the url should be.
|
|
49
|
+
* @param size The dimensions of the image.
|
|
50
|
+
*/
|
|
51
|
+
iconURL(format, size) {
|
|
52
|
+
return this.icon === null ? null : this.client.util.formatImage(Routes.APPLICATION_COVER(this.id, this.icon), format, size);
|
|
53
|
+
}
|
|
54
|
+
toJSON() {
|
|
55
|
+
return {
|
|
56
|
+
...super.toJSON(),
|
|
57
|
+
botPublic: this.botPublic,
|
|
58
|
+
botRequireCodeGrant: this.botRequireCodeGrant,
|
|
59
|
+
description: this.description,
|
|
60
|
+
icon: this.icon,
|
|
61
|
+
name: this.name,
|
|
62
|
+
verifyKey: this.verifyKey
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.default = PartialApplication;
|
|
67
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGFydGlhbEFwcGxpY2F0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3N0cnVjdHVyZXMvUGFydGlhbEFwcGxpY2F0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLGlDQUFpQztBQUNqQywwREFBMEI7QUFHMUIsK0RBQXlDO0FBSXpDLHdDQUF3QztBQUN4QyxNQUFxQixrQkFBbUIsU0FBUSxjQUFJO0lBQ2hELDhFQUE4RTtJQUM5RSxTQUFTLENBQVc7SUFDcEIsNkdBQTZHO0lBQzdHLG1CQUFtQixDQUFXO0lBQzlCLDBDQUEwQztJQUMxQyxXQUFXLENBQVM7SUFDcEIsd0NBQXdDO0lBQ3hDLElBQUksQ0FBZ0I7SUFDcEIsbUNBQW1DO0lBQ25DLElBQUksQ0FBUztJQUNiLHdDQUF3QztJQUN4QyxTQUFTLENBQVU7SUFDbkIsWUFBWSxJQUEyQixFQUFFLE1BQWM7UUFDbkQsS0FBSyxDQUFDLElBQUksQ0FBQyxFQUFFLEVBQUUsTUFBTSxDQUFDLENBQUM7UUFDdkIsSUFBSSxDQUFDLFdBQVcsR0FBRyxJQUFJLENBQUMsV0FBVyxDQUFDO1FBQ3BDLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDO1FBQ2pCLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxDQUFDLElBQUksQ0FBQztRQUN0QixJQUFJLENBQUMsU0FBUyxHQUFHLElBQUksQ0FBQyxVQUFVLENBQUM7UUFDakMsSUFBSSxDQUFDLE1BQU0sQ0FBQyx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1BQU0sRUFBRSxJQUFJLENBQUMsQ0FBQztJQUNoSSxDQUFDO0lBRVEsTUFBTTtRQUNYLE9BQU87WUFDSCxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUU7WUFDakIsU0FBUyxFQUFZLElBQUksQ0FBQyxTQUFTO1lBQ25DLG1CQUFtQixFQUFFLElBQUksQ0FBQyxtQkFBbUI7WUFDN0MsV0FBVyxFQUFVLElBQUksQ0FBQyxXQUFXO1lBQ3JDLElBQUksRUFBaUIsSUFBSSxDQUFDLElBQUk7WUFDOUIsSUFBSSxFQUFpQixJQUFJLENBQUMsSUFBSTtZQUM5QixTQUFTLEVBQVksSUFBSSxDQUFDLFNBQVM7U0FDdEMsQ0FBQztJQUNOLENBQUM7Q0FDSjtBQTVERCxxQ0E0REMifQ==
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @module Permission */
|
|
2
|
+
import { Permissions, type PermissionName as PermissionNames } from "../Constants";
|
|
3
|
+
import type { JSONPermission } from "../types/json";
|
|
4
|
+
/** Represents a permission. */
|
|
5
|
+
export default class Permission {
|
|
6
|
+
private _json;
|
|
7
|
+
/** The allowed permissions for this permission instance. */
|
|
8
|
+
allow: bigint;
|
|
9
|
+
/** The denied permissions for this permission instance. */
|
|
10
|
+
deny: bigint;
|
|
11
|
+
constructor(allow: bigint | string, deny?: bigint | string);
|
|
12
|
+
/** A key-value map of permission to if it's been allowed or denied (not present if neither) */
|
|
13
|
+
get json(): Partial<Record<keyof typeof Permissions, boolean>>;
|
|
14
|
+
/**
|
|
15
|
+
* Check if this permissions instance has the given permissions allowed
|
|
16
|
+
* @param permissions The permissions to check for.
|
|
17
|
+
*/
|
|
18
|
+
has(...permissions: Array<PermissionNames | bigint>): boolean;
|
|
19
|
+
toJSON(): JSONPermission;
|
|
20
|
+
toString(): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/** @module Permission */
|
|
4
|
+
const Constants_1 = require("../Constants");
|
|
5
|
+
/** Represents a permission. */
|
|
6
|
+
class Permission {
|
|
7
|
+
_json;
|
|
8
|
+
/** The allowed permissions for this permission instance. */
|
|
9
|
+
allow;
|
|
10
|
+
/** The denied permissions for this permission instance. */
|
|
11
|
+
deny;
|
|
12
|
+
constructor(allow, deny = 0n) {
|
|
13
|
+
this.allow = BigInt(allow);
|
|
14
|
+
this.deny = BigInt(deny);
|
|
15
|
+
Object.defineProperty(this, "#json", {
|
|
16
|
+
value: undefined,
|
|
17
|
+
enumerable: false,
|
|
18
|
+
writable: true,
|
|
19
|
+
configurable: false
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** A key-value map of permission to if it's been allowed or denied (not present if neither) */
|
|
23
|
+
get json() {
|
|
24
|
+
if (this._json) {
|
|
25
|
+
return this._json;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
const json = {};
|
|
29
|
+
for (const perm of Object.keys(Constants_1.Permissions)) {
|
|
30
|
+
if (this.allow & Constants_1.Permissions[perm]) {
|
|
31
|
+
json[perm] = true;
|
|
32
|
+
}
|
|
33
|
+
else if (this.deny & Constants_1.Permissions[perm]) {
|
|
34
|
+
json[perm] = false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return (this._json = json);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if this permissions instance has the given permissions allowed
|
|
42
|
+
* @param permissions The permissions to check for.
|
|
43
|
+
*/
|
|
44
|
+
has(...permissions) {
|
|
45
|
+
for (const perm of permissions) {
|
|
46
|
+
if (typeof perm === "bigint") {
|
|
47
|
+
if ((this.allow & perm) !== perm) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
else if (!(this.allow & Constants_1.Permissions[perm])) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
toJSON() {
|
|
58
|
+
return {
|
|
59
|
+
allow: this.allow.toString(),
|
|
60
|
+
deny: this.deny.toString()
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
toString() {
|
|
64
|
+
return `[${this.constructor.name} +${this.allow} -${this.deny}]`;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.default = Permission;
|
|
68
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGVybWlzc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL1Blcm1pc3Npb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx5QkFBeUI7QUFDekIsNENBQW1GO0FBR25GLCtCQUErQjtBQUMvQixNQUFxQixVQUFVO0lBQ25CLEtBQUssQ0FBaUU7SUFDOUUsNERBQTREO0lBQzVELEtBQUssQ0FBUztJQUNkLDJEQUEyRDtJQUMzRCxJQUFJLENBQVM7SUFDYixZQUFZLEtBQXNCLEVBQUUsT0FBd0IsRUFBRTtRQUMxRCxJQUFJLENBQUMsS0FBSyxHQUFHLE1BQU0sQ0FBQyxLQUFLLENBQUMsQ0FBQztRQUMzQixJQUFJLENBQUMsSUFBSSxHQUFHLE1BQU0sQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUN6QixNQUFNLENBQUMsY0FBYyxDQUFDLElBQUksRUFBRSxPQUFPLEVBQUU7WUFDakMsS0FBSyxFQUFTLFNBQVM7WUFDdkIsVUFBVSxFQUFJLEtBQUs7WUFDbkIsUUFBUSxFQUFNLElBQUk7WUFDbEIsWUFBWSxFQUFFLEtBQUs7U0FDdEIsQ0FBQyxDQUFDO0lBQ1AsQ0FBQztJQUVELCtGQUErRjtJQUMvRixJQUFJLElBQUk7UUFDSixJQUFJLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FB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BSyxDQUFDO1lBQ2pCLENBQUM7UUFDTCxDQUFDO1FBRUQsT0FBTyxJQUFJLENBQUM7SUFDaEIsQ0FBQztJQUVELE1BQU07UUFDRixPQUFPO1lBQ0gsS0FBSyxFQUFFLElBQUksQ0FBQyxLQUFLLENBQUMsUUFBUSxFQUFFO1lBQzVCLElBQUksRUFBRyxJQUFJLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRTtTQUM5QixDQUFDO0lBQ04sQ0FBQztJQUVELFFBQVE7UUFDSixPQUFPLElBQUksSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLEtBQUssSUFBSSxDQUFDLEtBQUssS0FBSyxJQUFJLENBQUMsSUFBSSxHQUFHLENBQUM7SUFDckUsQ0FBQztDQUNKO0FBL0RELDZCQStEQyJ9
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** @module PermissionOverwrite */
|
|
2
|
+
import Base from "./Base";
|
|
3
|
+
import Permission from "./Permission";
|
|
4
|
+
import type { OverwriteTypes, PermissionName as PermissionNames, Permissions } from "../Constants";
|
|
5
|
+
import type Client from "../Client";
|
|
6
|
+
import type { RawOverwrite } from "../types/channels";
|
|
7
|
+
import type { JSONPermissionOverwrite } from "../types/json";
|
|
8
|
+
/** Represents a permission overwrite. */
|
|
9
|
+
export default class PermissionOverwrite extends Base {
|
|
10
|
+
/** The permissions of this overwrite. */
|
|
11
|
+
permission: Permission;
|
|
12
|
+
/** The type of this overwrite. `0` for role, `1` for user. */
|
|
13
|
+
type: OverwriteTypes;
|
|
14
|
+
constructor(data: RawOverwrite, client: Client);
|
|
15
|
+
protected update(data: Partial<RawOverwrite>): void;
|
|
16
|
+
get allow(): bigint;
|
|
17
|
+
get deny(): bigint;
|
|
18
|
+
/** A key-value map of permission to if it's been allowed or denied (not present if neither) */
|
|
19
|
+
get json(): Partial<Record<keyof typeof Permissions, boolean>>;
|
|
20
|
+
/**
|
|
21
|
+
*Check if this permissions instance has the given permissions allowed
|
|
22
|
+
* @param permissions The permissions to check for.
|
|
23
|
+
*/
|
|
24
|
+
has(...permissions: Array<PermissionNames | bigint>): boolean;
|
|
25
|
+
toJSON(): JSONPermissionOverwrite;
|
|
26
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/** @module PermissionOverwrite */
|
|
5
|
+
const Base_1 = tslib_1.__importDefault(require("./Base"));
|
|
6
|
+
const Permission_1 = tslib_1.__importDefault(require("./Permission"));
|
|
7
|
+
/** Represents a permission overwrite. */
|
|
8
|
+
class PermissionOverwrite extends Base_1.default {
|
|
9
|
+
/** The permissions of this overwrite. */
|
|
10
|
+
permission;
|
|
11
|
+
/** The type of this overwrite. `0` for role, `1` for user. */
|
|
12
|
+
type;
|
|
13
|
+
constructor(data, client) {
|
|
14
|
+
super(data.id, client);
|
|
15
|
+
this.permission = new Permission_1.default(data.allow, data.deny);
|
|
16
|
+
this.type = data.type;
|
|
17
|
+
}
|
|
18
|
+
update(data) {
|
|
19
|
+
if (data.allow !== undefined || data.deny !== undefined) {
|
|
20
|
+
this.permission = new Permission_1.default(data.allow ?? 0n, data.deny ?? 0n);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
get allow() {
|
|
24
|
+
return this.permission.allow;
|
|
25
|
+
}
|
|
26
|
+
get deny() {
|
|
27
|
+
return this.permission.deny;
|
|
28
|
+
}
|
|
29
|
+
/** A key-value map of permission to if it's been allowed or denied (not present if neither) */
|
|
30
|
+
get json() {
|
|
31
|
+
return this.permission.json;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
*Check if this permissions instance has the given permissions allowed
|
|
35
|
+
* @param permissions The permissions to check for.
|
|
36
|
+
*/
|
|
37
|
+
has(...permissions) {
|
|
38
|
+
return this.permission.has(...permissions);
|
|
39
|
+
}
|
|
40
|
+
toJSON() {
|
|
41
|
+
return {
|
|
42
|
+
...super.toJSON(),
|
|
43
|
+
permission: this.permission.toJSON(),
|
|
44
|
+
type: this.type
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = PermissionOverwrite;
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGVybWlzc2lvbk92ZXJ3cml0ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL1Blcm1pc3Npb25PdmVyd3JpdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsa0NBQWtDO0FBQ2xDLDBEQUEwQjtBQUMxQixzRUFBc0M7QUFNdEMseUNBQXlDO0FBQ3pDLE1BQXFCLG1CQUFvQixTQUFRLGNBQUk7SUFDakQseUNBQXlDO0lBQ3pDLFVBQVUsQ0FBYTtJQUN2Qiw4REFBOEQ7SUFDOUQsSUFBSSxDQUFpQjtJQUNyQixZQUFZLElBQWtCLEVBQUUsTUFBYztRQUMxQyxLQUFLLENBQUMsSUFBSSxDQUFDLEVBQUUsRUFBRSxNQUFNLENBQUMsQ0FBQztRQUN2QixJQUFJLENBQUMsVUFBVSxHQUFHLElBQUksb0JBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUN4RCxJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQyxJQUFJLENBQUM7SUFDMUIsQ0FBQztJQUVrQixNQUFNLENBQUMsSUFBMkI7UUFDakQsSUFBSSxJQUFJLENBQUMsS0FBSyxLQUFLLFNBQVMsSUFBSSxJQUFJLENBQUMsSUFBSSxLQUFLLFNBQVMsRUFBRSxDQUFDO1lBQ3RELElBQUksQ0FBQyxVQUFVLEdBQUcsSUFBSSxvQkFBVSxDQUFDLElBQUksQ0FBQyxLQUFLLElBQUksRUFBRSxFQUFFLElBQUksQ0FBQyxJQUFJLElBQUksRUFBRSxDQUFDLENBQUM7UUFDeEUsQ0FBQztJQUNMLENBQUM7SUFFRCxJQUFJLEtBQUs7UUFDTCxPQUFPLElBQUksQ0FBQyxVQUFVLENBQUMsS0FBSyxDQUFDO0lBQ2pDLENBQUM7SUFDRCxJQUFJLElBQUk7UUFDSixPQUFPLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxDQUFDO0lBQ2hDLENBQUM7SUFFRCwrRkFBK0Y7SUFDL0YsSUFBSSxJQUFJO1FBQ0osT0FBTyxJQUFJLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQztJQUNoQyxDQUFDO0lBRUQ7OztPQUdHO0lBQ0gsR0FBRyxDQUFDLEdBQUcsV0FBNEM7UUFDL0MsT0FBTyxJQUFJLENBQUMsVUFBVSxDQUFDLEdBQUcsQ0FBQyxHQUFHLFdBQVcsQ0FBQyxDQUFDO0lBQy9DLENBQUM7SUFFUSxNQUFNO1FBQ1gsT0FBTztZQUNILEdBQUcsS0FBSyxDQUFDLE1BQU0sRUFBRTtZQUNqQixVQUFVLEVBQUUsSUFBSSxDQUFDLFVBQVUsQ0FBQyxNQUFNLEVBQUU7WUFDcEMsSUFBSSxFQUFRLElBQUksQ0FBQyxJQUFJO1NBQ3hCLENBQUM7SUFDTixDQUFDO0NBQ0o7QUE1Q0Qsc0NBNENDIn0=
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @module PingInteraction */
|
|
2
|
+
import Interaction from "./Interaction";
|
|
3
|
+
import { type InteractionTypes } from "../Constants";
|
|
4
|
+
import type { RawPingInteraction } from "../types/interactions";
|
|
5
|
+
import type Client from "../Client";
|
|
6
|
+
import type { JSONPingInteraction } from "../types/json";
|
|
7
|
+
/** Represents a PING interaction. This will not be received over a gateway connection. */
|
|
8
|
+
export default class PingInteraction extends Interaction {
|
|
9
|
+
type: InteractionTypes.PING;
|
|
10
|
+
constructor(data: RawPingInteraction, client: Client);
|
|
11
|
+
/**
|
|
12
|
+
* Responds to the interaction with a `PONG`.
|
|
13
|
+
*/
|
|
14
|
+
pong(): Promise<void>;
|
|
15
|
+
toJSON(): JSONPingInteraction;
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
/** @module PingInteraction */
|
|
5
|
+
const Interaction_1 = tslib_1.__importDefault(require("./Interaction"));
|
|
6
|
+
const Constants_1 = require("../Constants");
|
|
7
|
+
/** Represents a PING interaction. This will not be received over a gateway connection. */
|
|
8
|
+
class PingInteraction extends Interaction_1.default {
|
|
9
|
+
constructor(data, client) {
|
|
10
|
+
super(data, client);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Responds to the interaction with a `PONG`.
|
|
14
|
+
*/
|
|
15
|
+
async pong() {
|
|
16
|
+
return this.client.rest.interactions.createInteractionResponse(this.id, this.token, { type: Constants_1.InteractionResponseTypes.PONG });
|
|
17
|
+
}
|
|
18
|
+
toJSON() {
|
|
19
|
+
return {
|
|
20
|
+
...super.toJSON(),
|
|
21
|
+
type: this.type
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = PingInteraction;
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUGluZ0ludGVyYWN0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3N0cnVjdHVyZXMvUGluZ0ludGVyYWN0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDhCQUE4QjtBQUM5Qix3RUFBd0M7QUFDeEMsNENBQStFO0FBSy9FLDBGQUEwRjtBQUMxRixNQUFxQixlQUFnQixTQUFRLHFCQUFXO0lBRXBELFlBQVksSUFBd0IsRUFBRSxNQUFjO1FBQ2hELEtBQUssQ0FBQyxJQUFJLEVBQUUsTUFBTSxDQUFDLENBQUM7SUFDeEIsQ0FBQztJQUVEOztPQUVHO0lBQ0gsS0FBSyxDQUFDLElBQUk7UUFDTixPQUFPLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyx5QkFBeUIsQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLElBQUksQ0FBQyxLQUFLLEVBQUUsRUFBRSxJQUFJLEVBQUUsb0NBQXdCLENBQUMsSUFBSSxFQUFFLENBQUMsQ0FBQztJQUNqSSxDQUFDO0lBRVEsTUFBTTtRQUNYLE9BQU87WUFDSCxHQUFHLEtBQUssQ0FBQyxNQUFNLEVBQUU7WUFDakIsSUFBSSxFQUFFLElBQUksQ0FBQyxJQUFJO1NBQ2xCLENBQUM7SUFDTixDQUFDO0NBQ0o7QUFuQkQsa0NBbUJDIn0=
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type Message from "./Message";
|
|
2
|
+
import type User from "./User";
|
|
3
|
+
import type Client from "../Client";
|
|
4
|
+
import type { PollLayoutType } from "../Constants";
|
|
5
|
+
import type { GetPollAnswerUsersOptions, PollAnswer, PollResults, RawPoll } from "../types/channels";
|
|
6
|
+
import type { JSONPoll, PollQuestion } from "../types";
|
|
7
|
+
export default class Poll {
|
|
8
|
+
allowMultiselect: boolean;
|
|
9
|
+
answers: Array<PollAnswer>;
|
|
10
|
+
client: Client;
|
|
11
|
+
expiry: Date;
|
|
12
|
+
layoutType: PollLayoutType;
|
|
13
|
+
message: Message;
|
|
14
|
+
question: PollQuestion;
|
|
15
|
+
results: PollResults;
|
|
16
|
+
constructor(data: RawPoll, client: Client, message: Message);
|
|
17
|
+
/** The user that created this poll. */
|
|
18
|
+
get creator(): User;
|
|
19
|
+
/** End this poll now. */
|
|
20
|
+
expire(): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Get the users that voted on a poll answer.
|
|
23
|
+
* @param answerID The ID of the poll answer to get voters for.
|
|
24
|
+
* @param options The options for getting the voters.
|
|
25
|
+
*/
|
|
26
|
+
getAnswerUsers(answerID: number, options?: GetPollAnswerUsersOptions): Promise<Array<User>>;
|
|
27
|
+
toJSON(): JSONPoll;
|
|
28
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
class Poll {
|
|
4
|
+
allowMultiselect;
|
|
5
|
+
answers;
|
|
6
|
+
client;
|
|
7
|
+
expiry;
|
|
8
|
+
layoutType;
|
|
9
|
+
message;
|
|
10
|
+
question;
|
|
11
|
+
results;
|
|
12
|
+
constructor(data, client, message) {
|
|
13
|
+
Object.defineProperty(this, "client", {
|
|
14
|
+
value: client,
|
|
15
|
+
enumerable: false,
|
|
16
|
+
writable: false,
|
|
17
|
+
configurable: false
|
|
18
|
+
});
|
|
19
|
+
this.allowMultiselect = data.allow_multiselect;
|
|
20
|
+
this.answers = data.answers.map(a => ({
|
|
21
|
+
answerID: a.answer_id,
|
|
22
|
+
pollMedia: a.poll_media
|
|
23
|
+
}));
|
|
24
|
+
this.expiry = new Date(data.expiry);
|
|
25
|
+
this.layoutType = data.layout_type;
|
|
26
|
+
this.message = message;
|
|
27
|
+
this.question = data.question;
|
|
28
|
+
const res = data.results || { answer_counts: [], is_finalized: false };
|
|
29
|
+
this.results = {
|
|
30
|
+
answerCounts: res.answer_counts.map(a => ({
|
|
31
|
+
count: a.count,
|
|
32
|
+
id: a.id,
|
|
33
|
+
meVoted: a.me_voted,
|
|
34
|
+
users: []
|
|
35
|
+
})),
|
|
36
|
+
isFinalized: res.is_finalized
|
|
37
|
+
};
|
|
38
|
+
// this makes working with this much easier as a developer. We still have systems in place to insert missing answerCounts, if needs be
|
|
39
|
+
for (const answer of data.answers) {
|
|
40
|
+
if (!this.results.answerCounts.some(a => a.id === answer.answer_id)) {
|
|
41
|
+
this.results.answerCounts.push({
|
|
42
|
+
count: 0,
|
|
43
|
+
id: answer.answer_id,
|
|
44
|
+
meVoted: false,
|
|
45
|
+
users: []
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/** The user that created this poll. */
|
|
51
|
+
get creator() {
|
|
52
|
+
return this.message.author;
|
|
53
|
+
}
|
|
54
|
+
/** End this poll now. */
|
|
55
|
+
async expire() {
|
|
56
|
+
await this.client.rest.channels.expirePoll.call(this.client.rest.channels, this.message.channelID, this.message.id);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get the users that voted on a poll answer.
|
|
60
|
+
* @param answerID The ID of the poll answer to get voters for.
|
|
61
|
+
* @param options The options for getting the voters.
|
|
62
|
+
*/
|
|
63
|
+
async getAnswerUsers(answerID, options) {
|
|
64
|
+
return this.client.rest.channels.getPollAnswerUsers.call(this.client.rest.channels, this.message.channelID, this.message.id, answerID, options);
|
|
65
|
+
}
|
|
66
|
+
toJSON() {
|
|
67
|
+
return {
|
|
68
|
+
allowMultiselect: this.allowMultiselect,
|
|
69
|
+
answers: this.answers,
|
|
70
|
+
expiry: this.expiry.toISOString(),
|
|
71
|
+
layoutType: this.layoutType,
|
|
72
|
+
question: this.question,
|
|
73
|
+
results: this.results
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.default = Poll;
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUG9sbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2xpYi9zdHJ1Y3R1cmVzL1BvbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFPQSxNQUFxQixJQUFJO0lBQ3JCLGdCQUFnQixDQUFVO0lBQzFCLE9BQU8sQ0FBb0I7SUFDM0IsTUFBTSxDQUFVO0lBQ2hCLE1BQU0sQ0FBTztJQUNiLFVBQVUsQ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SSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsU0FBUyxFQUFFLElBQUksQ0FBQyxPQUFPLENBQUMsRUFBRSxDQUFDLENBQUM7SUFDeEgsQ0FBQztJQUVEOzs7O09BSUc7SUFDSCxLQUFLLENBQUMsY0FBYyxDQUFDLFFBQWdCLEVBQUUsT0FBbUM7UUFDdEUsT0FBTyxJQUFJLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxRQUFRLENBQUMsa0JBQWtCLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLFFBQVEsRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLFNBQVMsRUFBRSxJQUFJLENBQUMsT0FBTyxDQUFDLEVBQUUsRUFBRSxRQUFRLEVBQUUsT0FBTyxDQUFDLENBQUM7SUFDcEosQ0FBQztJQUVELE1BQU07UUFDRixPQUFPO1lBQ0gsZ0JBQWdCLEVBQUUsSUFBSSxDQUFDLGdCQUFnQjtZQUN2QyxPQUFPLEVBQVcsSUFBSSxDQUFDLE9BQU87WUFDOUIsTUFBTSxFQUFZLElBQUksQ0FBQyxNQUFNLENBQUMsV0FBVyxFQUFFO1lBQzNDLFVBQVUsRUFBUSxJQUFJLENBQUMsVUFBVTtZQUNqQyxRQUFRLEVBQVUsSUFBSSxDQUFDLFFBQVE7WUFDL0IsT0FBTyxFQUFXLElBQUksQ0FBQyxPQUFPO1NBQ2pDLENBQUM7SUFDTixDQUFDO0NBQ0o7QUE3RUQsdUJBNkVDIn0=
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/** @module PrivateChannel */
|
|
2
|
+
import Channel from "./Channel";
|
|
3
|
+
import type User from "./User";
|
|
4
|
+
import Message from "./Message";
|
|
5
|
+
import type { ChannelTypes } from "../Constants";
|
|
6
|
+
import type Client from "../Client";
|
|
7
|
+
import type { CreateMessageOptions, EditMessageOptions, GetChannelMessagesOptions, GetReactionsOptions, RawMessage, RawPrivateChannel } from "../types/channels";
|
|
8
|
+
import TypedCollection from "../util/TypedCollection";
|
|
9
|
+
import type { JSONPrivateChannel } from "../types/json";
|
|
10
|
+
/** Represents a direct message with a user. */
|
|
11
|
+
export default class PrivateChannel extends Channel {
|
|
12
|
+
/** The last message sent in this channel. This will only be present if a message has been sent within the current session. */
|
|
13
|
+
lastMessage?: Message<this> | null;
|
|
14
|
+
/** The ID of last message sent in this channel. */
|
|
15
|
+
lastMessageID: string | null;
|
|
16
|
+
/** The cached messages in this channel. */
|
|
17
|
+
messages: TypedCollection<RawMessage, Message<this>>;
|
|
18
|
+
/** The other user in this direct message. */
|
|
19
|
+
recipient: User;
|
|
20
|
+
type: ChannelTypes.DM;
|
|
21
|
+
constructor(data: RawPrivateChannel, client: Client);
|
|
22
|
+
protected update(data: Partial<RawPrivateChannel>): void;
|
|
23
|
+
/**
|
|
24
|
+
* Create a message in this channel.
|
|
25
|
+
* @param options The options for creating the message.
|
|
26
|
+
*/
|
|
27
|
+
createMessage(options: CreateMessageOptions): Promise<Message<this>>;
|
|
28
|
+
/**
|
|
29
|
+
* Add a reaction to a message in this channel.
|
|
30
|
+
* @param messageID The ID of the message to add a reaction to.
|
|
31
|
+
* @param emoji The reaction to add to the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
|
|
32
|
+
*/
|
|
33
|
+
createReaction(messageID: string, emoji: string): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Delete a message in this channel.
|
|
36
|
+
* @param messageID The ID of the message to delete.
|
|
37
|
+
* @param reason The reason for deleting the message.
|
|
38
|
+
*/
|
|
39
|
+
deleteMessage(messageID: string, reason?: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Remove a reaction from a message in this channel.
|
|
42
|
+
* @param messageID The ID of the message to remove a reaction from.
|
|
43
|
+
* @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
|
|
44
|
+
*/
|
|
45
|
+
deleteReaction(messageID: string, emoji: string): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Edit a message in this channel.
|
|
48
|
+
* @param messageID The ID of the message to edit.
|
|
49
|
+
* @param options The options for editing the message.
|
|
50
|
+
*/
|
|
51
|
+
editMessage(messageID: string, options: EditMessageOptions): Promise<Message<this>>;
|
|
52
|
+
/**
|
|
53
|
+
* Get a message in this channel.
|
|
54
|
+
* @param messageID The ID of the message to get.
|
|
55
|
+
*/
|
|
56
|
+
getMessage(messageID: string): Promise<Message<this>>;
|
|
57
|
+
/**
|
|
58
|
+
* Get messages in this channel.
|
|
59
|
+
* @param options The options for getting the messages. `before`, `after`, and `around `All are mutually exclusive.
|
|
60
|
+
*/
|
|
61
|
+
getMessages(options?: GetChannelMessagesOptions): Promise<Array<Message<this>>>;
|
|
62
|
+
/**
|
|
63
|
+
* Get the pinned messages in this channel.
|
|
64
|
+
*/
|
|
65
|
+
getPinnedMessages(): Promise<Array<Message<this>>>;
|
|
66
|
+
/**
|
|
67
|
+
* Get the users who reacted with a specific emoji on a message.
|
|
68
|
+
* @param messageID The iIDd of the message to get reactions from.
|
|
69
|
+
* @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
|
|
70
|
+
* @param options The options for getting the reactions.
|
|
71
|
+
*/
|
|
72
|
+
getReactions(messageID: string, emoji: string, options?: GetReactionsOptions): Promise<Array<User>>;
|
|
73
|
+
/**
|
|
74
|
+
* Pin a message in this channel.
|
|
75
|
+
* @param messageID The ID of the message to pin.
|
|
76
|
+
* @param reason The reason for pinning the message.
|
|
77
|
+
*/
|
|
78
|
+
pinMessage(messageID: string, reason?: string): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Show a typing indicator in this channel.
|
|
81
|
+
*/
|
|
82
|
+
sendTyping(): Promise<void>;
|
|
83
|
+
toJSON(): JSONPrivateChannel;
|
|
84
|
+
/**
|
|
85
|
+
* Unpin a message in this channel.
|
|
86
|
+
* @param messageID The ID of the message to unpin.
|
|
87
|
+
* @param reason The ID for unpinning the message.
|
|
88
|
+
*/
|
|
89
|
+
unpinMessage(messageID: string, reason?: string): Promise<void>;
|
|
90
|
+
}
|