lolka.js 0.1.3 → 0.2.0
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/README.md +6 -6
- package/package.json +21 -52
- package/src/client/BaseClient.js +120 -0
- package/src/client/Client.js +147 -446
- package/src/client/WebhookClient.js +103 -0
- package/src/client/actions/Action.js +3 -4
- package/src/client/actions/ActionsManager.js +65 -55
- package/src/client/actions/ApplicationCommandPermissionsUpdate.js +34 -0
- package/src/client/actions/AutoModerationActionExecution.js +26 -0
- package/src/client/actions/AutoModerationRuleCreate.js +27 -0
- package/src/client/actions/AutoModerationRuleDelete.js +31 -0
- package/src/client/actions/AutoModerationRuleUpdate.js +29 -0
- package/src/client/actions/ChannelCreate.js +3 -5
- package/src/client/actions/ChannelDelete.js +3 -4
- package/src/client/actions/ChannelUpdate.js +3 -3
- package/src/client/actions/EntitlementCreate.js +23 -0
- package/src/client/actions/EntitlementDelete.js +27 -0
- package/src/client/actions/EntitlementUpdate.js +25 -0
- package/src/client/actions/GuildAuditLogEntryCreate.js +29 -0
- package/src/client/actions/GuildBanAdd.js +20 -0
- package/src/client/actions/GuildBanRemove.js +25 -0
- package/src/client/actions/GuildChannelsPositionUpdate.js +3 -3
- package/src/client/actions/GuildDelete.js +44 -0
- package/src/client/actions/GuildEmojiCreate.js +3 -4
- package/src/client/actions/GuildEmojiDelete.js +3 -4
- package/src/client/actions/GuildEmojiUpdate.js +3 -4
- package/src/client/actions/GuildEmojisUpdate.js +2 -2
- package/src/client/actions/GuildIntegrationsUpdate.js +19 -0
- package/src/client/actions/GuildMemberRemove.js +6 -8
- package/src/client/actions/GuildMemberUpdate.js +6 -7
- package/src/client/actions/GuildRoleCreate.js +4 -6
- package/src/client/actions/GuildRoleDelete.js +3 -4
- package/src/client/actions/GuildRoleUpdate.js +39 -0
- package/src/client/actions/GuildRolesPositionUpdate.js +3 -3
- package/src/client/actions/GuildScheduledEventCreate.js +27 -0
- package/src/client/actions/GuildScheduledEventDelete.js +3 -4
- package/src/client/actions/GuildScheduledEventUpdate.js +30 -0
- package/src/client/actions/GuildScheduledEventUserAdd.js +3 -4
- package/src/client/actions/GuildScheduledEventUserRemove.js +3 -4
- package/src/client/actions/GuildSoundboardSoundDelete.js +3 -4
- package/src/client/actions/GuildStickerCreate.js +3 -4
- package/src/client/actions/GuildStickerDelete.js +3 -4
- package/src/client/actions/GuildStickerUpdate.js +3 -4
- package/src/client/actions/GuildStickersUpdate.js +2 -2
- package/src/client/actions/GuildUpdate.js +3 -4
- package/src/client/actions/InteractionCreate.js +15 -18
- package/src/client/actions/InviteCreate.js +27 -0
- package/src/client/actions/InviteDelete.js +29 -0
- package/src/client/actions/MessageCreate.js +3 -4
- package/src/client/actions/MessageDelete.js +3 -4
- package/src/client/actions/MessageDeleteBulk.js +3 -5
- package/src/client/actions/MessagePollVoteAdd.js +3 -4
- package/src/client/actions/MessagePollVoteRemove.js +3 -4
- package/src/client/actions/MessageReactionAdd.js +5 -7
- package/src/client/actions/MessageReactionRemove.js +4 -5
- package/src/client/actions/MessageReactionRemoveAll.js +4 -5
- package/src/client/actions/MessageReactionRemoveEmoji.js +4 -5
- package/src/client/actions/MessageUpdate.js +2 -2
- package/src/client/actions/PresenceUpdate.js +45 -0
- package/src/client/actions/StageInstanceCreate.js +3 -4
- package/src/client/actions/StageInstanceDelete.js +3 -4
- package/src/client/actions/StageInstanceUpdate.js +3 -4
- package/src/client/actions/ThreadCreate.js +3 -5
- package/src/client/actions/ThreadDelete.js +26 -0
- package/src/client/actions/ThreadListSync.js +60 -0
- package/src/client/actions/ThreadMemberUpdate.js +30 -0
- package/src/client/actions/ThreadMembersUpdate.js +3 -5
- package/src/client/actions/TypingStart.js +5 -6
- package/src/client/actions/UserUpdate.js +3 -4
- package/src/client/actions/VoiceStateUpdate.js +43 -0
- package/src/client/actions/WebhooksUpdate.js +37 -0
- package/src/client/voice/ClientVoiceManager.js +6 -10
- package/src/client/websocket/WebSocketManager.js +407 -0
- package/src/client/websocket/WebSocketShard.js +234 -0
- package/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.js +2 -27
- package/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.js +2 -15
- package/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.js +2 -16
- package/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.js +2 -19
- package/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.js +2 -18
- package/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.js +1 -2
- package/src/client/websocket/handlers/CHANNEL_UPDATE.js +1 -2
- package/src/client/websocket/handlers/ENTITLEMENT_CREATE.js +2 -12
- package/src/client/websocket/handlers/ENTITLEMENT_DELETE.js +2 -16
- package/src/client/websocket/handlers/ENTITLEMENT_UPDATE.js +2 -14
- package/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.js +2 -17
- package/src/client/websocket/handlers/GUILD_BAN_ADD.js +2 -13
- package/src/client/websocket/handlers/GUILD_BAN_REMOVE.js +2 -18
- package/src/client/websocket/handlers/GUILD_CREATE.js +5 -7
- package/src/client/websocket/handlers/GUILD_DELETE.js +2 -34
- package/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.js +2 -13
- package/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.js +1 -3
- package/src/client/websocket/handlers/GUILD_MEMBER_ADD.js +11 -9
- package/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.js +2 -2
- package/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.js +2 -2
- package/src/client/websocket/handlers/GUILD_ROLE_UPDATE.js +2 -19
- package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.js +2 -15
- package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.js +2 -17
- package/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUNDS_UPDATE.js +1 -2
- package/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_CREATE.js +1 -2
- package/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_UPDATE.js +1 -2
- package/src/client/websocket/handlers/INVITE_CREATE.js +2 -18
- package/src/client/websocket/handlers/INVITE_DELETE.js +2 -21
- package/src/client/websocket/handlers/MESSAGE_UPDATE.js +1 -2
- package/src/client/websocket/handlers/PRESENCE_UPDATE.js +2 -40
- package/src/client/websocket/handlers/RATE_LIMITED.js +2 -1
- package/src/client/websocket/handlers/READY.js +5 -8
- package/src/client/websocket/handlers/RESUMED.js +14 -0
- package/src/client/websocket/handlers/SOUNDBOARD_SOUNDS.js +1 -2
- package/src/client/websocket/handlers/SUBSCRIPTION_CREATE.js +1 -2
- package/src/client/websocket/handlers/SUBSCRIPTION_DELETE.js +1 -2
- package/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.js +1 -2
- package/src/client/websocket/handlers/THREAD_DELETE.js +2 -15
- package/src/client/websocket/handlers/THREAD_LIST_SYNC.js +2 -49
- package/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.js +2 -23
- package/src/client/websocket/handlers/THREAD_UPDATE.js +1 -2
- package/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.js +2 -3
- package/src/client/websocket/handlers/VOICE_SERVER_UPDATE.js +3 -30
- package/src/client/websocket/handlers/VOICE_STATE_UPDATE.js +2 -35
- package/src/client/websocket/handlers/WEBHOOKS_UPDATE.js +2 -14
- package/src/client/websocket/handlers/index.js +75 -74
- package/src/errors/DJSError.js +7 -7
- package/src/errors/ErrorCodes.js +134 -58
- package/src/errors/Messages.js +143 -115
- package/src/errors/index.js +3 -5
- package/src/index.js +227 -234
- package/src/managers/ApplicationCommandManager.js +24 -60
- package/src/managers/ApplicationCommandPermissionsManager.js +33 -57
- package/src/managers/ApplicationEmojiManager.js +8 -18
- package/src/managers/AutoModerationRuleManager.js +6 -24
- package/src/managers/BaseGuildEmojiManager.js +85 -0
- package/src/managers/BaseManager.js +1 -3
- package/src/managers/CachedManager.js +8 -12
- package/src/managers/CategoryChannelChildManager.js +4 -10
- package/src/managers/ChannelManager.js +8 -70
- package/src/managers/DMMessageManager.js +2 -4
- package/src/managers/DataManager.js +5 -10
- package/src/managers/EntitlementManager.js +8 -19
- package/src/managers/GuildApplicationCommandManager.js +3 -6
- package/src/managers/GuildBanManager.js +52 -27
- package/src/managers/GuildChannelManager.js +54 -91
- package/src/managers/GuildEmojiManager.js +18 -108
- package/src/managers/GuildEmojiRoleManager.js +14 -24
- package/src/managers/GuildForumThreadManager.js +5 -10
- package/src/managers/GuildInviteManager.js +27 -51
- package/src/managers/GuildManager.js +185 -45
- package/src/managers/GuildMemberManager.js +105 -89
- package/src/managers/GuildMemberRoleManager.js +14 -29
- package/src/managers/GuildMessageManager.js +2 -20
- package/src/managers/GuildScheduledEventManager.js +13 -31
- package/src/managers/GuildSoundboardSoundManager.js +5 -17
- package/src/managers/GuildStickerManager.js +21 -34
- package/src/managers/GuildTextThreadManager.js +5 -9
- package/src/managers/MessageManager.js +77 -64
- package/src/managers/PartialGroupDMMessageManager.js +2 -4
- package/src/managers/PermissionOverwriteManager.js +15 -26
- package/src/managers/PollAnswerVoterManager.js +2 -14
- package/src/managers/PresenceManager.js +6 -11
- package/src/managers/ReactionManager.js +6 -13
- package/src/managers/ReactionUserManager.js +4 -11
- package/src/managers/RoleManager.js +74 -76
- package/src/managers/StageInstanceManager.js +8 -18
- package/src/managers/SubscriptionManager.js +4 -9
- package/src/managers/ThreadManager.js +13 -33
- package/src/managers/ThreadMemberManager.js +34 -27
- package/src/managers/UserManager.js +34 -32
- package/src/managers/VoiceStateManager.js +4 -9
- package/src/sharding/Shard.js +40 -64
- package/src/sharding/ShardClientUtil.js +60 -60
- package/src/sharding/ShardingManager.js +30 -89
- package/src/structures/ActionRow.js +18 -6
- package/src/structures/ActionRowBuilder.js +35 -0
- package/src/structures/AnonymousGuild.js +10 -14
- package/src/structures/ApplicationCommand.js +49 -67
- package/src/structures/ApplicationEmoji.js +5 -22
- package/src/structures/ApplicationRoleConnectionMetadata.js +0 -6
- package/src/structures/Attachment.js +7 -25
- package/src/structures/AttachmentBuilder.js +111 -0
- package/src/structures/AutoModerationActionExecution.js +2 -17
- package/src/structures/AutoModerationRule.js +17 -46
- package/src/structures/AutocompleteInteraction.js +4 -14
- package/src/structures/Base.js +2 -4
- package/src/structures/BaseChannel.js +4 -21
- package/src/structures/BaseGuild.js +7 -19
- package/src/structures/BaseGuildEmoji.js +13 -13
- package/src/structures/BaseGuildTextChannel.js +16 -45
- package/src/structures/BaseGuildVoiceChannel.js +12 -43
- package/src/structures/BaseInteraction.js +25 -54
- package/src/structures/BaseSelectMenuComponent.js +2 -8
- package/src/structures/ButtonBuilder.js +44 -0
- package/src/structures/ButtonComponent.js +2 -9
- package/src/structures/ButtonInteraction.js +2 -3
- package/src/structures/CategoryChannel.js +3 -8
- package/src/structures/ChannelSelectMenuBuilder.js +31 -0
- package/src/structures/ChannelSelectMenuComponent.js +2 -4
- package/src/structures/ChannelSelectMenuInteraction.js +2 -5
- package/src/structures/ChatInputCommandInteraction.js +4 -7
- package/src/structures/ClientApplication.js +12 -60
- package/src/structures/ClientPresence.js +10 -15
- package/src/structures/ClientUser.js +19 -36
- package/src/structures/CommandInteraction.js +7 -27
- package/src/structures/CommandInteractionOptionResolver.js +8 -36
- package/src/structures/Component.js +1 -7
- package/src/structures/ContainerComponent.js +3 -9
- package/src/structures/ContextMenuCommandInteraction.js +5 -9
- package/src/structures/DMChannel.js +15 -34
- package/src/structures/DirectoryChannel.js +2 -6
- package/src/structures/Embed.js +2 -19
- package/src/structures/EmbedBuilder.js +50 -0
- package/src/structures/Emoji.js +19 -19
- package/src/structures/Entitlement.js +2 -22
- package/src/structures/FileComponent.js +3 -7
- package/src/structures/ForumChannel.js +3 -6
- package/src/structures/Guild.js +131 -187
- package/src/structures/GuildAuditLogs.js +6 -12
- package/src/structures/GuildAuditLogsEntry.js +63 -88
- package/src/structures/GuildBan.js +3 -9
- package/src/structures/GuildChannel.js +33 -68
- package/src/structures/GuildEmoji.js +7 -19
- package/src/structures/GuildMember.js +58 -107
- package/src/structures/GuildOnboarding.js +2 -9
- package/src/structures/GuildOnboardingPrompt.js +2 -12
- package/src/structures/GuildOnboardingPromptOption.js +2 -12
- package/src/structures/GuildPreview.js +21 -30
- package/src/structures/GuildPreviewEmoji.js +2 -5
- package/src/structures/GuildScheduledEvent.js +19 -59
- package/src/structures/GuildTemplate.js +45 -24
- package/src/structures/Integration.js +7 -30
- package/src/structures/IntegrationApplication.js +12 -9
- package/src/structures/InteractionCallback.js +1 -10
- package/src/structures/InteractionCallbackResource.js +2 -7
- package/src/structures/InteractionCallbackResponse.js +3 -6
- package/src/structures/InteractionCollector.js +36 -23
- package/src/structures/InteractionResponse.js +102 -0
- package/src/structures/InteractionWebhook.js +6 -14
- package/src/structures/Invite.js +341 -0
- package/src/structures/InviteGuild.js +4 -6
- package/src/structures/InviteStageInstance.js +87 -0
- package/src/structures/LabelComponent.js +3 -3
- package/src/structures/MediaChannel.js +2 -3
- package/src/structures/MediaGalleryComponent.js +3 -6
- package/src/structures/MediaGalleryItem.js +2 -7
- package/src/structures/MentionableSelectMenuBuilder.js +32 -0
- package/src/structures/MentionableSelectMenuComponent.js +2 -3
- package/src/structures/MentionableSelectMenuInteraction.js +3 -8
- package/src/structures/Message.js +100 -169
- package/src/structures/MessageCollector.js +5 -16
- package/src/structures/MessageComponentInteraction.js +14 -34
- package/src/structures/MessageContextMenuCommandInteraction.js +2 -4
- package/src/structures/MessageMentions.js +4 -30
- package/src/structures/MessagePayload.js +90 -92
- package/src/structures/MessageReaction.js +17 -31
- package/src/structures/ModalBuilder.js +36 -0
- package/src/structures/{ModalComponentResolver.js → ModalSubmitFields.js} +31 -37
- package/src/structures/ModalSubmitInteraction.js +55 -54
- package/src/structures/NewsChannel.js +32 -0
- package/src/structures/OAuth2Guild.js +3 -6
- package/src/structures/PartialGroupDMChannel.js +11 -23
- package/src/structures/PermissionOverwrites.js +25 -47
- package/src/structures/Poll.js +4 -19
- package/src/structures/PollAnswer.js +29 -13
- package/src/structures/Presence.js +13 -57
- package/src/structures/PrimaryEntryPointCommandInteraction.js +2 -3
- package/src/structures/ReactionCollector.js +4 -21
- package/src/structures/ReactionEmoji.js +3 -5
- package/src/structures/Role.js +48 -65
- package/src/structures/RoleSelectMenuBuilder.js +31 -0
- package/src/structures/RoleSelectMenuComponent.js +2 -3
- package/src/structures/RoleSelectMenuInteraction.js +2 -5
- package/src/structures/SKU.js +2 -9
- package/src/structures/SectionComponent.js +3 -7
- package/src/structures/SelectMenuBuilder.js +26 -0
- package/src/structures/SelectMenuComponent.js +26 -0
- package/src/structures/SelectMenuInteraction.js +26 -0
- package/src/structures/SelectMenuOptionBuilder.js +26 -0
- package/src/structures/SeparatorComponent.js +2 -5
- package/src/structures/SoundboardSound.js +2 -18
- package/src/structures/StageChannel.js +4 -13
- package/src/structures/StageInstance.js +16 -19
- package/src/structures/Sticker.js +4 -28
- package/src/structures/StickerPack.js +4 -16
- package/src/structures/StringSelectMenuBuilder.js +79 -0
- package/src/structures/StringSelectMenuComponent.js +2 -4
- package/src/structures/StringSelectMenuInteraction.js +2 -4
- package/src/structures/StringSelectMenuOptionBuilder.js +49 -0
- package/src/structures/Subscription.js +1 -15
- package/src/structures/Team.js +7 -16
- package/src/structures/TeamMember.js +15 -9
- package/src/structures/TextChannel.js +3 -6
- package/src/structures/TextDisplayComponent.js +2 -4
- package/src/structures/TextInputBuilder.js +31 -0
- package/src/structures/TextInputComponent.js +2 -5
- package/src/structures/ThreadChannel.js +35 -85
- package/src/structures/ThreadMember.js +12 -17
- package/src/structures/ThreadOnlyChannel.js +15 -36
- package/src/structures/ThumbnailComponent.js +3 -8
- package/src/structures/Typing.js +2 -10
- package/src/structures/UnfurledMediaItem.js +2 -5
- package/src/structures/User.js +68 -60
- package/src/structures/UserContextMenuCommandInteraction.js +2 -5
- package/src/structures/UserSelectMenuBuilder.js +31 -0
- package/src/structures/UserSelectMenuComponent.js +2 -3
- package/src/structures/UserSelectMenuInteraction.js +3 -7
- package/src/structures/VoiceChannel.js +4 -11
- package/src/structures/VoiceChannelEffect.js +2 -12
- package/src/structures/VoiceRegion.js +2 -7
- package/src/structures/VoiceState.js +10 -36
- package/src/structures/Webhook.js +37 -65
- package/src/structures/WelcomeChannel.js +5 -12
- package/src/structures/WelcomeScreen.js +3 -8
- package/src/structures/Widget.js +3 -13
- package/src/structures/WidgetMember.js +2 -17
- package/src/structures/interfaces/Application.js +10 -19
- package/src/structures/interfaces/Collector.js +12 -45
- package/src/structures/interfaces/InteractionResponses.js +152 -43
- package/src/structures/interfaces/TextBasedChannel.js +99 -83
- package/src/util/APITypes.js +16 -30
- package/src/util/ActivityFlagsBitField.js +2 -5
- package/src/util/ApplicationFlagsBitField.js +6 -11
- package/src/util/AttachmentFlagsBitField.js +2 -5
- package/src/util/BitField.js +8 -27
- package/src/util/ChannelFlagsBitField.js +6 -11
- package/src/util/Channels.js +61 -73
- package/src/util/Colors.js +43 -43
- package/src/util/Components.js +82 -61
- package/src/util/Constants.js +124 -94
- package/src/util/DataResolver.js +17 -36
- package/src/util/Enums.js +1 -2
- package/src/util/Events.js +14 -3
- package/src/util/Formatters.js +413 -0
- package/src/util/GuildMemberFlagsBitField.js +5 -9
- package/src/util/IntentsBitField.js +6 -10
- package/src/util/InviteFlagsBitField.js +1 -2
- package/src/util/LimitedCollection.js +6 -13
- package/src/util/LolkaSnowflake.js +14 -1
- package/src/util/MessageFlagsBitField.js +6 -11
- package/src/util/Options.js +57 -35
- package/src/util/Partials.js +4 -5
- package/src/util/PermissionsBitField.js +8 -21
- package/src/util/RoleFlagsBitField.js +2 -5
- package/src/util/SKUFlagsBitField.js +1 -4
- package/src/util/ShardEvents.js +3 -1
- package/src/util/Status.js +21 -5
- package/src/util/Sweepers.js +13 -59
- package/src/util/SystemChannelFlagsBitField.js +6 -11
- package/src/util/ThreadMemberFlagsBitField.js +2 -6
- package/src/util/Transformers.js +18 -17
- package/src/util/UserFlagsBitField.js +2 -6
- package/src/util/Util.js +97 -148
- package/src/util/WebSocketShardEvents.js +25 -0
- package/typings/index.d.mts +2392 -1768
- package/typings/index.d.ts +2392 -1768
- package/typings/rawDataTypes.d.ts +211 -0
- package/src/structures/ActivityInstance.js +0 -52
- package/src/structures/ActivityLocation.js +0 -65
- package/src/structures/AnnouncementChannel.js +0 -29
- package/src/structures/AuthorizingIntegrationOwners.js +0 -64
- package/src/structures/BaseInvite.js +0 -187
- package/src/structures/GroupDMInvite.js +0 -37
- package/src/structures/GuildInvite.js +0 -223
- package/src/util/Invites.js +0 -31
package/src/structures/User.js
CHANGED
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
const { userMention } = require('@discordjs/formatters');
|
|
4
4
|
const { calculateUserDefaultAvatarIndex } = require('@discordjs/rest');
|
|
5
5
|
const { DiscordSnowflake } = require('../util/LolkaSnowflake');
|
|
6
|
+
const Base = require('./Base');
|
|
7
|
+
const TextBasedChannel = require('./interfaces/TextBasedChannel');
|
|
6
8
|
const { _transformCollectibles } = require('../util/Transformers.js');
|
|
7
|
-
const
|
|
8
|
-
const {
|
|
9
|
+
const UserFlagsBitField = require('../util/UserFlagsBitField');
|
|
10
|
+
const { emitDeprecationWarningForUserFetchFlags } = require('../util/Util');
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* Represents a user on Discord.
|
|
12
|
-
*
|
|
14
|
+
* @implements {TextBasedChannel}
|
|
13
15
|
* @extends {Base}
|
|
14
16
|
*/
|
|
15
17
|
class User extends Base {
|
|
@@ -18,7 +20,6 @@ class User extends Base {
|
|
|
18
20
|
|
|
19
21
|
/**
|
|
20
22
|
* The user's id
|
|
21
|
-
*
|
|
22
23
|
* @type {Snowflake}
|
|
23
24
|
*/
|
|
24
25
|
this.id = data.id;
|
|
@@ -36,7 +37,6 @@ class User extends Base {
|
|
|
36
37
|
if ('username' in data) {
|
|
37
38
|
/**
|
|
38
39
|
* The username of the user
|
|
39
|
-
*
|
|
40
40
|
* @type {?string}
|
|
41
41
|
*/
|
|
42
42
|
this.username = data.username;
|
|
@@ -47,7 +47,6 @@ class User extends Base {
|
|
|
47
47
|
if ('global_name' in data) {
|
|
48
48
|
/**
|
|
49
49
|
* The global name of this user
|
|
50
|
-
*
|
|
51
50
|
* @type {?string}
|
|
52
51
|
*/
|
|
53
52
|
this.globalName = data.global_name;
|
|
@@ -58,7 +57,6 @@ class User extends Base {
|
|
|
58
57
|
if ('bot' in data) {
|
|
59
58
|
/**
|
|
60
59
|
* Whether or not the user is a bot
|
|
61
|
-
*
|
|
62
60
|
* @type {?boolean}
|
|
63
61
|
*/
|
|
64
62
|
this.bot = Boolean(data.bot);
|
|
@@ -70,7 +68,6 @@ class User extends Base {
|
|
|
70
68
|
/**
|
|
71
69
|
* The discriminator of this user
|
|
72
70
|
* <info>`'0'`, or a 4-digit stringified number if they're using the legacy username system</info>
|
|
73
|
-
*
|
|
74
71
|
* @type {?string}
|
|
75
72
|
*/
|
|
76
73
|
this.discriminator = data.discriminator;
|
|
@@ -81,7 +78,6 @@ class User extends Base {
|
|
|
81
78
|
if ('avatar' in data) {
|
|
82
79
|
/**
|
|
83
80
|
* The user avatar's hash
|
|
84
|
-
*
|
|
85
81
|
* @type {?string}
|
|
86
82
|
*/
|
|
87
83
|
this.avatar = data.avatar;
|
|
@@ -93,7 +89,6 @@ class User extends Base {
|
|
|
93
89
|
/**
|
|
94
90
|
* The user banner's hash
|
|
95
91
|
* <info>The user must be force fetched for this property to be present or be updated</info>
|
|
96
|
-
*
|
|
97
92
|
* @type {?string}
|
|
98
93
|
*/
|
|
99
94
|
this.banner = data.banner;
|
|
@@ -105,7 +100,6 @@ class User extends Base {
|
|
|
105
100
|
/**
|
|
106
101
|
* The base 10 accent color of the user's banner
|
|
107
102
|
* <info>The user must be force fetched for this property to be present or be updated</info>
|
|
108
|
-
*
|
|
109
103
|
* @type {?number}
|
|
110
104
|
*/
|
|
111
105
|
this.accentColor = data.accent_color;
|
|
@@ -116,7 +110,6 @@ class User extends Base {
|
|
|
116
110
|
if ('system' in data) {
|
|
117
111
|
/**
|
|
118
112
|
* Whether the user is an Official Discord System user (part of the urgent message system)
|
|
119
|
-
*
|
|
120
113
|
* @type {?boolean}
|
|
121
114
|
*/
|
|
122
115
|
this.system = Boolean(data.system);
|
|
@@ -127,18 +120,27 @@ class User extends Base {
|
|
|
127
120
|
if ('public_flags' in data) {
|
|
128
121
|
/**
|
|
129
122
|
* The flags for this user
|
|
130
|
-
*
|
|
131
123
|
* @type {?UserFlagsBitField}
|
|
132
124
|
*/
|
|
133
125
|
this.flags = new UserFlagsBitField(data.public_flags);
|
|
134
126
|
}
|
|
135
127
|
|
|
128
|
+
if ('avatar_decoration' in data) {
|
|
129
|
+
/**
|
|
130
|
+
* The user avatar decoration's hash
|
|
131
|
+
* @type {?string}
|
|
132
|
+
* @deprecated Use `avatarDecorationData` instead
|
|
133
|
+
*/
|
|
134
|
+
this.avatarDecoration = data.avatar_decoration;
|
|
135
|
+
} else {
|
|
136
|
+
this.avatarDecoration ??= null;
|
|
137
|
+
}
|
|
138
|
+
|
|
136
139
|
/**
|
|
137
140
|
* @typedef {Object} AvatarDecorationData
|
|
138
141
|
* @property {string} asset The avatar decoration hash
|
|
139
142
|
* @property {Snowflake} skuId The id of the avatar decoration's SKU
|
|
140
143
|
*/
|
|
141
|
-
|
|
142
144
|
if ('avatar_decoration_data' in data) {
|
|
143
145
|
if (data.avatar_decoration_data) {
|
|
144
146
|
/**
|
|
@@ -170,15 +172,15 @@ class User extends Base {
|
|
|
170
172
|
* @property {?NameplateData} nameplate The user's nameplate data
|
|
171
173
|
*/
|
|
172
174
|
|
|
173
|
-
if (
|
|
175
|
+
if (data.collectibles) {
|
|
174
176
|
/**
|
|
175
177
|
* The user's collectibles
|
|
176
178
|
*
|
|
177
179
|
* @type {?Collectibles}
|
|
178
180
|
*/
|
|
179
|
-
this.collectibles =
|
|
181
|
+
this.collectibles = _transformCollectibles(data.collectibles);
|
|
180
182
|
} else {
|
|
181
|
-
this.collectibles
|
|
183
|
+
this.collectibles = null;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
/**
|
|
@@ -212,7 +214,6 @@ class User extends Base {
|
|
|
212
214
|
|
|
213
215
|
/**
|
|
214
216
|
* Whether this User is a partial
|
|
215
|
-
*
|
|
216
217
|
* @type {boolean}
|
|
217
218
|
* @readonly
|
|
218
219
|
*/
|
|
@@ -222,7 +223,6 @@ class User extends Base {
|
|
|
222
223
|
|
|
223
224
|
/**
|
|
224
225
|
* The timestamp the user was created at
|
|
225
|
-
*
|
|
226
226
|
* @type {number}
|
|
227
227
|
* @readonly
|
|
228
228
|
*/
|
|
@@ -232,7 +232,6 @@ class User extends Base {
|
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
234
|
* The time the user was created at
|
|
235
|
-
*
|
|
236
235
|
* @type {Date}
|
|
237
236
|
* @readonly
|
|
238
237
|
*/
|
|
@@ -242,26 +241,31 @@ class User extends Base {
|
|
|
242
241
|
|
|
243
242
|
/**
|
|
244
243
|
* A link to the user's avatar.
|
|
245
|
-
*
|
|
246
244
|
* @param {ImageURLOptions} [options={}] Options for the image URL
|
|
247
245
|
* @returns {?string}
|
|
248
246
|
*/
|
|
249
247
|
avatarURL(options = {}) {
|
|
250
|
-
return
|
|
248
|
+
return (
|
|
249
|
+
this.avatar &&
|
|
250
|
+
(/^https?:\/\//.test(this.avatar) ? this.avatar : this.client.rest.cdn.avatar(this.id, this.avatar, options))
|
|
251
|
+
);
|
|
251
252
|
}
|
|
252
253
|
|
|
253
254
|
/**
|
|
254
255
|
* A link to the user's avatar decoration.
|
|
255
|
-
*
|
|
256
|
+
* @param {BaseImageURLOptions} [options={}] Options for the image URL
|
|
256
257
|
* @returns {?string}
|
|
257
258
|
*/
|
|
258
|
-
avatarDecorationURL() {
|
|
259
|
-
|
|
259
|
+
avatarDecorationURL(options = {}) {
|
|
260
|
+
if (this.avatarDecorationData) {
|
|
261
|
+
return this.client.rest.cdn.avatarDecoration(this.avatarDecorationData.asset);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return this.avatarDecoration && this.client.rest.cdn.avatarDecoration(this.id, this.avatarDecoration, options);
|
|
260
265
|
}
|
|
261
266
|
|
|
262
267
|
/**
|
|
263
268
|
* A link to the user's default avatar
|
|
264
|
-
*
|
|
265
269
|
* @type {string}
|
|
266
270
|
* @readonly
|
|
267
271
|
*/
|
|
@@ -277,7 +281,6 @@ class User extends Base {
|
|
|
277
281
|
/**
|
|
278
282
|
* A link to the user's avatar if they have one.
|
|
279
283
|
* Otherwise a link to their default avatar will be returned.
|
|
280
|
-
*
|
|
281
284
|
* @param {ImageURLOptions} [options={}] Options for the image URL
|
|
282
285
|
* @returns {string}
|
|
283
286
|
*/
|
|
@@ -288,7 +291,6 @@ class User extends Base {
|
|
|
288
291
|
/**
|
|
289
292
|
* The hexadecimal version of the user accent color, with a leading hash
|
|
290
293
|
* <info>The user must be force fetched for this property to be present</info>
|
|
291
|
-
*
|
|
292
294
|
* @type {?string}
|
|
293
295
|
* @readonly
|
|
294
296
|
*/
|
|
@@ -299,12 +301,14 @@ class User extends Base {
|
|
|
299
301
|
|
|
300
302
|
/**
|
|
301
303
|
* A link to the user's banner. See {@link User#banner} for more info
|
|
302
|
-
*
|
|
303
304
|
* @param {ImageURLOptions} [options={}] Options for the image URL
|
|
304
305
|
* @returns {?string}
|
|
305
306
|
*/
|
|
306
307
|
bannerURL(options = {}) {
|
|
307
|
-
return
|
|
308
|
+
return (
|
|
309
|
+
this.banner &&
|
|
310
|
+
(/^https?:\/\//.test(this.banner) ? this.banner : this.client.rest.cdn.banner(this.id, this.banner, options))
|
|
311
|
+
);
|
|
308
312
|
}
|
|
309
313
|
|
|
310
314
|
/**
|
|
@@ -325,7 +329,6 @@ class User extends Base {
|
|
|
325
329
|
* The tag of this user
|
|
326
330
|
* <info>This user's username, or their legacy tag (e.g. `hydrabolt#0001`)
|
|
327
331
|
* if they're using the legacy username system</info>
|
|
328
|
-
*
|
|
329
332
|
* @type {?string}
|
|
330
333
|
* @readonly
|
|
331
334
|
*/
|
|
@@ -339,7 +342,6 @@ class User extends Base {
|
|
|
339
342
|
|
|
340
343
|
/**
|
|
341
344
|
* The global name of this user, or their username if they don't have one
|
|
342
|
-
*
|
|
343
345
|
* @type {?string}
|
|
344
346
|
* @readonly
|
|
345
347
|
*/
|
|
@@ -349,7 +351,6 @@ class User extends Base {
|
|
|
349
351
|
|
|
350
352
|
/**
|
|
351
353
|
* The DM between the client's user and this user
|
|
352
|
-
*
|
|
353
354
|
* @type {?DMChannel}
|
|
354
355
|
* @readonly
|
|
355
356
|
*/
|
|
@@ -359,45 +360,25 @@ class User extends Base {
|
|
|
359
360
|
|
|
360
361
|
/**
|
|
361
362
|
* Creates a DM channel between the client and the user.
|
|
362
|
-
*
|
|
363
363
|
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
|
364
364
|
* @returns {Promise<DMChannel>}
|
|
365
365
|
*/
|
|
366
|
-
|
|
366
|
+
createDM(force = false) {
|
|
367
367
|
return this.client.users.createDM(this.id, { force });
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
/**
|
|
371
371
|
* Deletes a DM channel (if one exists) between the client and the user. Resolves with the channel if successful.
|
|
372
|
-
*
|
|
373
372
|
* @returns {Promise<DMChannel>}
|
|
374
373
|
*/
|
|
375
|
-
|
|
374
|
+
deleteDM() {
|
|
376
375
|
return this.client.users.deleteDM(this.id);
|
|
377
376
|
}
|
|
378
377
|
|
|
379
|
-
/**
|
|
380
|
-
* Sends a message to this user.
|
|
381
|
-
*
|
|
382
|
-
* @param {string|MessagePayload|MessageCreateOptions} options The options to provide
|
|
383
|
-
* @returns {Promise<Message>}
|
|
384
|
-
* @example
|
|
385
|
-
* // Send a direct message
|
|
386
|
-
* user.send('Hello!')
|
|
387
|
-
* .then(message => console.log(`Sent message: ${message.content} to ${user.tag}`))
|
|
388
|
-
* .catch(console.error);
|
|
389
|
-
*/
|
|
390
|
-
async send(options) {
|
|
391
|
-
const dmChannel = await this.createDM();
|
|
392
|
-
|
|
393
|
-
return this.client.channels.createMessage(dmChannel, options);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
378
|
/**
|
|
397
379
|
* Checks if the user is equal to another.
|
|
398
380
|
* It compares id, username, discriminator, avatar, banner, accent color, and bot flags.
|
|
399
381
|
* It is recommended to compare equality by using `user.id === user2.id` unless you want to compare all properties.
|
|
400
|
-
*
|
|
401
382
|
* @param {User} user User to compare with
|
|
402
383
|
* @returns {boolean}
|
|
403
384
|
*/
|
|
@@ -412,6 +393,7 @@ class User extends Base {
|
|
|
412
393
|
this.flags?.bitfield === user.flags?.bitfield &&
|
|
413
394
|
this.banner === user.banner &&
|
|
414
395
|
this.accentColor === user.accentColor &&
|
|
396
|
+
this.avatarDecoration === user.avatarDecoration &&
|
|
415
397
|
this.avatarDecorationData?.asset === user.avatarDecorationData?.asset &&
|
|
416
398
|
this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId &&
|
|
417
399
|
this.collectibles?.nameplate?.skuId === user.collectibles?.nameplate?.skuId &&
|
|
@@ -427,7 +409,6 @@ class User extends Base {
|
|
|
427
409
|
|
|
428
410
|
/**
|
|
429
411
|
* Compares the user with an API user object
|
|
430
|
-
*
|
|
431
412
|
* @param {APIUser} user The API user object to compare
|
|
432
413
|
* @returns {boolean}
|
|
433
414
|
* @private
|
|
@@ -443,6 +424,7 @@ class User extends Base {
|
|
|
443
424
|
this.flags?.bitfield === user.public_flags &&
|
|
444
425
|
('banner' in user ? this.banner === user.banner : true) &&
|
|
445
426
|
('accent_color' in user ? this.accentColor === user.accent_color : true) &&
|
|
427
|
+
('avatar_decoration' in user ? this.avatarDecoration === user.avatar_decoration : true) &&
|
|
446
428
|
('avatar_decoration_data' in user
|
|
447
429
|
? this.avatarDecorationData?.asset === user.avatar_decoration_data?.asset &&
|
|
448
430
|
this.avatarDecorationData?.skuId === user.avatar_decoration_data?.sku_id
|
|
@@ -462,19 +444,29 @@ class User extends Base {
|
|
|
462
444
|
);
|
|
463
445
|
}
|
|
464
446
|
|
|
447
|
+
/**
|
|
448
|
+
* Fetches this user's flags.
|
|
449
|
+
* @param {boolean} [force=false] Whether to skip the cache check and request the API
|
|
450
|
+
* @returns {Promise<UserFlagsBitField>}
|
|
451
|
+
* @deprecated <warn>This method is deprecated and will be removed in the next major version.
|
|
452
|
+
* Flags may still be retrieved via {@link User#fetch}.</warn>
|
|
453
|
+
*/
|
|
454
|
+
fetchFlags(force = false) {
|
|
455
|
+
emitDeprecationWarningForUserFetchFlags(this.constructor.name);
|
|
456
|
+
return this.client.users.fetchFlags(this.id, { force });
|
|
457
|
+
}
|
|
458
|
+
|
|
465
459
|
/**
|
|
466
460
|
* Fetches this user.
|
|
467
|
-
*
|
|
468
461
|
* @param {boolean} [force=true] Whether to skip the cache check and request the API
|
|
469
462
|
* @returns {Promise<User>}
|
|
470
463
|
*/
|
|
471
|
-
|
|
464
|
+
fetch(force = true) {
|
|
472
465
|
return this.client.users.fetch(this.id, { force });
|
|
473
466
|
}
|
|
474
467
|
|
|
475
468
|
/**
|
|
476
469
|
* When concatenated with a string, this automatically returns the user's mention instead of the User object.
|
|
477
|
-
*
|
|
478
470
|
* @returns {string}
|
|
479
471
|
* @example
|
|
480
472
|
* // Logs: Hello from <@123456789012345678>!
|
|
@@ -502,4 +494,20 @@ class User extends Base {
|
|
|
502
494
|
}
|
|
503
495
|
}
|
|
504
496
|
|
|
505
|
-
|
|
497
|
+
/**
|
|
498
|
+
* Sends a message to this user.
|
|
499
|
+
* @method send
|
|
500
|
+
* @memberof User
|
|
501
|
+
* @instance
|
|
502
|
+
* @param {string|MessagePayload|MessageCreateOptions} options The options to provide
|
|
503
|
+
* @returns {Promise<Message>}
|
|
504
|
+
* @example
|
|
505
|
+
* // Send a direct message
|
|
506
|
+
* user.send('Hello!')
|
|
507
|
+
* .then(message => console.log(`Sent message: ${message.content} to ${user.tag}`))
|
|
508
|
+
* .catch(console.error);
|
|
509
|
+
*/
|
|
510
|
+
|
|
511
|
+
TextBasedChannel.applyToClass(User);
|
|
512
|
+
|
|
513
|
+
module.exports = User;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const ContextMenuCommandInteraction = require('./ContextMenuCommandInteraction');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents a user context menu interaction.
|
|
7
|
-
*
|
|
8
7
|
* @extends {ContextMenuCommandInteraction}
|
|
9
8
|
*/
|
|
10
9
|
class UserContextMenuCommandInteraction extends ContextMenuCommandInteraction {
|
|
11
10
|
/**
|
|
12
11
|
* The target user from this interaction
|
|
13
|
-
*
|
|
14
12
|
* @type {User}
|
|
15
13
|
* @readonly
|
|
16
14
|
*/
|
|
@@ -20,7 +18,6 @@ class UserContextMenuCommandInteraction extends ContextMenuCommandInteraction {
|
|
|
20
18
|
|
|
21
19
|
/**
|
|
22
20
|
* The target member from this interaction
|
|
23
|
-
*
|
|
24
21
|
* @type {?(GuildMember|APIGuildMember)}
|
|
25
22
|
* @readonly
|
|
26
23
|
*/
|
|
@@ -29,4 +26,4 @@ class UserContextMenuCommandInteraction extends ContextMenuCommandInteraction {
|
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
exports
|
|
29
|
+
module.exports = UserContextMenuCommandInteraction;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { UserSelectMenuBuilder: BuildersUserSelectMenu } = require('@discordjs/builders');
|
|
4
|
+
const { isJSONEncodable } = require('@discordjs/util');
|
|
5
|
+
const { toSnakeCase } = require('../util/Transformers');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Class used to build select menu components to be sent through the API
|
|
9
|
+
* @extends {BuildersUserSelectMenu}
|
|
10
|
+
*/
|
|
11
|
+
class UserSelectMenuBuilder extends BuildersUserSelectMenu {
|
|
12
|
+
constructor(data = {}) {
|
|
13
|
+
super(toSnakeCase(data));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new select menu builder from JSON data
|
|
18
|
+
* @param {UserSelectMenuBuilder|UserSelectMenuComponent|APIUserSelectComponent} other The other data
|
|
19
|
+
* @returns {UserSelectMenuBuilder}
|
|
20
|
+
*/
|
|
21
|
+
static from(other) {
|
|
22
|
+
return new this(isJSONEncodable(other) ? other.toJSON() : other);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = UserSelectMenuBuilder;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @external BuildersUserSelectMenu
|
|
30
|
+
* @see {@link https://discord.js.org/docs/packages/builders/stable/UserSelectMenuBuilder:Class}
|
|
31
|
+
*/
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const BaseSelectMenuComponent = require('./BaseSelectMenuComponent');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents a user select menu component
|
|
7
|
-
*
|
|
8
7
|
* @extends {BaseSelectMenuComponent}
|
|
9
8
|
*/
|
|
10
9
|
class UserSelectMenuComponent extends BaseSelectMenuComponent {}
|
|
11
10
|
|
|
12
|
-
exports
|
|
11
|
+
module.exports = UserSelectMenuComponent;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { Collection } = require('@discordjs/collection');
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const MessageComponentInteraction = require('./MessageComponentInteraction');
|
|
5
|
+
const Events = require('../util/Events');
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Represents a {@link ComponentType.UserSelect} select menu interaction.
|
|
9
|
-
*
|
|
10
9
|
* @extends {MessageComponentInteraction}
|
|
11
10
|
*/
|
|
12
11
|
class UserSelectMenuInteraction extends MessageComponentInteraction {
|
|
@@ -16,21 +15,18 @@ class UserSelectMenuInteraction extends MessageComponentInteraction {
|
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* An array of the selected user ids
|
|
19
|
-
*
|
|
20
18
|
* @type {Snowflake[]}
|
|
21
19
|
*/
|
|
22
20
|
this.values = values ?? [];
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
23
|
* Collection of the selected users
|
|
26
|
-
*
|
|
27
24
|
* @type {Collection<Snowflake, User>}
|
|
28
25
|
*/
|
|
29
26
|
this.users = new Collection();
|
|
30
27
|
|
|
31
28
|
/**
|
|
32
29
|
* Collection of the selected members
|
|
33
|
-
*
|
|
34
30
|
* @type {Collection<Snowflake, GuildMember|APIGuildMember>}
|
|
35
31
|
*/
|
|
36
32
|
this.members = new Collection();
|
|
@@ -52,4 +48,4 @@ class UserSelectMenuInteraction extends MessageComponentInteraction {
|
|
|
52
48
|
}
|
|
53
49
|
}
|
|
54
50
|
|
|
55
|
-
exports
|
|
51
|
+
module.exports = UserSelectMenuInteraction;
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const { PermissionFlagsBits, Routes } = require('discord-api-types/v10');
|
|
4
|
-
const
|
|
4
|
+
const BaseGuildVoiceChannel = require('./BaseGuildVoiceChannel');
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Represents a guild voice channel on Discord.
|
|
8
|
-
*
|
|
9
8
|
* @extends {BaseGuildVoiceChannel}
|
|
10
9
|
*/
|
|
11
10
|
class VoiceChannel extends BaseGuildVoiceChannel {
|
|
12
11
|
/**
|
|
13
12
|
* Whether the channel is joinable by the client user
|
|
14
|
-
*
|
|
15
13
|
* @type {boolean}
|
|
16
14
|
* @readonly
|
|
17
15
|
*/
|
|
18
16
|
get joinable() {
|
|
19
17
|
if (!super.joinable) return false;
|
|
20
|
-
|
|
18
|
+
if (this.full && !this.permissionsFor(this.client.user).has(PermissionFlagsBits.MoveMembers, false)) return false;
|
|
19
|
+
return true;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* Checks if the client has permission to send audio to the voice channel
|
|
25
|
-
*
|
|
26
24
|
* @type {boolean}
|
|
27
25
|
* @readonly
|
|
28
26
|
*/
|
|
@@ -46,7 +44,6 @@ class VoiceChannel extends BaseGuildVoiceChannel {
|
|
|
46
44
|
|
|
47
45
|
/**
|
|
48
46
|
* Send a soundboard sound to a voice channel the user is connected to.
|
|
49
|
-
*
|
|
50
47
|
* @param {SoundboardSound|SendSoundboardSoundOptions} sound The sound to send
|
|
51
48
|
* @returns {Promise<void>}
|
|
52
49
|
*/
|
|
@@ -62,7 +59,6 @@ class VoiceChannel extends BaseGuildVoiceChannel {
|
|
|
62
59
|
|
|
63
60
|
/**
|
|
64
61
|
* Sets the bitrate of the channel.
|
|
65
|
-
*
|
|
66
62
|
* @method setBitrate
|
|
67
63
|
* @memberof VoiceChannel
|
|
68
64
|
* @instance
|
|
@@ -78,7 +74,6 @@ class VoiceChannel extends BaseGuildVoiceChannel {
|
|
|
78
74
|
|
|
79
75
|
/**
|
|
80
76
|
* Sets the RTC region of the channel.
|
|
81
|
-
*
|
|
82
77
|
* @method setRTCRegion
|
|
83
78
|
* @memberof VoiceChannel
|
|
84
79
|
* @instance
|
|
@@ -95,7 +90,6 @@ class VoiceChannel extends BaseGuildVoiceChannel {
|
|
|
95
90
|
|
|
96
91
|
/**
|
|
97
92
|
* Sets the user limit of the channel.
|
|
98
|
-
*
|
|
99
93
|
* @method setUserLimit
|
|
100
94
|
* @memberof VoiceChannel
|
|
101
95
|
* @instance
|
|
@@ -111,7 +105,6 @@ class VoiceChannel extends BaseGuildVoiceChannel {
|
|
|
111
105
|
|
|
112
106
|
/**
|
|
113
107
|
* Sets the camera video quality mode of the channel.
|
|
114
|
-
*
|
|
115
108
|
* @method setVideoQualityMode
|
|
116
109
|
* @memberof VoiceChannel
|
|
117
110
|
* @instance
|
|
@@ -120,4 +113,4 @@ class VoiceChannel extends BaseGuildVoiceChannel {
|
|
|
120
113
|
* @returns {Promise<VoiceChannel>}
|
|
121
114
|
*/
|
|
122
115
|
|
|
123
|
-
exports
|
|
116
|
+
module.exports = VoiceChannel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const { Emoji } = require('./Emoji
|
|
3
|
+
const { Emoji } = require('./Emoji');
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents an effect used in a {@link VoiceChannel}.
|
|
@@ -9,56 +9,48 @@ class VoiceChannelEffect {
|
|
|
9
9
|
constructor(data, guild) {
|
|
10
10
|
/**
|
|
11
11
|
* The guild where the effect was sent from.
|
|
12
|
-
*
|
|
13
12
|
* @type {Guild}
|
|
14
13
|
*/
|
|
15
14
|
this.guild = guild;
|
|
16
15
|
|
|
17
16
|
/**
|
|
18
17
|
* The id of the channel the effect was sent in.
|
|
19
|
-
*
|
|
20
18
|
* @type {Snowflake}
|
|
21
19
|
*/
|
|
22
20
|
this.channelId = data.channel_id;
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
23
|
* The id of the user that sent the effect.
|
|
26
|
-
*
|
|
27
24
|
* @type {Snowflake}
|
|
28
25
|
*/
|
|
29
26
|
this.userId = data.user_id;
|
|
30
27
|
|
|
31
28
|
/**
|
|
32
29
|
* The emoji of the effect.
|
|
33
|
-
*
|
|
34
30
|
* @type {?Emoji}
|
|
35
31
|
*/
|
|
36
32
|
this.emoji = data.emoji ? new Emoji(guild.client, data.emoji) : null;
|
|
37
33
|
|
|
38
34
|
/**
|
|
39
35
|
* The animation type of the effect.
|
|
40
|
-
*
|
|
41
36
|
* @type {?VoiceChannelEffectSendAnimationType}
|
|
42
37
|
*/
|
|
43
38
|
this.animationType = data.animation_type ?? null;
|
|
44
39
|
|
|
45
40
|
/**
|
|
46
41
|
* The animation id of the effect.
|
|
47
|
-
*
|
|
48
42
|
* @type {?number}
|
|
49
43
|
*/
|
|
50
44
|
this.animationId = data.animation_id ?? null;
|
|
51
45
|
|
|
52
46
|
/**
|
|
53
47
|
* The id of the soundboard sound for soundboard effects.
|
|
54
|
-
*
|
|
55
48
|
* @type {?(Snowflake|number)}
|
|
56
49
|
*/
|
|
57
50
|
this.soundId = data.sound_id ?? null;
|
|
58
51
|
|
|
59
52
|
/**
|
|
60
53
|
* The volume of the soundboard sound [0-1] for soundboard effects.
|
|
61
|
-
*
|
|
62
54
|
* @type {?number}
|
|
63
55
|
*/
|
|
64
56
|
this.soundVolume = data.sound_volume ?? null;
|
|
@@ -66,7 +58,6 @@ class VoiceChannelEffect {
|
|
|
66
58
|
|
|
67
59
|
/**
|
|
68
60
|
* The channel the effect was sent in.
|
|
69
|
-
*
|
|
70
61
|
* @type {?VoiceChannel}
|
|
71
62
|
* @readonly
|
|
72
63
|
*/
|
|
@@ -76,7 +67,6 @@ class VoiceChannelEffect {
|
|
|
76
67
|
|
|
77
68
|
/**
|
|
78
69
|
* The soundboard sound for soundboard effects.
|
|
79
|
-
*
|
|
80
70
|
* @type {?SoundboardSound}
|
|
81
71
|
* @readonly
|
|
82
72
|
*/
|
|
@@ -85,4 +75,4 @@ class VoiceChannelEffect {
|
|
|
85
75
|
}
|
|
86
76
|
}
|
|
87
77
|
|
|
88
|
-
exports
|
|
78
|
+
module.exports = VoiceChannelEffect;
|