oceanic.js 1.3.2 → 1.3.3-dev.092cc6f

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.
@@ -13,6 +13,8 @@ import type PrivateChannel from "../structures/PrivateChannel";
13
13
  import type GroupChannel from "../structures/GroupChannel";
14
14
  import type User from "../structures/User";
15
15
  import type { Uncached } from "../types/shared";
16
+ import type { CreateStageInstanceOptions, EditStageInstanceOptions } from "../types/guilds";
17
+ import StageInstance from "../structures/StageInstance";
16
18
  /** Various methods for interacting with channels. */
17
19
  export default class Channels {
18
20
  #private;
@@ -25,10 +27,10 @@ export default class Channels {
25
27
  addGroupRecipient(groupID: string, options: AddGroupRecipientOptions): Promise<void>;
26
28
  /**
27
29
  * Add a member to a thread.
28
- * @param id The ID of the thread to add them to.
30
+ * @param channelID The ID of the thread to add them to.
29
31
  * @param userID The ID of the user to add to the thread.
30
32
  */
31
- addThreadMember(id: string, userID: string): Promise<void>;
33
+ addThreadMember(channelID: string, userID: string): Promise<void>;
32
34
  /**
33
35
  * Create a direct message. This will not create a new channel if you have already started a dm with the user.
34
36
  * @param recipient The ID of the recipient of the direct message.
@@ -41,35 +43,41 @@ export default class Channels {
41
43
  createGroupDM(options: CreateGroupChannelOptions): Promise<GroupChannel>;
42
44
  /**
43
45
  * Create an invite for a channel.
44
- * @param id The ID of the channel to create an invite for.
46
+ * @param channelID The ID of the channel to create an invite for.
45
47
  * @param options The options for creating the invite.
46
48
  */
47
- createInvite<T extends InviteInfoTypes, CH extends InviteChannel | PartialInviteChannel | Uncached = InviteChannel | PartialInviteChannel | Uncached>(id: string, options: CreateInviteOptions): Promise<Invite<T, CH>>;
49
+ createInvite<T extends InviteInfoTypes, CH extends InviteChannel | PartialInviteChannel | Uncached = InviteChannel | PartialInviteChannel | Uncached>(channelID: string, options: CreateInviteOptions): Promise<Invite<T, CH>>;
48
50
  /**
49
51
  * Create a message in a channel.
50
- * @param id The ID of the channel to create the message in.
52
+ * @param channelID The ID of the channel to create the message in.
51
53
  * @param options The options for creating the message.
52
54
  */
53
- createMessage<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(id: string, options: CreateMessageOptions): Promise<Message<T>>;
55
+ createMessage<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(channelID: string, options: CreateMessageOptions): Promise<Message<T>>;
54
56
  /**
55
57
  * Add a reaction to a message.
56
- * @param id The ID of the channel the message is in.
58
+ * @param channelID The ID of the channel the message is in.
57
59
  * @param messageID The ID of the message to add a reaction to.
58
60
  * @param emoji The reaction to add to the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
59
61
  */
60
- createReaction(id: string, messageID: string, emoji: string): Promise<void>;
62
+ createReaction(channelID: string, messageID: string, emoji: string): Promise<void>;
63
+ /**
64
+ * Create a stage instance.
65
+ * @param channelID The ID of the channel to create the stage instance on.
66
+ * @param options The options for creating the stage instance.
67
+ */
68
+ createStageInstance(channelID: string, options: CreateStageInstanceOptions): Promise<StageInstance>;
61
69
  /**
62
70
  * Crosspost a message in an announcement channel.
63
- * @param id The ID of the channel to crosspost the message in.
71
+ * @param channelID The ID of the channel to crosspost the message in.
64
72
  * @param messageID The ID of the message to crosspost.
65
73
  */
66
- crosspostMessage<T extends AnnouncementChannel | Uncached = AnnouncementChannel | Uncached>(id: string, messageID: string): Promise<Message<T>>;
74
+ crosspostMessage<T extends AnnouncementChannel | Uncached = AnnouncementChannel | Uncached>(channelID: string, messageID: string): Promise<Message<T>>;
67
75
  /**
68
76
  * Delete or close a channel.
69
- * @param id The ID of the channel to delete or close.
77
+ * @param channelID The ID of the channel to delete or close.
70
78
  * @param reason The reason to be displayed in the audit log.
71
79
  */
72
- delete(id: string, reason?: string): Promise<void>;
80
+ delete(channelID: string, reason?: string): Promise<void>;
73
81
  /**
74
82
  * Delete an invite.
75
83
  * @param code The code of the invite to delete.
@@ -78,71 +86,83 @@ export default class Channels {
78
86
  deleteInvite<T extends InviteChannel | PartialInviteChannel | Uncached = InviteChannel | PartialInviteChannel | Uncached>(code: string, reason?: string): Promise<Invite<"withMetadata", T>>;
79
87
  /**
80
88
  * Delete a message.
81
- * @param id The ID of the channel to delete the message in.
89
+ * @param channelID The ID of the channel to delete the message in.
82
90
  * @param messageID The ID of the message to delete.
83
91
  * @param reason The reason for deleting the message.
84
92
  */
85
- deleteMessage(id: string, messageID: string, reason?: string): Promise<void>;
93
+ deleteMessage(channelID: string, messageID: string, reason?: string): Promise<void>;
86
94
  /**
87
95
  * Bulk delete messages.
88
- * @param id The ID of the channel to delete the messages in.
96
+ * @param channelID The ID of the channel to delete the messages in.
89
97
  * @param messageIDs The IDs of the messages to delete. Any duplicates or messages older than two weeks will cause an error.
90
98
  * @param reason The reason for deleting the messages.
91
99
  */
92
- deleteMessages(id: string, messageIDs: Array<string>, reason?: string): Promise<number>;
100
+ deleteMessages(channelID: string, messageIDs: Array<string>, reason?: string): Promise<number>;
93
101
  /**
94
102
  * Delete a permission overwrite.
95
- * @param id The ID of the channel to delete the permission overwrite in.
103
+ * @param channelID The ID of the channel to delete the permission overwrite in.
96
104
  * @param overwriteID The ID of the permission overwrite to delete.
97
105
  * @param reason The reason for deleting the permission overwrite.
98
106
  */
99
- deletePermission(id: string, overwriteID: string, reason?: string): Promise<void>;
107
+ deletePermission(channelID: string, overwriteID: string, reason?: string): Promise<void>;
100
108
  /**
101
109
  * Remove a reaction from a message.
102
- * @param id The ID of the channel the message is in.
110
+ * @param channelID The ID of the channel the message is in.
103
111
  * @param messageID The ID of the message to remove a reaction from.
104
112
  * @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
105
113
  * @param user The user to remove the reaction from, `@me` for the current user (default).
106
114
  */
107
- deleteReaction(id: string, messageID: string, emoji: string, user?: string): Promise<void>;
115
+ deleteReaction(channelID: string, messageID: string, emoji: string, user?: string): Promise<void>;
108
116
  /**
109
117
  * Remove all, or a specific emoji's reactions from a message.
110
- * @param id The ID of the channel the message is in.
118
+ * @param channelID The ID of the channel the message is in.
111
119
  * @param messageID The ID of the message to remove reactions from.
112
120
  * @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis. Omit to remove all reactions.
113
121
  */
114
- deleteReactions(id: string, messageID: string, emoji?: string): Promise<void>;
122
+ deleteReactions(channelID: string, messageID: string, emoji?: string): Promise<void>;
123
+ /**
124
+ * Delete a stage instance.
125
+ * @param channelID The ID of the channel to delete the stage instance on.
126
+ * @param reason The reason for deleting the stage instance.
127
+ */
128
+ deleteStageInstance(channelID: string, reason?: string): Promise<void>;
115
129
  /**
116
130
  * Edit a channel.
117
- * @param id The ID of the channel to edit.
131
+ * @param channelID The ID of the channel to edit.
118
132
  * @param options The options for editing the channel.
119
133
  */
120
- edit<T extends AnyEditableChannel = AnyEditableChannel>(id: string, options: EditChannelOptions): Promise<T>;
134
+ edit<T extends AnyEditableChannel = AnyEditableChannel>(channelID: string, options: EditChannelOptions): Promise<T>;
121
135
  /**
122
136
  * Edit a message.
123
- * @param id The ID of the channel the message is in.
137
+ * @param channelID The ID of the channel the message is in.
124
138
  * @param messageID The ID of the message to edit.
125
139
  * @param options The options for editing the message.
126
140
  */
127
- editMessage<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(id: string, messageID: string, options: EditMessageOptions): Promise<Message<T>>;
141
+ editMessage<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(channelID: string, messageID: string, options: EditMessageOptions): Promise<Message<T>>;
128
142
  /**
129
143
  * Edit a permission overwrite.
130
- * @param id The ID of the channel to edit the permission overwrite for.
144
+ * @param channelID The ID of the channel to edit the permission overwrite for.
131
145
  * @param overwriteID The ID of the permission overwrite to edit.
132
146
  * @param options The options for editing the permission overwrite.
133
147
  */
134
- editPermission(id: string, overwriteID: string, options: EditPermissionOptions): Promise<void>;
148
+ editPermission(channelID: string, overwriteID: string, options: EditPermissionOptions): Promise<void>;
149
+ /**
150
+ * Edit a stage instance.
151
+ * @param channelID The ID of the channel to edit the stage instance on.
152
+ * @param options The options for editing the stage instance.
153
+ */
154
+ editStageInstance(channelID: string, options: EditStageInstanceOptions): Promise<StageInstance>;
135
155
  /**
136
156
  * Follow an announcement channel.
137
- * @param id The ID of the channel to follow the announcement channel to.
157
+ * @param channelID The ID of the channel to follow the announcement channel to.
138
158
  * @param webhookChannelID The ID of the channel to follow the announcement channel to.
139
159
  */
140
- followAnnouncement(id: string, webhookChannelID: string): Promise<FollowedChannel>;
160
+ followAnnouncement(channelID: string, webhookChannelID: string): Promise<FollowedChannel>;
141
161
  /**
142
162
  * Get a channel.
143
- * @param id The ID of the channel to get.
163
+ * @param channelID The ID of the channel to get.
144
164
  */
145
- get<T extends AnyChannel = AnyChannel>(id: string): Promise<T>;
165
+ get<T extends AnyChannel = AnyChannel>(channelID: string): Promise<T>;
146
166
  /**
147
167
  * Get an invite.
148
168
  * @param code The code of the invite to get.
@@ -154,88 +174,93 @@ export default class Channels {
154
174
  getInvite<T extends InviteChannel | PartialInviteChannel | Uncached = InviteChannel | PartialInviteChannel | Uncached>(code: string, options: GetInviteWithExpirationOptions): Promise<Invite<"withMetadata" | "withExpiration", T>>;
155
175
  /**
156
176
  * Get the invites of a channel.
157
- * @param id The ID of the channel to get the invites of.
177
+ * @param channelID The ID of the channel to get the invites of.
158
178
  */
159
- getInvites<T extends InviteChannel | PartialInviteChannel | Uncached = InviteChannel | PartialInviteChannel | Uncached>(id: string): Promise<Array<Invite<"withMetadata", T>>>;
179
+ getInvites<T extends InviteChannel | PartialInviteChannel | Uncached = InviteChannel | PartialInviteChannel | Uncached>(channelID: string): Promise<Array<Invite<"withMetadata", T>>>;
160
180
  /**
161
181
  * Get the private archived threads the current user has joined in a channel.
162
- * @param id The ID of the channel to get the archived threads from.
182
+ * @param channelID The ID of the channel to get the archived threads from.
163
183
  * @param options The options for getting the archived threads.
164
184
  */
165
- getJoinedPrivateArchivedThreads(id: string, options?: GetArchivedThreadsOptions): Promise<ArchivedThreads<PrivateThreadChannel>>;
185
+ getJoinedPrivateArchivedThreads(channelID: string, options?: GetArchivedThreadsOptions): Promise<ArchivedThreads<PrivateThreadChannel>>;
166
186
  /**
167
187
  * Get a message in a channel.
168
- * @param id The ID of the channel the message is in
188
+ * @param channelID The ID of the channel the message is in
169
189
  * @param messageID The ID of the message to get.
170
190
  */
171
- getMessage<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(id: string, messageID: string): Promise<Message<T>>;
191
+ getMessage<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(channelID: string, messageID: string): Promise<Message<T>>;
172
192
  /**
173
193
  * Get messages in a channel.
174
- * @param id The ID of the channel to get messages from.
194
+ * @param channelID The ID of the channel to get messages from.
175
195
  * @param options The options for getting messages. `before`, `after`, and `around `All are mutually exclusive.
176
196
  */
177
- getMessages<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(id: string, options?: GetChannelMessagesOptions): Promise<Array<Message<T>>>;
197
+ getMessages<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(channelID: string, options?: GetChannelMessagesOptions): Promise<Array<Message<T>>>;
178
198
  /**
179
199
  * Get the pinned messages in a channel.
180
- * @param id The ID of the channel to get the pinned messages from.
200
+ * @param channelID The ID of the channel to get the pinned messages from.
181
201
  */
182
- getPinnedMessages<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(id: string): Promise<Array<Message<T>>>;
202
+ getPinnedMessages<T extends AnyTextChannelWithoutGroup | Uncached = AnyTextChannelWithoutGroup | Uncached>(channelID: string): Promise<Array<Message<T>>>;
183
203
  /**
184
204
  * Get the private archived threads in a channel.
185
- * @param id The ID of the channel to get the archived threads from.
205
+ * @param channelID The ID of the channel to get the archived threads from.
186
206
  * @param options The options for getting the archived threads.
187
207
  */
188
- getPrivateArchivedThreads(id: string, options?: GetArchivedThreadsOptions): Promise<ArchivedThreads<PrivateThreadChannel>>;
208
+ getPrivateArchivedThreads(channelID: string, options?: GetArchivedThreadsOptions): Promise<ArchivedThreads<PrivateThreadChannel>>;
189
209
  /**
190
210
  * Get the public archived threads in a channel.
191
- * @param id The ID of the channel to get the archived threads from.
211
+ * @param channelID The ID of the channel to get the archived threads from.
192
212
  * @param options The options for getting the archived threads.
193
213
  */
194
- getPublicArchivedThreads<T extends AnnouncementThreadChannel | PublicThreadChannel = AnnouncementThreadChannel | PublicThreadChannel>(id: string, options?: GetArchivedThreadsOptions): Promise<ArchivedThreads<T>>;
214
+ getPublicArchivedThreads<T extends AnnouncementThreadChannel | PublicThreadChannel = AnnouncementThreadChannel | PublicThreadChannel>(channelID: string, options?: GetArchivedThreadsOptions): Promise<ArchivedThreads<T>>;
195
215
  /**
196
216
  * Get the users who reacted with a specific emoji on a message.
197
- * @param id The ID of the channel the message is in.
217
+ * @param channelID The ID of the channel the message is in.
198
218
  * @param messageID The ID of the message to get reactions from.
199
219
  * @param emoji The reaction to remove from the message. `name:id` for custom emojis, and the unicode codepoint for default emojis.
200
220
  * @param options The options for getting the reactions.
201
221
  */
202
- getReactions(id: string, messageID: string, emoji: string, options?: GetReactionsOptions): Promise<Array<User>>;
222
+ getReactions(channelID: string, messageID: string, emoji: string, options?: GetReactionsOptions): Promise<Array<User>>;
223
+ /**
224
+ * Get the stage instance associated with a channel.
225
+ * @param channelID The ID of the channel to get the stage instance on.
226
+ */
227
+ getStageInstance(channelID: string): Promise<StageInstance>;
203
228
  /**
204
229
  * Get a thread member.
205
- * @param id The ID of the thread.
230
+ * @param channelID The ID of the thread.
206
231
  * @param userID The ID of the user to get the thread member of.
207
232
  */
208
- getThreadMember(id: string, userID: string): Promise<ThreadMember>;
233
+ getThreadMember(channelID: string, userID: string): Promise<ThreadMember>;
209
234
  /**
210
235
  * Get the members of a thread.
211
- * @param id The ID of the thread.
236
+ * @param channelID The ID of the thread.
212
237
  */
213
- getThreadMembers(id: string): Promise<Array<ThreadMember>>;
238
+ getThreadMembers(channelID: string): Promise<Array<ThreadMember>>;
214
239
  /** @deprecated Get the list of usable voice regions. Moved to `misc`. */
215
240
  getVoiceRegions(): Promise<Array<VoiceRegion>>;
216
241
  /**
217
242
  * Join a thread.
218
- * @param id The ID of the thread to join.
243
+ * @param channelID The ID of the thread to join.
219
244
  */
220
- joinThread(id: string): Promise<void>;
245
+ joinThread(channelID: string): Promise<void>;
221
246
  /**
222
247
  * Leave a thread.
223
- * @param id The ID of the thread to leave.
248
+ * @param channelID The ID of the thread to leave.
224
249
  */
225
- leaveThread(id: string): Promise<void>;
250
+ leaveThread(channelID: string): Promise<void>;
226
251
  /**
227
252
  * Pin a message in a channel.
228
- * @param id The ID of the channel to pin the message in.
253
+ * @param channelID The ID of the channel to pin the message in.
229
254
  * @param messageID The ID of the message to pin.
230
255
  * @param reason The reason for pinning the message.
231
256
  */
232
- pinMessage(id: string, messageID: string, reason?: string): Promise<void>;
257
+ pinMessage(channelID: string, messageID: string, reason?: string): Promise<void>;
233
258
  /**
234
259
  * Purge an amount of messages from a channel.
235
- * @param id The ID of the channel to purge.
260
+ * @param channelID The ID of the channel to purge.
236
261
  * @param options The options to purge. `before`, `after`, and `around `All are mutually exclusive.
237
262
  */
238
- purgeMessages<T extends AnyGuildTextChannel | Uncached = AnyGuildTextChannel | Uncached>(id: string, options: PurgeOptions<T>): Promise<number>;
263
+ purgeMessages<T extends AnyGuildTextChannel | Uncached = AnyGuildTextChannel | Uncached>(channelID: string, options: PurgeOptions<T>): Promise<number>;
239
264
  /**
240
265
  * Remove a user from the group channel.
241
266
  * @param groupID The ID of the group to remove the user from.
@@ -244,39 +269,39 @@ export default class Channels {
244
269
  removeGroupRecipient(groupID: string, userID: string): Promise<void>;
245
270
  /**
246
271
  * Remove a member from a thread.
247
- * @param id The ID of the thread to remove them from.
272
+ * @param channelID The ID of the thread to remove them from.
248
273
  * @param userID The ID of the user to remove from the thread.
249
274
  */
250
- removeThreadMember(id: string, userID: string): Promise<void>;
275
+ removeThreadMember(channelID: string, userID: string): Promise<void>;
251
276
  /**
252
277
  * Show a typing indicator in a channel. How long users see this varies from client to client.
253
- * @param id The ID of the channel to show the typing indicator in.
278
+ * @param channelID The ID of the channel to show the typing indicator in.
254
279
  */
255
- sendTyping(id: string): Promise<void>;
280
+ sendTyping(channelID: string): Promise<void>;
256
281
  /**
257
282
  * Create a thread from an existing message.
258
- * @param id The ID of the channel to create the thread in.
283
+ * @param channelID The ID of the channel to create the thread in.
259
284
  * @param messageID The ID of the message to create the thread from.
260
285
  * @param options The options for starting the thread.
261
286
  */
262
- startThreadFromMessage<T extends AnnouncementThreadChannel | PublicThreadChannel = AnnouncementThreadChannel | PublicThreadChannel>(id: string, messageID: string, options: StartThreadFromMessageOptions): Promise<T>;
287
+ startThreadFromMessage<T extends AnnouncementThreadChannel | PublicThreadChannel = AnnouncementThreadChannel | PublicThreadChannel>(channelID: string, messageID: string, options: StartThreadFromMessageOptions): Promise<T>;
263
288
  /**
264
289
  * Create a thread in a forum channel.
265
- * @param id The ID of the channel to start the thread in.
290
+ * @param channelID The ID of the channel to start the thread in.
266
291
  * @param options The options for starting the thread.
267
292
  */
268
- startThreadInForum(id: string, options: StartThreadInForumOptions): Promise<PublicThreadChannel>;
293
+ startThreadInForum(channelID: string, options: StartThreadInForumOptions): Promise<PublicThreadChannel>;
269
294
  /**
270
295
  * Create a thread without an existing message.
271
- * @param id The ID of the channel to start the thread in.
296
+ * @param channelID The ID of the channel to start the thread in.
272
297
  * @param options The options for starting the thread.
273
298
  */
274
- startThreadWithoutMessage<T extends AnnouncementThreadChannel | PublicThreadChannel | PrivateThreadChannel = AnnouncementThreadChannel | PublicThreadChannel | PrivateThreadChannel>(id: string, options: StartThreadWithoutMessageOptions): Promise<T>;
299
+ startThreadWithoutMessage<T extends AnnouncementThreadChannel | PublicThreadChannel | PrivateThreadChannel = AnnouncementThreadChannel | PublicThreadChannel | PrivateThreadChannel>(channelID: string, options: StartThreadWithoutMessageOptions): Promise<T>;
275
300
  /**
276
301
  * Unpin a message in a channel.
277
- * @param id The ID of the channel to unpin the message in.
302
+ * @param channelID The ID of the channel to unpin the message in.
278
303
  * @param messageID The ID of the message to unpin.
279
304
  * @param reason The reason for unpinning the message.
280
305
  */
281
- unpinMessage(id: string, messageID: string, reason?: string): Promise<void>;
306
+ unpinMessage(channelID: string, messageID: string, reason?: string): Promise<void>;
282
307
  }