1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
'use strict';
const { ChannelType, MessageType, ComponentType, ImageFormat, StickerFormatType } = require('discord-api-types/v10');
/**
* Max bulk deletable message age
* @typedef {number} MaxBulkDeletableMessageAge
*/
exports.MaxBulkDeletableMessageAge = 1_209_600_000;
/**
* The name of an item to be swept in Sweepers
* * `autoModerationRules`
* * `applicationCommands` - both global and guild commands
* * `bans`
* * `emojis`
* * `invites` - accepts the `lifetime` property, using it will sweep based on expires timestamp
* * `guildMembers`
* * `messages` - accepts the `lifetime` property, using it will sweep based on edited or created timestamp
* * `presences`
* * `reactions`
* * `stageInstances`
* * `stickers`
* * `threadMembers`
* * `threads` - accepts the `lifetime` property, using it will sweep archived threads based on archived timestamp
* * `users`
* * `voiceStates`
* @typedef {string} SweeperKey
*/
exports.SweeperKeys = [
'autoModerationRules',
'applicationCommands',
'bans',
'emojis',
'invites',
'guildMembers',
'messages',
'presences',
'reactions',
'stageInstances',
'stickers',
'threadMembers',
'threads',
'users',
'voiceStates',
];
/**
* The types of messages that are not `System`. The available types are:
* * {@link MessageType.Default}
* * {@link MessageType.Reply}
* * {@link MessageType.ChatInputCommand}
* * {@link MessageType.ContextMenuCommand}
* @typedef {MessageType[]} NonSystemMessageTypes
*/
exports.NonSystemMessageTypes = [
MessageType.Default,
MessageType.Reply,
MessageType.ChatInputCommand,
MessageType.ContextMenuCommand,
];
/**
* The guild channels that are text-based.
* * TextChannel
* * NewsChannel
* * ThreadChannel
* * VoiceChannel
* * StageChannel
* @typedef {TextChannel|NewsChannel|ThreadChannel|VoiceChannel|StageChannel} GuildTextBasedChannel
*/
/**
* The types of guild channels that are text-based. The available types are:
* * {@link ChannelType.GuildText}
* * {@link ChannelType.GuildAnnouncement}
* * {@link ChannelType.AnnouncementThread}
* * {@link ChannelType.PublicThread}
* * {@link ChannelType.PrivateThread}
* * {@link ChannelType.GuildVoice}
* * {@link ChannelType.GuildStageVoice}
* @typedef {ChannelType[]} GuildTextBasedChannelTypes
*/
exports.GuildTextBasedChannelTypes = [
ChannelType.GuildText,
ChannelType.GuildAnnouncement,
ChannelType.AnnouncementThread,
ChannelType.PublicThread,
ChannelType.PrivateThread,
ChannelType.GuildVoice,
ChannelType.GuildStageVoice,
];
/**
* The channels that are text-based.
* * DMChannel
* * GuildTextBasedChannel
* @typedef {DMChannel|GuildTextBasedChannel} TextBasedChannels
*/
/**
* Data that resolves to give a text-based channel. This can be:
* * A text-based channel
* * A snowflake
* @typedef {TextBasedChannels|Snowflake} TextBasedChannelsResolvable
*/
/**
* The types of channels that are text-based. The available types are:
* * {@link ChannelType.DM}
* * {@link ChannelType.GuildText}
* * {@link ChannelType.GuildAnnouncement}
* * {@link ChannelType.AnnouncementThread}
* * {@link ChannelType.PublicThread}
* * {@link ChannelType.PrivateThread}
* * {@link ChannelType.GuildVoice}
* * {@link ChannelType.GuildStageVoice}
* @typedef {ChannelType[]} TextBasedChannelTypes
*/
exports.TextBasedChannelTypes = [...exports.GuildTextBasedChannelTypes, ChannelType.DM];
/**
* The types of channels that are threads. The available types are:
* * {@link ChannelType.AnnouncementThread}
* * {@link ChannelType.PublicThread}
* * {@link ChannelType.PrivateThread}
* @typedef {ChannelType[]} ThreadChannelTypes
*/
exports.ThreadChannelTypes = [ChannelType.AnnouncementThread, ChannelType.PublicThread, ChannelType.PrivateThread];
/**
* The types of channels that are voice-based. The available types are:
* * {@link ChannelType.GuildVoice}
* * {@link ChannelType.GuildStageVoice}
* @typedef {ChannelType[]} VoiceBasedChannelTypes
*/
exports.VoiceBasedChannelTypes = [ChannelType.GuildVoice, ChannelType.GuildStageVoice];
/**
* The types of select menus. The available types are:
* * {@link ComponentType.StringSelect}
* * {@link ComponentType.UserSelect}
* * {@link ComponentType.RoleSelect}
* * {@link ComponentType.MentionableSelect}
* * {@link ComponentType.ChannelSelect}
* @typedef {ComponentType[]} SelectMenuTypes
*/
exports.SelectMenuTypes = [
ComponentType.StringSelect,
ComponentType.UserSelect,
ComponentType.RoleSelect,
ComponentType.MentionableSelect,
ComponentType.ChannelSelect,
];
/**
* The types of messages that can be deleted. The available types are:
* * {@link MessageType.AutoModerationAction}
* * {@link MessageType.ChannelFollowAdd}
* * {@link MessageType.ChannelPinnedMessage}
* * {@link MessageType.ChatInputCommand}
* * {@link MessageType.ContextMenuCommand}
* * {@link MessageType.Default}
* * {@link MessageType.GuildBoost}
* * {@link MessageType.GuildBoostTier1}
* * {@link MessageType.GuildBoostTier2}
* * {@link MessageType.GuildBoostTier3}
* * {@link MessageType.GuildInviteReminder}
* * {@link MessageType.InteractionPremiumUpsell}
* * {@link MessageType.Reply}
* * {@link MessageType.RoleSubscriptionPurchase}
* * {@link MessageType.StageEnd}
* * {@link MessageType.StageRaiseHand}
* * {@link MessageType.StageSpeaker}
* * {@link MessageType.StageStart}
* * {@link MessageType.StageTopic}
* * {@link MessageType.ThreadCreated}
* * {@link MessageType.UserJoin}
* @typedef {MessageType[]} DeletableMessageTypes
*/
exports.DeletableMessageTypes = [
MessageType.AutoModerationAction,
MessageType.ChannelFollowAdd,
MessageType.ChannelPinnedMessage,
MessageType.ChatInputCommand,
MessageType.ContextMenuCommand,
MessageType.Default,
MessageType.GuildBoost,
MessageType.GuildBoostTier1,
MessageType.GuildBoostTier2,
MessageType.GuildBoostTier3,
MessageType.GuildInviteReminder,
MessageType.InteractionPremiumUpsell,
MessageType.Reply,
MessageType.RoleSubscriptionPurchase,
MessageType.StageEnd,
MessageType.StageRaiseHand,
MessageType.StageSpeaker,
MessageType.StageStart,
MessageType.StageTopic,
MessageType.ThreadCreated,
MessageType.UserJoin,
];
/**
* A mapping between sticker formats and their respective image formats.
* * {@link StickerFormatType.PNG} -> {@link ImageFormat.PNG}
* * {@link StickerFormatType.APNG} -> {@link ImageFormat.PNG}
* * {@link StickerFormatType.Lottie} -> {@link ImageFormat.Lottie}
* * {@link StickerFormatType.GIF} -> {@link ImageFormat.GIF}
* @typedef {Object} StickerFormatExtensionMap
*/
exports.StickerFormatExtensionMap = {
[StickerFormatType.PNG]: ImageFormat.PNG,
[StickerFormatType.APNG]: ImageFormat.PNG,
[StickerFormatType.Lottie]: ImageFormat.Lottie,
[StickerFormatType.GIF]: ImageFormat.GIF,
};
/**
* @typedef {Object} Constants Constants that can be used in an enum or object-like way.
* @property {number} MaxBulkDeletableMessageAge Max bulk deletable message age
* @property {SweeperKey[]} SweeperKeys The possible names of items that can be swept in sweepers
* @property {NonSystemMessageTypes} NonSystemMessageTypes The types of messages that are not deemed a system type
* @property {TextBasedChannelTypes} TextBasedChannelTypes The types of channels that are text-based
* @property {ThreadChannelTypes} ThreadChannelTypes The types of channels that are threads
* @property {VoiceBasedChannelTypes} VoiceBasedChannelTypes The types of channels that are voice-based
* @property {SelectMenuTypes} SelectMenuTypes The types of components that are select menus.
* @property {Object} StickerFormatExtensionMap A mapping between sticker formats and their respective image formats.
*/
|