@ovencord/discord.js 14.16.3
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/LICENSE +191 -0
- package/README.md +148 -0
- package/package.json +73 -0
- package/src/client/Client.ts +967 -0
- package/src/client/actions/Action.ts +141 -0
- package/src/client/actions/ActionsManager.ts +138 -0
- package/src/client/actions/ChannelCreate.ts +21 -0
- package/src/client/actions/ChannelDelete.ts +20 -0
- package/src/client/actions/ChannelUpdate.ts +38 -0
- package/src/client/actions/GuildChannelsPositionUpdate.ts +17 -0
- package/src/client/actions/GuildEmojiCreate.ts +17 -0
- package/src/client/actions/GuildEmojiDelete.ts +16 -0
- package/src/client/actions/GuildEmojiUpdate.ts +17 -0
- package/src/client/actions/GuildEmojisUpdate.ts +30 -0
- package/src/client/actions/GuildMemberRemove.ts +29 -0
- package/src/client/actions/GuildMemberUpdate.ts +41 -0
- package/src/client/actions/GuildRoleCreate.ts +23 -0
- package/src/client/actions/GuildRoleDelete.ts +26 -0
- package/src/client/actions/GuildRolesPositionUpdate.ts +17 -0
- package/src/client/actions/GuildScheduledEventDelete.ts +28 -0
- package/src/client/actions/GuildScheduledEventUserAdd.ts +29 -0
- package/src/client/actions/GuildScheduledEventUserRemove.ts +29 -0
- package/src/client/actions/GuildSoundboardSoundDelete.ts +26 -0
- package/src/client/actions/GuildStickerCreate.ts +17 -0
- package/src/client/actions/GuildStickerDelete.ts +16 -0
- package/src/client/actions/GuildStickerUpdate.ts +17 -0
- package/src/client/actions/GuildStickersUpdate.ts +30 -0
- package/src/client/actions/GuildUpdate.ts +30 -0
- package/src/client/actions/InteractionCreate.ts +104 -0
- package/src/client/actions/MessageCreate.ts +38 -0
- package/src/client/actions/MessageDelete.ts +29 -0
- package/src/client/actions/MessageDeleteBulk.ts +45 -0
- package/src/client/actions/MessagePollVoteAdd.ts +37 -0
- package/src/client/actions/MessagePollVoteRemove.ts +35 -0
- package/src/client/actions/MessageReactionAdd.ts +68 -0
- package/src/client/actions/MessageReactionRemove.ts +47 -0
- package/src/client/actions/MessageReactionRemoveAll.ts +30 -0
- package/src/client/actions/MessageReactionRemoveEmoji.ts +25 -0
- package/src/client/actions/MessageUpdate.ts +22 -0
- package/src/client/actions/StageInstanceCreate.ts +25 -0
- package/src/client/actions/StageInstanceDelete.ts +28 -0
- package/src/client/actions/StageInstanceUpdate.ts +27 -0
- package/src/client/actions/ThreadCreate.ts +22 -0
- package/src/client/actions/ThreadMembersUpdate.ts +45 -0
- package/src/client/actions/TypingStart.ts +26 -0
- package/src/client/actions/UserUpdate.ts +33 -0
- package/src/client/voice/ClientVoiceManager.ts +46 -0
- package/src/client/websocket/handlers/APPLICATION_COMMAND_PERMISSIONS_UPDATE.ts +19 -0
- package/src/client/websocket/handlers/AUTO_MODERATION_ACTION_EXECUTION.ts +17 -0
- package/src/client/websocket/handlers/AUTO_MODERATION_RULE_CREATE.ts +18 -0
- package/src/client/websocket/handlers/AUTO_MODERATION_RULE_DELETE.ts +21 -0
- package/src/client/websocket/handlers/AUTO_MODERATION_RULE_UPDATE.ts +20 -0
- package/src/client/websocket/handlers/CHANNEL_CREATE.ts +4 -0
- package/src/client/websocket/handlers/CHANNEL_DELETE.ts +4 -0
- package/src/client/websocket/handlers/CHANNEL_PINS_UPDATE.ts +22 -0
- package/src/client/websocket/handlers/CHANNEL_UPDATE.ts +16 -0
- package/src/client/websocket/handlers/ENTITLEMENT_CREATE.ts +14 -0
- package/src/client/websocket/handlers/ENTITLEMENT_DELETE.ts +18 -0
- package/src/client/websocket/handlers/ENTITLEMENT_UPDATE.ts +16 -0
- package/src/client/websocket/handlers/GUILD_AUDIT_LOG_ENTRY_CREATE.ts +19 -0
- package/src/client/websocket/handlers/GUILD_BAN_ADD.ts +15 -0
- package/src/client/websocket/handlers/GUILD_BAN_REMOVE.ts +20 -0
- package/src/client/websocket/handlers/GUILD_CREATE.ts +34 -0
- package/src/client/websocket/handlers/GUILD_DELETE.ts +36 -0
- package/src/client/websocket/handlers/GUILD_EMOJIS_UPDATE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_INTEGRATIONS_UPDATE.ts +15 -0
- package/src/client/websocket/handlers/GUILD_MEMBERS_CHUNK.ts +40 -0
- package/src/client/websocket/handlers/GUILD_MEMBER_ADD.ts +17 -0
- package/src/client/websocket/handlers/GUILD_MEMBER_REMOVE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_MEMBER_UPDATE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_ROLE_CREATE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_ROLE_DELETE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_ROLE_UPDATE.ts +21 -0
- package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_CREATE.ts +17 -0
- package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_DELETE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_UPDATE.ts +19 -0
- package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_ADD.ts +4 -0
- package/src/client/websocket/handlers/GUILD_SCHEDULED_EVENT_USER_REMOVE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUNDS_UPDATE.ts +24 -0
- package/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_CREATE.ts +18 -0
- package/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_DELETE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_SOUNDBOARD_SOUND_UPDATE.ts +20 -0
- package/src/client/websocket/handlers/GUILD_STICKERS_UPDATE.ts +4 -0
- package/src/client/websocket/handlers/GUILD_UPDATE.ts +4 -0
- package/src/client/websocket/handlers/INTERACTION_CREATE.ts +4 -0
- package/src/client/websocket/handlers/INVITE_CREATE.ts +20 -0
- package/src/client/websocket/handlers/INVITE_DELETE.ts +23 -0
- package/src/client/websocket/handlers/MESSAGE_CREATE.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_DELETE.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_DELETE_BULK.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_POLL_VOTE_ADD.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_POLL_VOTE_REMOVE.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_REACTION_ADD.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_ALL.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_REACTION_REMOVE_EMOJI.ts +4 -0
- package/src/client/websocket/handlers/MESSAGE_UPDATE.ts +16 -0
- package/src/client/websocket/handlers/PRESENCE_UPDATE.ts +42 -0
- package/src/client/websocket/handlers/RATE_LIMITED.ts +23 -0
- package/src/client/websocket/handlers/READY.ts +29 -0
- package/src/client/websocket/handlers/SOUNDBOARD_SOUNDS.ts +24 -0
- package/src/client/websocket/handlers/STAGE_INSTANCE_CREATE.ts +4 -0
- package/src/client/websocket/handlers/STAGE_INSTANCE_DELETE.ts +4 -0
- package/src/client/websocket/handlers/STAGE_INSTANCE_UPDATE.ts +4 -0
- package/src/client/websocket/handlers/SUBSCRIPTION_CREATE.ts +14 -0
- package/src/client/websocket/handlers/SUBSCRIPTION_DELETE.ts +16 -0
- package/src/client/websocket/handlers/SUBSCRIPTION_UPDATE.ts +16 -0
- package/src/client/websocket/handlers/THREAD_CREATE.ts +4 -0
- package/src/client/websocket/handlers/THREAD_DELETE.ts +17 -0
- package/src/client/websocket/handlers/THREAD_LIST_SYNC.ts +50 -0
- package/src/client/websocket/handlers/THREAD_MEMBERS_UPDATE.ts +4 -0
- package/src/client/websocket/handlers/THREAD_MEMBER_UPDATE.ts +25 -0
- package/src/client/websocket/handlers/THREAD_UPDATE.ts +16 -0
- package/src/client/websocket/handlers/TYPING_START.ts +4 -0
- package/src/client/websocket/handlers/USER_UPDATE.ts +4 -0
- package/src/client/websocket/handlers/VOICE_CHANNEL_EFFECT_SEND.ts +16 -0
- package/src/client/websocket/handlers/VOICE_SERVER_UPDATE.ts +5 -0
- package/src/client/websocket/handlers/VOICE_STATE_UPDATE.ts +37 -0
- package/src/client/websocket/handlers/WEBHOOKS_UPDATE.ts +16 -0
- package/src/client/websocket/handlers/index.ts +74 -0
- package/src/errors/DJSError.ts +50 -0
- package/src/errors/ErrorCodes.ts +277 -0
- package/src/errors/Messages.ts +155 -0
- package/src/errors/index.ts +6 -0
- package/src/index.ts +241 -0
- package/src/managers/ApplicationCommandManager.ts +303 -0
- package/src/managers/ApplicationCommandPermissionsManager.ts +453 -0
- package/src/managers/ApplicationEmojiManager.ts +149 -0
- package/src/managers/AutoModerationRuleManager.ts +307 -0
- package/src/managers/BaseManager.ts +13 -0
- package/src/managers/CachedManager.ts +56 -0
- package/src/managers/CategoryChannelChildManager.ts +81 -0
- package/src/managers/ChannelManager.ts +194 -0
- package/src/managers/DMMessageManager.ts +15 -0
- package/src/managers/DataManager.ts +38 -0
- package/src/managers/EntitlementManager.ts +182 -0
- package/src/managers/GuildApplicationCommandManager.ts +29 -0
- package/src/managers/GuildBanManager.ts +221 -0
- package/src/managers/GuildChannelManager.ts +552 -0
- package/src/managers/GuildEmojiManager.ts +262 -0
- package/src/managers/GuildEmojiRoleManager.ts +134 -0
- package/src/managers/GuildForumThreadManager.ts +84 -0
- package/src/managers/GuildInviteManager.ts +236 -0
- package/src/managers/GuildManager.ts +265 -0
- package/src/managers/GuildMemberManager.ts +619 -0
- package/src/managers/GuildMemberRoleManager.ts +230 -0
- package/src/managers/GuildMessageManager.ts +31 -0
- package/src/managers/GuildScheduledEventManager.ts +330 -0
- package/src/managers/GuildSoundboardSoundManager.ts +157 -0
- package/src/managers/GuildStickerManager.ts +192 -0
- package/src/managers/GuildTextThreadManager.ts +91 -0
- package/src/managers/MessageManager.ts +352 -0
- package/src/managers/PartialGroupDMMessageManager.ts +15 -0
- package/src/managers/PermissionOverwriteManager.ts +174 -0
- package/src/managers/PollAnswerVoterManager.ts +59 -0
- package/src/managers/PresenceManager.ts +60 -0
- package/src/managers/ReactionManager.ts +72 -0
- package/src/managers/ReactionUserManager.ts +82 -0
- package/src/managers/RoleManager.ts +432 -0
- package/src/managers/StageInstanceManager.ts +166 -0
- package/src/managers/SubscriptionManager.ts +83 -0
- package/src/managers/ThreadManager.ts +210 -0
- package/src/managers/ThreadMemberManager.ts +194 -0
- package/src/managers/UserManager.ts +139 -0
- package/src/managers/VoiceStateManager.ts +61 -0
- package/src/sharding/Shard.ts +513 -0
- package/src/sharding/ShardClientUtil.ts +293 -0
- package/src/sharding/ShardingManager.ts +374 -0
- package/src/structures/ActionRow.ts +31 -0
- package/src/structures/AnnouncementChannel.ts +25 -0
- package/src/structures/AnonymousGuild.ts +110 -0
- package/src/structures/ApplicationCommand.ts +675 -0
- package/src/structures/ApplicationEmoji.ts +189 -0
- package/src/structures/ApplicationRoleConnectionMetadata.ts +54 -0
- package/src/structures/Attachment.ts +189 -0
- package/src/structures/AuthorizingIntegrationOwners.ts +63 -0
- package/src/structures/AutoModerationActionExecution.ts +138 -0
- package/src/structures/AutoModerationRule.ts +325 -0
- package/src/structures/AutocompleteInteraction.ts +115 -0
- package/src/structures/Base.ts +37 -0
- package/src/structures/BaseChannel.ts +188 -0
- package/src/structures/BaseGuild.ts +134 -0
- package/src/structures/BaseGuildEmoji.ts +113 -0
- package/src/structures/BaseGuildTextChannel.ts +230 -0
- package/src/structures/BaseGuildVoiceChannel.ts +270 -0
- package/src/structures/BaseInteraction.ts +393 -0
- package/src/structures/BaseInvite.ts +192 -0
- package/src/structures/BaseSelectMenuComponent.ts +58 -0
- package/src/structures/ButtonComponent.ts +68 -0
- package/src/structures/ButtonInteraction.ts +8 -0
- package/src/structures/CategoryChannel.ts +46 -0
- package/src/structures/ChannelSelectMenuComponent.ts +18 -0
- package/src/structures/ChannelSelectMenuInteraction.ts +34 -0
- package/src/structures/ChatInputCommandInteraction.ts +43 -0
- package/src/structures/ClientApplication.ts +470 -0
- package/src/structures/ClientPresence.ts +87 -0
- package/src/structures/ClientUser.ts +219 -0
- package/src/structures/CommandInteraction.ts +193 -0
- package/src/structures/CommandInteractionOptionResolver.ts +336 -0
- package/src/structures/Component.ts +59 -0
- package/src/structures/ContainerComponent.ts +63 -0
- package/src/structures/ContextMenuCommandInteraction.ts +68 -0
- package/src/structures/DMChannel.ts +148 -0
- package/src/structures/DirectoryChannel.ts +40 -0
- package/src/structures/Embed.ts +251 -0
- package/src/structures/Emoji.ts +61 -0
- package/src/structures/Entitlement.ts +206 -0
- package/src/structures/FileComponent.ts +41 -0
- package/src/structures/ForumChannel.ts +31 -0
- package/src/structures/GroupDMInvite.ts +34 -0
- package/src/structures/Guild.ts +1605 -0
- package/src/structures/GuildAuditLogs.ts +99 -0
- package/src/structures/GuildAuditLogsEntry.ts +557 -0
- package/src/structures/GuildBan.ts +65 -0
- package/src/structures/GuildChannel.ts +515 -0
- package/src/structures/GuildEmoji.ts +159 -0
- package/src/structures/GuildInvite.ts +233 -0
- package/src/structures/GuildMember.ts +643 -0
- package/src/structures/GuildOnboarding.ts +73 -0
- package/src/structures/GuildOnboardingPrompt.ts +93 -0
- package/src/structures/GuildOnboardingPromptOption.ts +100 -0
- package/src/structures/GuildPreview.ts +218 -0
- package/src/structures/GuildPreviewEmoji.ts +28 -0
- package/src/structures/GuildScheduledEvent.ts +593 -0
- package/src/structures/GuildTemplate.ts +229 -0
- package/src/structures/Integration.ts +257 -0
- package/src/structures/IntegrationApplication.ts +84 -0
- package/src/structures/InteractionCallback.ts +86 -0
- package/src/structures/InteractionCallbackResource.ts +57 -0
- package/src/structures/InteractionCallbackResponse.ts +35 -0
- package/src/structures/InteractionCollector.ts +260 -0
- package/src/structures/InteractionWebhook.ts +65 -0
- package/src/structures/InviteGuild.ts +22 -0
- package/src/structures/LabelComponent.ts +51 -0
- package/src/structures/MediaChannel.ts +8 -0
- package/src/structures/MediaGalleryComponent.ts +31 -0
- package/src/structures/MediaGalleryItem.ts +54 -0
- package/src/structures/MentionableSelectMenuComponent.ts +8 -0
- package/src/structures/MentionableSelectMenuInteraction.ts +76 -0
- package/src/structures/Message.ts +1202 -0
- package/src/structures/MessageCollector.ts +155 -0
- package/src/structures/MessageComponentInteraction.ts +132 -0
- package/src/structures/MessageContextMenuCommandInteraction.ts +18 -0
- package/src/structures/MessageMentions.ts +327 -0
- package/src/structures/MessagePayload.ts +325 -0
- package/src/structures/MessageReaction.ts +219 -0
- package/src/structures/ModalComponentResolver.ts +237 -0
- package/src/structures/ModalSubmitInteraction.ts +260 -0
- package/src/structures/OAuth2Guild.ts +30 -0
- package/src/structures/PartialGroupDMChannel.ts +151 -0
- package/src/structures/PermissionOverwrites.ts +222 -0
- package/src/structures/Poll.ts +195 -0
- package/src/structures/PollAnswer.ts +100 -0
- package/src/structures/Presence.ts +448 -0
- package/src/structures/PrimaryEntryPointCommandInteraction.ts +8 -0
- package/src/structures/ReactionCollector.ts +245 -0
- package/src/structures/ReactionEmoji.ts +30 -0
- package/src/structures/Role.ts +543 -0
- package/src/structures/RoleSelectMenuComponent.ts +8 -0
- package/src/structures/RoleSelectMenuInteraction.ts +34 -0
- package/src/structures/SKU.ts +62 -0
- package/src/structures/SectionComponent.ts +44 -0
- package/src/structures/SeparatorComponent.ts +29 -0
- package/src/structures/SoundboardSound.ts +176 -0
- package/src/structures/StageChannel.ts +118 -0
- package/src/structures/StageInstance.ts +173 -0
- package/src/structures/Sticker.ts +300 -0
- package/src/structures/StickerPack.ts +111 -0
- package/src/structures/StringSelectMenuComponent.ts +18 -0
- package/src/structures/StringSelectMenuInteraction.ts +21 -0
- package/src/structures/Subscription.ts +138 -0
- package/src/structures/Team.ts +131 -0
- package/src/structures/TeamMember.ts +77 -0
- package/src/structures/TextChannel.ts +33 -0
- package/src/structures/TextDisplayComponent.ts +18 -0
- package/src/structures/TextInputComponent.ts +28 -0
- package/src/structures/ThreadChannel.ts +680 -0
- package/src/structures/ThreadMember.ts +125 -0
- package/src/structures/ThreadOnlyChannel.ts +276 -0
- package/src/structures/ThumbnailComponent.ts +51 -0
- package/src/structures/Typing.ts +81 -0
- package/src/structures/UnfurledMediaItem.ts +33 -0
- package/src/structures/User.ts +511 -0
- package/src/structures/UserContextMenuCommandInteraction.ts +28 -0
- package/src/structures/UserSelectMenuComponent.ts +8 -0
- package/src/structures/UserSelectMenuInteraction.ts +54 -0
- package/src/structures/VoiceChannel.ts +119 -0
- package/src/structures/VoiceChannelEffect.ts +92 -0
- package/src/structures/VoiceRegion.ts +52 -0
- package/src/structures/VoiceState.ts +346 -0
- package/src/structures/Webhook.ts +526 -0
- package/src/structures/WelcomeChannel.ts +67 -0
- package/src/structures/WelcomeScreen.ts +53 -0
- package/src/structures/Widget.ts +110 -0
- package/src/structures/WidgetMember.ts +124 -0
- package/src/structures/interfaces/Application.ts +179 -0
- package/src/structures/interfaces/Collector.ts +372 -0
- package/src/structures/interfaces/InteractionResponses.ts +384 -0
- package/src/structures/interfaces/TextBasedChannel.ts +430 -0
- package/src/util/APITypes.ts +690 -0
- package/src/util/ActivityFlagsBitField.ts +26 -0
- package/src/util/ApplicationFlagsBitField.ts +43 -0
- package/src/util/AttachmentFlagsBitField.ts +26 -0
- package/src/util/BitField.ts +178 -0
- package/src/util/ChannelFlagsBitField.ts +43 -0
- package/src/util/Channels.ts +165 -0
- package/src/util/Colors.ts +72 -0
- package/src/util/Components.ts +285 -0
- package/src/util/Constants.ts +251 -0
- package/src/util/DataResolver.ts +146 -0
- package/src/util/Enums.ts +10 -0
- package/src/util/Events.ts +178 -0
- package/src/util/GuildMemberFlagsBitField.ts +43 -0
- package/src/util/IntentsBitField.ts +35 -0
- package/src/util/InviteFlagsBitField.ts +26 -0
- package/src/util/Invites.ts +27 -0
- package/src/util/LimitedCollection.ts +73 -0
- package/src/util/MessageFlagsBitField.ts +43 -0
- package/src/util/Options.ts +215 -0
- package/src/util/Partials.ts +50 -0
- package/src/util/PermissionsBitField.ts +113 -0
- package/src/util/RoleFlagsBitField.ts +26 -0
- package/src/util/SKUFlagsBitField.ts +26 -0
- package/src/util/ShardEvents.ts +26 -0
- package/src/util/Status.ts +16 -0
- package/src/util/Sweepers.ts +532 -0
- package/src/util/Symbols.ts +1 -0
- package/src/util/SystemChannelFlagsBitField.ts +45 -0
- package/src/util/ThreadMemberFlagsBitField.ts +33 -0
- package/src/util/Transformers.ts +123 -0
- package/src/util/UserFlagsBitField.ts +33 -0
- package/src/util/Util.ts +519 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ThreadMemberFlagsBitField } from '../util/ThreadMemberFlagsBitField.js';
|
|
2
|
+
import { Base } from './Base.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a Member for a Thread.
|
|
6
|
+
*
|
|
7
|
+
* @extends {Base}
|
|
8
|
+
*/
|
|
9
|
+
export class ThreadMember extends Base {
|
|
10
|
+
public thread: any;
|
|
11
|
+
public joinedTimestamp: any;
|
|
12
|
+
public flags: any;
|
|
13
|
+
public id: any;
|
|
14
|
+
public member: any;
|
|
15
|
+
constructor(thread, data, extra = {}) {
|
|
16
|
+
super(thread.client);
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The thread that this member is a part of
|
|
20
|
+
*
|
|
21
|
+
* @type {ThreadChannel}
|
|
22
|
+
*/
|
|
23
|
+
this.thread = thread;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The timestamp the member last joined the thread at
|
|
27
|
+
*
|
|
28
|
+
* @type {?number}
|
|
29
|
+
*/
|
|
30
|
+
this.joinedTimestamp = null;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The flags for this thread member. This will be `null` if partial.
|
|
34
|
+
*
|
|
35
|
+
* @type {?ThreadMemberFlagsBitField}
|
|
36
|
+
*/
|
|
37
|
+
this.flags = null;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The id of the thread member
|
|
41
|
+
*
|
|
42
|
+
* @type {Snowflake}
|
|
43
|
+
*/
|
|
44
|
+
this.id = data.user_id;
|
|
45
|
+
|
|
46
|
+
this._patch(data, extra);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
_patch(data, extra = {}) {
|
|
50
|
+
if ('join_timestamp' in data) this.joinedTimestamp = Date.parse(data.join_timestamp);
|
|
51
|
+
if ('flags' in data) this.flags = new ThreadMemberFlagsBitField(data.flags).freeze();
|
|
52
|
+
|
|
53
|
+
if ('member' in data) {
|
|
54
|
+
/**
|
|
55
|
+
* The guild member associated with this thread member.
|
|
56
|
+
*
|
|
57
|
+
* @type {?GuildMember}
|
|
58
|
+
* @private
|
|
59
|
+
*/
|
|
60
|
+
this.member = this.thread.guild.members._add(data.member, extra.cache);
|
|
61
|
+
} else {
|
|
62
|
+
this.member ??= null;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether this thread member is a partial
|
|
68
|
+
*
|
|
69
|
+
* @type {boolean}
|
|
70
|
+
* @readonly
|
|
71
|
+
*/
|
|
72
|
+
get partial() {
|
|
73
|
+
return this.flags === null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The guild member associated with this thread member
|
|
78
|
+
*
|
|
79
|
+
* @type {?GuildMember}
|
|
80
|
+
* @readonly
|
|
81
|
+
*/
|
|
82
|
+
get guildMember() {
|
|
83
|
+
return this.member ?? this.thread.guild.members.cache.get(this.id) ?? null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The last time this member joined the thread
|
|
88
|
+
*
|
|
89
|
+
* @type {?Date}
|
|
90
|
+
* @readonly
|
|
91
|
+
*/
|
|
92
|
+
get joinedAt() {
|
|
93
|
+
return this.joinedTimestamp && new Date(this.joinedTimestamp);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The user associated with this thread member
|
|
98
|
+
*
|
|
99
|
+
* @type {?User}
|
|
100
|
+
* @readonly
|
|
101
|
+
*/
|
|
102
|
+
get user() {
|
|
103
|
+
return this.client.users.cache.get(this.id) ?? null;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Whether the client user can manage this thread member
|
|
108
|
+
*
|
|
109
|
+
* @type {boolean}
|
|
110
|
+
* @readonly
|
|
111
|
+
*/
|
|
112
|
+
get manageable() {
|
|
113
|
+
return !this.thread.archived && this.thread.editable;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Removes this member from the thread.
|
|
118
|
+
*
|
|
119
|
+
* @returns {Promise<ThreadMember>}
|
|
120
|
+
*/
|
|
121
|
+
async remove() {
|
|
122
|
+
await this.thread.members.remove(this.id);
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
import { GuildForumThreadManager } from '../managers/GuildForumThreadManager.js';
|
|
2
|
+
import { transformAPIGuildForumTag, transformAPIGuildDefaultReaction } from '../util/Channels.js';
|
|
3
|
+
import { GuildChannel } from './GuildChannel.js';
|
|
4
|
+
import { TextBasedChannel } from './interfaces/TextBasedChannel.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @typedef {Object} GuildForumTagEmoji
|
|
8
|
+
* @property {?Snowflake} id The id of a guild's custom emoji
|
|
9
|
+
* @property {?string} name The unicode character of the emoji
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {Object} GuildForumTag
|
|
14
|
+
* @property {Snowflake} id The id of the tag
|
|
15
|
+
* @property {string} name The name of the tag
|
|
16
|
+
* @property {boolean} moderated Whether this tag can only be added to or removed from threads
|
|
17
|
+
* by a member with the `ManageThreads` permission
|
|
18
|
+
* @property {?GuildForumTagEmoji} emoji The emoji of this tag
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @typedef {Object} GuildForumTagData
|
|
23
|
+
* @property {Snowflake} [id] The id of the tag
|
|
24
|
+
* @property {string} name The name of the tag
|
|
25
|
+
* @property {boolean} [moderated] Whether this tag can only be added to or removed from threads
|
|
26
|
+
* by a member with the `ManageThreads` permission
|
|
27
|
+
* @property {?GuildForumTagEmoji} [emoji] The emoji of this tag
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @typedef {Object} DefaultReactionEmoji
|
|
32
|
+
* @property {?Snowflake} id The id of a guild's custom emoji
|
|
33
|
+
* @property {?string} name The unicode character of the emoji
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Represents symbols utilized by thread-only channels.
|
|
38
|
+
*
|
|
39
|
+
* @extends {GuildChannel}
|
|
40
|
+
* @implements {TextBasedChannel}
|
|
41
|
+
* @abstract
|
|
42
|
+
*/
|
|
43
|
+
export class ThreadOnlyChannel extends GuildChannel {
|
|
44
|
+
public client: any;
|
|
45
|
+
public threads: any;
|
|
46
|
+
public availableTags: any;
|
|
47
|
+
public defaultReactionEmoji: any;
|
|
48
|
+
public defaultThreadRateLimitPerUser: any;
|
|
49
|
+
public rateLimitPerUser: any;
|
|
50
|
+
public defaultAutoArchiveDuration: any;
|
|
51
|
+
public nsfw: any;
|
|
52
|
+
public topic: any;
|
|
53
|
+
public defaultSortOrder: any;
|
|
54
|
+
constructor(guild, data, client) {
|
|
55
|
+
super(guild, data, client, false);
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* A manager of the threads belonging to this channel
|
|
59
|
+
*
|
|
60
|
+
* @type {GuildForumThreadManager}
|
|
61
|
+
*/
|
|
62
|
+
this.threads = new GuildForumThreadManager(this);
|
|
63
|
+
|
|
64
|
+
this._patch(data);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
_patch(data) {
|
|
68
|
+
super._patch(data);
|
|
69
|
+
if ('available_tags' in data) {
|
|
70
|
+
/**
|
|
71
|
+
* The set of tags that can be used in this channel.
|
|
72
|
+
*
|
|
73
|
+
* @type {GuildForumTag[]}
|
|
74
|
+
*/
|
|
75
|
+
this.availableTags = data.available_tags.map(tag => transformAPIGuildForumTag(tag));
|
|
76
|
+
} else {
|
|
77
|
+
this.availableTags ??= [];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if ('default_reaction_emoji' in data) {
|
|
81
|
+
/**
|
|
82
|
+
* The emoji to show in the add reaction button on a thread in a guild forum channel
|
|
83
|
+
*
|
|
84
|
+
* @type {?DefaultReactionEmoji}
|
|
85
|
+
*/
|
|
86
|
+
this.defaultReactionEmoji = data.default_reaction_emoji
|
|
87
|
+
? transformAPIGuildDefaultReaction(data.default_reaction_emoji)
|
|
88
|
+
: null;
|
|
89
|
+
} else {
|
|
90
|
+
this.defaultReactionEmoji ??= null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if ('default_thread_rate_limit_per_user' in data) {
|
|
94
|
+
/**
|
|
95
|
+
* The initial rate limit per user (slowmode) to set on newly created threads in a channel.
|
|
96
|
+
*
|
|
97
|
+
* @type {?number}
|
|
98
|
+
*/
|
|
99
|
+
this.defaultThreadRateLimitPerUser = data.default_thread_rate_limit_per_user;
|
|
100
|
+
} else {
|
|
101
|
+
this.defaultThreadRateLimitPerUser ??= null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if ('rate_limit_per_user' in data) {
|
|
105
|
+
/**
|
|
106
|
+
* The rate limit per user (slowmode) for this channel.
|
|
107
|
+
*
|
|
108
|
+
* @type {?number}
|
|
109
|
+
*/
|
|
110
|
+
this.rateLimitPerUser = data.rate_limit_per_user;
|
|
111
|
+
} else {
|
|
112
|
+
this.rateLimitPerUser ??= null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if ('default_auto_archive_duration' in data) {
|
|
116
|
+
/**
|
|
117
|
+
* The default auto archive duration for newly created threads in this channel.
|
|
118
|
+
*
|
|
119
|
+
* @type {?ThreadAutoArchiveDuration}
|
|
120
|
+
*/
|
|
121
|
+
this.defaultAutoArchiveDuration = data.default_auto_archive_duration;
|
|
122
|
+
} else {
|
|
123
|
+
this.defaultAutoArchiveDuration ??= null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if ('nsfw' in data) {
|
|
127
|
+
/**
|
|
128
|
+
* If this channel is considered NSFW.
|
|
129
|
+
*
|
|
130
|
+
* @type {boolean}
|
|
131
|
+
*/
|
|
132
|
+
this.nsfw = data.nsfw;
|
|
133
|
+
} else {
|
|
134
|
+
this.nsfw ??= false;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if ('topic' in data) {
|
|
138
|
+
/**
|
|
139
|
+
* The topic of this channel.
|
|
140
|
+
*
|
|
141
|
+
* @type {?string}
|
|
142
|
+
*/
|
|
143
|
+
this.topic = data.topic;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if ('default_sort_order' in data) {
|
|
147
|
+
/**
|
|
148
|
+
* The default sort order mode used to order posts
|
|
149
|
+
*
|
|
150
|
+
* @type {?SortOrderType}
|
|
151
|
+
*/
|
|
152
|
+
this.defaultSortOrder = data.default_sort_order;
|
|
153
|
+
} else {
|
|
154
|
+
this.defaultSortOrder ??= null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Sets the available tags for this forum channel
|
|
160
|
+
*
|
|
161
|
+
* @param {GuildForumTagData[]} availableTags The tags to set as available in this channel
|
|
162
|
+
* @param {string} [reason] Reason for changing the available tags
|
|
163
|
+
* @returns {Promise<this>}
|
|
164
|
+
*/
|
|
165
|
+
async setAvailableTags(availableTags, reason) {
|
|
166
|
+
return this.edit({ availableTags, reason });
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Sets the default reaction emoji for this channel
|
|
171
|
+
*
|
|
172
|
+
* @param {?DefaultReactionEmoji} defaultReactionEmoji The emoji to set as the default reaction emoji
|
|
173
|
+
* @param {string} [reason] Reason for changing the default reaction emoji
|
|
174
|
+
* @returns {Promise<this>}
|
|
175
|
+
*/
|
|
176
|
+
async setDefaultReactionEmoji(defaultReactionEmoji, reason) {
|
|
177
|
+
return this.edit({ defaultReactionEmoji, reason });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Sets the default rate limit per user (slowmode) for new threads in this channel
|
|
182
|
+
*
|
|
183
|
+
* @param {number} defaultThreadRateLimitPerUser The rate limit to set on newly created threads in this channel
|
|
184
|
+
* @param {string} [reason] Reason for changing the default rate limit
|
|
185
|
+
* @returns {Promise<this>}
|
|
186
|
+
*/
|
|
187
|
+
async setDefaultThreadRateLimitPerUser(defaultThreadRateLimitPerUser, reason) {
|
|
188
|
+
return this.edit({ defaultThreadRateLimitPerUser, reason });
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Creates an invite to this guild channel.
|
|
193
|
+
*
|
|
194
|
+
* @param {InviteCreateOptions} [options={}] The options for creating the invite
|
|
195
|
+
* @returns {Promise<Invite>}
|
|
196
|
+
* @example
|
|
197
|
+
* // Create an invite to a channel
|
|
198
|
+
* channel.createInvite()
|
|
199
|
+
* .then(invite => console.log(`Created an invite with a code of ${invite.code}`))
|
|
200
|
+
* .catch(console.error);
|
|
201
|
+
*/
|
|
202
|
+
async createInvite(options) {
|
|
203
|
+
return this.guild.invites.create(this.id, options);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Fetches a collection of invites to this guild channel.
|
|
208
|
+
* Resolves with a collection mapping invites by their codes.
|
|
209
|
+
*
|
|
210
|
+
* @param {boolean} [cache=true] Whether to cache the fetched invites
|
|
211
|
+
* @returns {Promise<Collection<string, Invite>>}
|
|
212
|
+
*/
|
|
213
|
+
async fetchInvites(cache) {
|
|
214
|
+
return this.guild.invites.fetch({ channelId: this.id, cache });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Sets the default auto archive duration for all newly created threads in this channel.
|
|
219
|
+
*
|
|
220
|
+
* @param {ThreadAutoArchiveDuration} defaultAutoArchiveDuration The new default auto archive duration
|
|
221
|
+
* @param {string} [reason] Reason for changing the channel's default auto archive duration
|
|
222
|
+
* @returns {Promise<this>}
|
|
223
|
+
*/
|
|
224
|
+
async setDefaultAutoArchiveDuration(defaultAutoArchiveDuration, reason) {
|
|
225
|
+
return this.edit({ defaultAutoArchiveDuration, reason });
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Sets a new topic for the guild channel.
|
|
230
|
+
*
|
|
231
|
+
* @param {?string} topic The new topic for the guild channel
|
|
232
|
+
* @param {string} [reason] Reason for changing the guild channel's topic
|
|
233
|
+
* @returns {Promise<this>}
|
|
234
|
+
* @example
|
|
235
|
+
* // Set a new channel topic
|
|
236
|
+
* channel.setTopic('needs more rate limiting')
|
|
237
|
+
* .then(newChannel => console.log(`Channel's new topic is ${newChannel.topic}`))
|
|
238
|
+
* .catch(console.error);
|
|
239
|
+
*/
|
|
240
|
+
async setTopic(topic, reason) {
|
|
241
|
+
return this.edit({ topic, reason });
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Sets the default sort order mode used to order posts
|
|
246
|
+
*
|
|
247
|
+
* @param {?SortOrderType} defaultSortOrder The default sort order mode to set on this channel
|
|
248
|
+
* @param {string} [reason] Reason for changing the default sort order
|
|
249
|
+
* @returns {Promise<this>}
|
|
250
|
+
*/
|
|
251
|
+
async setDefaultSortOrder(defaultSortOrder, reason) {
|
|
252
|
+
return this.edit({ defaultSortOrder, reason });
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// These are here only for documentation purposes - they are implemented by TextBasedChannel
|
|
256
|
+
|
|
257
|
+
createWebhook() {}
|
|
258
|
+
|
|
259
|
+
fetchWebhooks() {}
|
|
260
|
+
|
|
261
|
+
setNSFW() {}
|
|
262
|
+
|
|
263
|
+
setRateLimitPerUser() {}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
TextBasedChannel.applyToClass(ThreadOnlyChannel, [
|
|
267
|
+
'send',
|
|
268
|
+
'lastMessage',
|
|
269
|
+
'lastPinAt',
|
|
270
|
+
'bulkDelete',
|
|
271
|
+
'sendTyping',
|
|
272
|
+
'createMessageCollector',
|
|
273
|
+
'awaitMessages',
|
|
274
|
+
'createMessageComponentCollector',
|
|
275
|
+
'awaitMessageComponent',
|
|
276
|
+
]);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Component } from './Component.js';
|
|
2
|
+
import { UnfurledMediaItem } from './UnfurledMediaItem.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a thumbnail component
|
|
6
|
+
*
|
|
7
|
+
* @extends {Component}
|
|
8
|
+
*/
|
|
9
|
+
export class ThumbnailComponent extends Component {
|
|
10
|
+
public media: any;
|
|
11
|
+
constructor({ media, ...data }) {
|
|
12
|
+
super(data);
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The media associated with this thumbnail
|
|
16
|
+
*
|
|
17
|
+
* @type {UnfurledMediaItem}
|
|
18
|
+
* @readonly
|
|
19
|
+
*/
|
|
20
|
+
this.media = new UnfurledMediaItem(media);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The description of this thumbnail
|
|
25
|
+
*
|
|
26
|
+
* @type {?string}
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
get description() {
|
|
30
|
+
return this.data.description ?? null;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Whether this thumbnail is spoilered
|
|
35
|
+
*
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @readonly
|
|
38
|
+
*/
|
|
39
|
+
get spoiler() {
|
|
40
|
+
return this.data.spoiler ?? false;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Returns the API-compatible JSON for this component
|
|
45
|
+
*
|
|
46
|
+
* @returns {APIThumbnailComponent}
|
|
47
|
+
*/
|
|
48
|
+
toJSON() {
|
|
49
|
+
return { ...this.data, media: this.media.toJSON() };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Base } from './Base.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Represents a typing state for a user in a channel.
|
|
5
|
+
*
|
|
6
|
+
* @extends {Base}
|
|
7
|
+
*/
|
|
8
|
+
export class Typing extends Base {
|
|
9
|
+
public channel: any;
|
|
10
|
+
public user: any;
|
|
11
|
+
public startedTimestamp: any;
|
|
12
|
+
constructor(channel, user, data) {
|
|
13
|
+
super(channel.client);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The channel the status is from
|
|
17
|
+
*
|
|
18
|
+
* @type {TextBasedChannels}
|
|
19
|
+
*/
|
|
20
|
+
this.channel = channel;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The user who is typing
|
|
24
|
+
*
|
|
25
|
+
* @type {User}
|
|
26
|
+
*/
|
|
27
|
+
this.user = user;
|
|
28
|
+
|
|
29
|
+
this._patch(data);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_patch(data) {
|
|
33
|
+
if ('timestamp' in data) {
|
|
34
|
+
/**
|
|
35
|
+
* The UNIX timestamp in milliseconds the user started typing at
|
|
36
|
+
*
|
|
37
|
+
* @type {number}
|
|
38
|
+
*/
|
|
39
|
+
this.startedTimestamp = data.timestamp * 1_000;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Indicates whether the status is received from a guild.
|
|
45
|
+
*
|
|
46
|
+
* @returns {boolean}
|
|
47
|
+
*/
|
|
48
|
+
inGuild() {
|
|
49
|
+
return this.guild !== null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The time the user started typing at
|
|
54
|
+
*
|
|
55
|
+
* @type {Date}
|
|
56
|
+
* @readonly
|
|
57
|
+
*/
|
|
58
|
+
get startedAt() {
|
|
59
|
+
return new Date(this.startedTimestamp);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The guild the status is from
|
|
64
|
+
*
|
|
65
|
+
* @type {?Guild}
|
|
66
|
+
* @readonly
|
|
67
|
+
*/
|
|
68
|
+
get guild() {
|
|
69
|
+
return this.channel.guild ?? null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The member who is typing
|
|
74
|
+
*
|
|
75
|
+
* @type {?GuildMember}
|
|
76
|
+
* @readonly
|
|
77
|
+
*/
|
|
78
|
+
get member() {
|
|
79
|
+
return this.guild?.members.resolve(this.user) ?? null;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a media item in a component
|
|
3
|
+
*/
|
|
4
|
+
export class UnfurledMediaItem {
|
|
5
|
+
public data: any;
|
|
6
|
+
constructor(data) {
|
|
7
|
+
/**
|
|
8
|
+
* The API data associated with this media item
|
|
9
|
+
*
|
|
10
|
+
* @type {APIUnfurledMediaItem}
|
|
11
|
+
*/
|
|
12
|
+
this.data = data;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The URL of this media item
|
|
17
|
+
*
|
|
18
|
+
* @type {string}
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
get url() {
|
|
22
|
+
return this.data.url;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Returns the API-compatible JSON for this media item
|
|
27
|
+
*
|
|
28
|
+
* @returns {APIUnfurledMediaItem}
|
|
29
|
+
*/
|
|
30
|
+
toJSON() {
|
|
31
|
+
return { ...this.data };
|
|
32
|
+
}
|
|
33
|
+
}
|