snowtransfer 0.18.0 → 0.19.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/CHANGELOG.md +33 -0
- package/dist/Constants.d.ts +59 -0
- package/dist/Constants.js +123 -0
- package/dist/Endpoints.d.ts +120 -0
- package/dist/Endpoints.js +121 -0
- package/dist/RequestHandler.d.ts +258 -0
- package/dist/RequestHandler.js +629 -0
- package/dist/SnowTransfer.d.ts +70 -0
- package/dist/SnowTransfer.js +105 -0
- package/dist/StateMachine.d.ts +104 -0
- package/dist/StateMachine.js +238 -0
- package/dist/StateMachineGraph.d.ts +3 -0
- package/dist/StateMachineGraph.js +23 -0
- package/dist/Types.d.ts +76 -0
- package/dist/Types.js +2 -0
- package/dist/index.d.ts +25 -718
- package/dist/index.js +63 -44
- package/dist/methods/Assets.d.ts +290 -0
- package/dist/methods/Assets.js +326 -0
- package/dist/methods/AuditLog.d.ts +40 -0
- package/dist/methods/AuditLog.js +44 -0
- package/dist/methods/AutoModeration.d.ts +122 -0
- package/dist/methods/AutoModeration.js +135 -0
- package/dist/methods/Bot.d.ts +65 -0
- package/dist/methods/Bot.js +75 -0
- package/dist/methods/Channel.d.ts +866 -0
- package/dist/methods/Channel.js +982 -0
- package/dist/methods/Entitlements.d.ts +87 -0
- package/dist/methods/Entitlements.js +99 -0
- package/dist/methods/Guild.d.ts +722 -0
- package/dist/methods/Guild.js +785 -0
- package/dist/methods/GuildScheduledEvent.d.ts +138 -0
- package/dist/methods/GuildScheduledEvent.js +155 -0
- package/dist/methods/GuildTemplate.d.ts +110 -0
- package/dist/methods/GuildTemplate.js +124 -0
- package/dist/methods/Interaction.d.ts +339 -0
- package/dist/methods/Interaction.js +359 -0
- package/dist/methods/Invite.d.ts +81 -0
- package/dist/methods/Invite.js +107 -0
- package/dist/methods/Sku.d.ts +58 -0
- package/dist/methods/Sku.js +66 -0
- package/dist/methods/StageInstance.d.ts +86 -0
- package/dist/methods/StageInstance.js +97 -0
- package/dist/methods/User.d.ts +167 -0
- package/dist/methods/User.js +184 -0
- package/dist/methods/Voice.d.ts +44 -0
- package/dist/methods/Voice.js +52 -0
- package/dist/methods/Webhook.d.ts +265 -0
- package/dist/methods/Webhook.js +256 -0
- package/dist/tokenless.d.ts +19 -0
- package/dist/tokenless.js +31 -0
- package/package.json +9 -9
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
import type { RequestHandler } from "../RequestHandler";
|
|
2
|
+
import type { APIGuildMember, APIGuildWidget, RESTDeleteAPIGuildBanResult, RESTDeleteAPIGuildIntegrationResult, RESTDeleteAPIGuildMemberResult, RESTDeleteAPIGuildMemberRoleResult, RESTDeleteAPIGuildRoleResult, RESTGetAPIGuildBanResult, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTGetAPIGuildChannelsResult, RESTGetAPIGuildIntegrationsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildMessagesSearchQuery, RESTGetAPIGuildMessagesSearchResult, RESTGetAPIGuildPreviewResult, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTGetAPIGuildResult, RESTGetAPIGuildRolesResult, RESTGetAPIGuildThreadsResult, RESTGetAPIGuildVanityUrlResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildWelcomeScreenResult, RESTGetAPIGuildWidgetSettingsResult, RESTPatchAPICurrentGuildMemberJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTPatchAPIGuildChannelPositionsResult, RESTPatchAPIGuildJSONBody, RESTPatchAPIGuildMemberJSONBody, RESTPatchAPIGuildMemberResult, RESTPatchAPIGuildResult, RESTPatchAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPatchAPIGuildVoiceStateCurrentMemberResult, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTPatchAPIGuildVoiceStateUserResult, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildWelcomeScreenResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTPatchAPIGuildWidgetSettingsResult, RESTPostAPIGuildChannelJSONBody, RESTPostAPIGuildChannelResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTPostAPIGuildRoleJSONBody, RESTPostAPIGuildRoleResult, RESTPutAPIGuildBanJSONBody, RESTPutAPIGuildBanResult, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTPutAPIGuildMemberRoleResult } from "discord-api-types/v10";
|
|
3
|
+
/**
|
|
4
|
+
* Methods for interacting with Guilds
|
|
5
|
+
* @since 0.1.0
|
|
6
|
+
*/
|
|
7
|
+
declare class GuildMethods {
|
|
8
|
+
readonly requestHandler: RequestHandler;
|
|
9
|
+
/**
|
|
10
|
+
* Create a new Guild Method Handler
|
|
11
|
+
*
|
|
12
|
+
* Usually SnowTransfer creates a method handler for you, this is here for completion
|
|
13
|
+
*
|
|
14
|
+
* You can access the methods listed via `client.guild.method`, where `client` is an initialized SnowTransfer instance
|
|
15
|
+
* @param requestHandler request handler that calls the rest api
|
|
16
|
+
*/
|
|
17
|
+
constructor(requestHandler: RequestHandler);
|
|
18
|
+
/**
|
|
19
|
+
* Get a guild via Id
|
|
20
|
+
*
|
|
21
|
+
* CurrentUser must be a member of the guild
|
|
22
|
+
* @since 0.1.0
|
|
23
|
+
* @param guildId Id of the guild
|
|
24
|
+
* @param withCounts when true, will return approximate member and presence counts for the guild
|
|
25
|
+
* @returns [Guild object](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const client = new SnowTransfer("TOKEN")
|
|
29
|
+
* const guild = await client.guild.getGuild("guild id")
|
|
30
|
+
*/
|
|
31
|
+
getGuild(guildId: string, withCounts?: boolean): Promise<RESTGetAPIGuildResult>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets a guild's preview. If the CurrentUser is not in the guild, the guild must be lurkable
|
|
34
|
+
* @since 0.3.0
|
|
35
|
+
* @param guildId Id of the guild
|
|
36
|
+
* @returns [Guild preview](https://discord.com/developers/docs/resources/guild#guild-preview-object)
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* const client = new SnowTransfer("TOKEN")
|
|
40
|
+
* const guildPreview = await client.guild.getGuildPreview("guild id")
|
|
41
|
+
*/
|
|
42
|
+
getGuildPreview(guildId: string): Promise<RESTGetAPIGuildPreviewResult>;
|
|
43
|
+
/**
|
|
44
|
+
* Update a guild
|
|
45
|
+
* @since 0.18.0
|
|
46
|
+
* @param guildId Id of the guild
|
|
47
|
+
* @param data Updated guild data
|
|
48
|
+
* @param reason Reason for updating the guild
|
|
49
|
+
* @returns [Guild object](https://discord.com/developers/docs/resources/guild#guild-object)
|
|
50
|
+
*
|
|
51
|
+
* | Permissions needed | Condition |
|
|
52
|
+
* |--------------------|-----------|
|
|
53
|
+
* | MANAGE_GUILD | always |
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Update the name of a guild to "Nice Guild"
|
|
57
|
+
* const client = new SnowTransfer("TOKEN")
|
|
58
|
+
* const guildData = {
|
|
59
|
+
* name: "Nice Guild"
|
|
60
|
+
* }
|
|
61
|
+
* client.guild.editGuild("guild Id", guildData)
|
|
62
|
+
*/
|
|
63
|
+
editGuild(guildId: string, data: RESTPatchAPIGuildJSONBody, reason?: string): Promise<RESTPatchAPIGuildResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Get a list of all channels for a guild. Does not include threads
|
|
66
|
+
*
|
|
67
|
+
* CurrentUser must be a member of the guild
|
|
68
|
+
* @since 0.1.0
|
|
69
|
+
* @param guildId Id of the guild
|
|
70
|
+
* @returns list of [channels](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* const client = new SnowTransfer("TOKEN")
|
|
74
|
+
* const channels = await client.guild.getGuildChannels("guild id")
|
|
75
|
+
*/
|
|
76
|
+
getGuildChannels(guildId: string): Promise<RESTGetAPIGuildChannelsResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Create a channel within a guild
|
|
79
|
+
* @since 0.1.0
|
|
80
|
+
* @param guildId Id of the guild
|
|
81
|
+
* @param data channel properties
|
|
82
|
+
* @param reason Reason for creating the channel
|
|
83
|
+
* @returns [channel object](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
84
|
+
*
|
|
85
|
+
* | Permissions needed | Condition |
|
|
86
|
+
* |--------------------|-----------------------------------------------------------------|
|
|
87
|
+
* | MANAGE_CHANNELS | always |
|
|
88
|
+
* | ADMINISTRATOR | setting MANAGE_ROLES in permission_overwrites |
|
|
89
|
+
* | * | if setting * permission in overwrites where * is any permission |
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* // Creates a guild voice channel with the name "nice voice channel" and with permission connect denied for the @ everyone role
|
|
93
|
+
* const client = new SnowTransfer("TOKEN")
|
|
94
|
+
* const channelData = \{
|
|
95
|
+
* name: "nice voice channel",
|
|
96
|
+
* type: 2,
|
|
97
|
+
* permission_overwrites: [\{ id: "guild id", type: 0, allow: "0" deny: (BigInt(1) << BigInt(20)).toString() \}]
|
|
98
|
+
* \}
|
|
99
|
+
* const channel = await client.guild.createGuildChannel("guild id", channelData)
|
|
100
|
+
*/
|
|
101
|
+
createGuildChannel(guildId: string, data: RESTPostAPIGuildChannelJSONBody, reason?: string): Promise<RESTPostAPIGuildChannelResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Batch update the positions of channels. Only those being moved needs to be included here
|
|
104
|
+
* @since 0.18.0
|
|
105
|
+
* @param guildId Id of the guild
|
|
106
|
+
* @param data Positional data to send
|
|
107
|
+
* @param reason Reason for updating the channels' positions
|
|
108
|
+
* @returns Resolves the Promise on successful execution
|
|
109
|
+
*
|
|
110
|
+
* | Permissions needed | Condition |
|
|
111
|
+
* |--------------------|-----------|
|
|
112
|
+
* | MANAGE_CHANNELS | always |
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* // Sets the position of a channel to 2 under a category channel
|
|
116
|
+
* const client = new SnowTransfer("TOKEN")
|
|
117
|
+
* client.guild.editChannelPositions("guild id", [{ id: "channel id", position: 2, parent_id: "category id" }], "they looked out of order")
|
|
118
|
+
*/
|
|
119
|
+
editChannelPositions(guildId: string, data: RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string): Promise<RESTPatchAPIGuildChannelPositionsResult>;
|
|
120
|
+
/**
|
|
121
|
+
* Returns all active threads in the guild, including public and private threads. Threads are ordered by their `id`, in descending order
|
|
122
|
+
* @since 0.3.0
|
|
123
|
+
* @param guildId Id of the guild
|
|
124
|
+
* @returns All active threads and member objects of the CurrentUser that the CurrentUser has access to.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* const client = new SnowTransfer("TOKEN")
|
|
128
|
+
* const threads = await client.guild.listActiveThreads("guild id")
|
|
129
|
+
*/
|
|
130
|
+
listActiveThreads(guildId: string): Promise<RESTGetAPIGuildThreadsResult>;
|
|
131
|
+
/**
|
|
132
|
+
* Get a guild member via Id
|
|
133
|
+
*
|
|
134
|
+
* CurrentUser must be a member of the guild
|
|
135
|
+
* @since 0.1.0
|
|
136
|
+
* @param guildId Id of the guild
|
|
137
|
+
* @param memberId Id of the guild member
|
|
138
|
+
* @returns [guild member](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* const client = new SnowTransfer("TOKEN")
|
|
142
|
+
* const member = await client.guild.getGuildMember("guild id", "member id")
|
|
143
|
+
*/
|
|
144
|
+
getGuildMember(guildId: string, memberId: string): Promise<RESTGetAPIGuildMemberResult>;
|
|
145
|
+
/**
|
|
146
|
+
* Get a list of guild members
|
|
147
|
+
*
|
|
148
|
+
* CurrentUser must be a member of the guild
|
|
149
|
+
* @since 0.1.0
|
|
150
|
+
* @param guildId Id of the guild
|
|
151
|
+
* @param options query data
|
|
152
|
+
* @returns list of [guild members](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
153
|
+
*
|
|
154
|
+
* | Intents |
|
|
155
|
+
* |---------------|
|
|
156
|
+
* | GUILD_MEMBERS |
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* // Gets 10 members from a guild
|
|
160
|
+
* const client = new SnowTransfer("TOKEN")
|
|
161
|
+
* const members = await client.guild.getGuildMembers("guild id", { limit: 10 })
|
|
162
|
+
*/
|
|
163
|
+
getGuildMembers(guildId: string, options?: RESTGetAPIGuildMembersQuery): Promise<RESTGetAPIGuildMembersResult>;
|
|
164
|
+
/**
|
|
165
|
+
* Get a list of guild members that match a query
|
|
166
|
+
* @since 0.3.0
|
|
167
|
+
* @param guildId Id of the guild
|
|
168
|
+
* @param options query data
|
|
169
|
+
* @returns list of [guild members](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure)
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* // Gets all members with the username "Wolke"
|
|
173
|
+
* const client = new SnowTransfer("TOKEN")
|
|
174
|
+
* const members = await client.guild.searchGuildMembers("guild id", { query: "Wolke" })
|
|
175
|
+
*/
|
|
176
|
+
searchGuildMembers(guildId: string, options: RESTGetAPIGuildMembersSearchQuery): Promise<RESTGetAPIGuildMembersSearchResult>;
|
|
177
|
+
/**
|
|
178
|
+
* Add a guild member to a guild via oauth2 access token
|
|
179
|
+
*
|
|
180
|
+
* CurrentUser must be a member of the guild
|
|
181
|
+
* @since 0.1.0
|
|
182
|
+
* @param guildId Id of the guild
|
|
183
|
+
* @param memberId Id of the guild member
|
|
184
|
+
* @param data object containing the needed request data
|
|
185
|
+
* @returns [guild member](https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure) or void if the member is already in the guild
|
|
186
|
+
*
|
|
187
|
+
* | Permissions needed | Condition |
|
|
188
|
+
* |-----------------------|-----------|
|
|
189
|
+
* | CREATE_INSTANT_INVITE | always |
|
|
190
|
+
*
|
|
191
|
+
* | OAUTH2 Scopes |
|
|
192
|
+
* |---------------|
|
|
193
|
+
* | guilds.join |
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* // add a user to a server
|
|
197
|
+
* const client = new SnowTransfer("TOKEN")
|
|
198
|
+
* const memberData = {
|
|
199
|
+
* access_token: "access token of a user with the guilds.join scope"
|
|
200
|
+
* }
|
|
201
|
+
* client.guild.addGuildMember("guildId", "memberId", memberData)
|
|
202
|
+
*/
|
|
203
|
+
addGuildMember(guildId: string, memberId: string, data: RESTPutAPIGuildMemberJSONBody): Promise<RESTPutAPIGuildMemberResult>;
|
|
204
|
+
/**
|
|
205
|
+
* Update properties of a guild member
|
|
206
|
+
* @since 0.18.0
|
|
207
|
+
* @param guildId Id of the guild
|
|
208
|
+
* @param memberId Id of the guild member
|
|
209
|
+
* @param data Updated properties
|
|
210
|
+
* @param reason Reason for updating the guild member
|
|
211
|
+
* @returns Resolves the Promise on successful execution
|
|
212
|
+
*
|
|
213
|
+
* | Permissions needed | Condition |
|
|
214
|
+
* |--------------------|--------------|
|
|
215
|
+
* | MANAGE_NICKNAMES | Nick Updates |
|
|
216
|
+
* | MANAGE_ROLES | Role Updates |
|
|
217
|
+
* | MUTE_MEMBERS | Mute Updates |
|
|
218
|
+
* | DEAFEN_MEMBERS | Deaf Updates |
|
|
219
|
+
* | MOVE_MEMBERS | Voice Move |
|
|
220
|
+
* | CONNECT | Voice Move |
|
|
221
|
+
* | MODERATE_MEMBERS | Timeouts |
|
|
222
|
+
*
|
|
223
|
+
* @example
|
|
224
|
+
* // Reset the nickname of a guild member
|
|
225
|
+
* const client = new SnowTransfer("TOKEN")
|
|
226
|
+
* const memberData = {
|
|
227
|
+
* nick: "" // You can reset nicknames by providing an empty string as the value of data.nick
|
|
228
|
+
* }
|
|
229
|
+
* const member = await client.guild.editGuildMember("guild Id", "memberId", memberData)
|
|
230
|
+
*/
|
|
231
|
+
editGuildMember(guildId: string, memberId: string, data: RESTPatchAPIGuildMemberJSONBody, reason?: string): Promise<RESTPatchAPIGuildMemberResult>;
|
|
232
|
+
/**
|
|
233
|
+
* Update the nick of the CurrentMember
|
|
234
|
+
* @since 0.18.0
|
|
235
|
+
* @param guildId Id of the guild
|
|
236
|
+
* @param data Data to update self with
|
|
237
|
+
* @param reason Reason for updating self
|
|
238
|
+
* @returns Resolves the Promise on successful execution
|
|
239
|
+
*
|
|
240
|
+
* | Permissions needed | Condition |
|
|
241
|
+
* |--------------------|-----------|
|
|
242
|
+
* | CHANGE_NICKNAME | always |
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* // change nick of bot to "Nice Nick"
|
|
246
|
+
* const client = new SnowTransfer("TOKEN")
|
|
247
|
+
* const nickData = {
|
|
248
|
+
* nick: "Nice Nick"
|
|
249
|
+
* }
|
|
250
|
+
* client.guild.editSelf("guildId", nickData)
|
|
251
|
+
*/
|
|
252
|
+
editSelf(guildId: string, data: RESTPatchAPICurrentGuildMemberJSONBody, reason?: string): Promise<APIGuildMember>;
|
|
253
|
+
/**
|
|
254
|
+
* Add a role to a guild member
|
|
255
|
+
* @since 0.1.0
|
|
256
|
+
* @param guildId Id of the guild
|
|
257
|
+
* @param memberId Id of the guild member
|
|
258
|
+
* @param roleId Id of the role
|
|
259
|
+
* @param reason The reason for the role to be added
|
|
260
|
+
* @returns Resolves the Promise on successful execution
|
|
261
|
+
*
|
|
262
|
+
* | Permissions needed | Condition |
|
|
263
|
+
* |--------------------|-----------|
|
|
264
|
+
* | MANAGE_ROLES | always |
|
|
265
|
+
*
|
|
266
|
+
* @example
|
|
267
|
+
* // add a role to a member with a reason of "I want to add a role"
|
|
268
|
+
* const client = new SnowTransfer("TOKEN")
|
|
269
|
+
* client.guild.addGuildMemberRole("guildId", "memberId", "roleId", "I want to add a role")
|
|
270
|
+
*/
|
|
271
|
+
addGuildMemberRole(guildId: string, memberId: string, roleId: string, reason?: string): Promise<RESTPutAPIGuildMemberRoleResult>;
|
|
272
|
+
/**
|
|
273
|
+
* Remove a role from a guild member
|
|
274
|
+
* @since 0.18.0
|
|
275
|
+
* @param guildId Id of the guild
|
|
276
|
+
* @param memberId Id of the guild member
|
|
277
|
+
* @param roleId Id of the role
|
|
278
|
+
* @param reason The reason for the role to be removed
|
|
279
|
+
* @returns Resolves the Promise on successful execution
|
|
280
|
+
*
|
|
281
|
+
* | Permissions needed | Condition |
|
|
282
|
+
* |--------------------|-----------|
|
|
283
|
+
* | MANAGE_ROLES | always |
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* // remove a role from a member with a reason of "I want to remove a role"
|
|
287
|
+
* const client = new SnowTransfer("TOKEN")
|
|
288
|
+
* client.guild.deleteGuildMemberRole("guildId", "memberId", "roleId", "I want to remove a role")
|
|
289
|
+
*/
|
|
290
|
+
deleteGuildMemberRole(guildId: string, memberId: string, roleId: string, reason?: string): Promise<RESTDeleteAPIGuildMemberRoleResult>;
|
|
291
|
+
/**
|
|
292
|
+
* Remove a guild member (aka kick them)
|
|
293
|
+
* @since 0.18.0
|
|
294
|
+
* @param guildId Id of the guild
|
|
295
|
+
* @param memberId Id of the guild member
|
|
296
|
+
* @param reason Reason for kicking the member
|
|
297
|
+
* @returns Resolves the Promise on successful execution
|
|
298
|
+
*
|
|
299
|
+
* | Permissions needed | Condition |
|
|
300
|
+
* |--------------------|-----------|
|
|
301
|
+
* | KICK_MEMBERS | always |
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* // Kick a member with a reason of "spam"
|
|
305
|
+
* const client = new SnowTransfer("TOKEN")
|
|
306
|
+
* client.guild.deleteGuildMember("guild Id", "memberId", "spam")
|
|
307
|
+
*/
|
|
308
|
+
deleteGuildMember(guildId: string, memberId: string, reason?: string): Promise<RESTDeleteAPIGuildMemberResult>;
|
|
309
|
+
/**
|
|
310
|
+
* Get bans of a guild
|
|
311
|
+
* @since 0.1.0
|
|
312
|
+
* @param guildId Id of the guild
|
|
313
|
+
* @param options Query string options
|
|
314
|
+
* @returns List of [bans](https://discord.com/developers/docs/resources/guild#ban-object-ban-structure)
|
|
315
|
+
*
|
|
316
|
+
* | Permissions needed | Condition |
|
|
317
|
+
* |--------------------|-----------|
|
|
318
|
+
* | BAN_MEMBERS | always |
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* const client = new SnowTransfer("TOKEN")
|
|
322
|
+
* const bans = await client.guild.getGuildBans("guildId")
|
|
323
|
+
*/
|
|
324
|
+
getGuildBans(guildId: string, options?: RESTGetAPIGuildBansQuery): Promise<RESTGetAPIGuildBansResult>;
|
|
325
|
+
/**
|
|
326
|
+
* Get a specific ban of a guild member
|
|
327
|
+
* @since 0.4.2
|
|
328
|
+
* @param guildId Id of the guild
|
|
329
|
+
* @param memberId Id of the member
|
|
330
|
+
* @returns [ban](https://discord.com/developers/docs/resources/guild#ban-object-ban-structure) object
|
|
331
|
+
*
|
|
332
|
+
* @throws a `DiscordAPIError` if the member is not banned
|
|
333
|
+
*
|
|
334
|
+
* | Permissions needed | Condition |
|
|
335
|
+
* |--------------------|-----------|
|
|
336
|
+
* | BAN_MEMBERS | always |
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* const client = new SnowTransfer("TOKEN")
|
|
340
|
+
* const ban = await client.guild.getGuildBan("guildId", "memberId")
|
|
341
|
+
*/
|
|
342
|
+
getGuildBan(guildId: string, memberId: string): Promise<RESTGetAPIGuildBanResult>;
|
|
343
|
+
/**
|
|
344
|
+
* Ban a guild member
|
|
345
|
+
* @since 0.1.0
|
|
346
|
+
* @param guildId Id of the guild
|
|
347
|
+
* @param memberId Id of the guild member
|
|
348
|
+
* @param data object with delete_message_days property
|
|
349
|
+
* @param reason Reason for banning the member
|
|
350
|
+
* @returns Resolves the Promise on successful execution
|
|
351
|
+
*
|
|
352
|
+
* | Permissions needed | Condition |
|
|
353
|
+
* |--------------------|-----------|
|
|
354
|
+
* | BAN_MEMBERS | always |
|
|
355
|
+
*
|
|
356
|
+
* @example
|
|
357
|
+
* // Ban a user with a reason and delete the last 2 days of their messages
|
|
358
|
+
* const client = new SnowTransfer("TOKEN")
|
|
359
|
+
* const banData = {
|
|
360
|
+
* delete_message_days: 2
|
|
361
|
+
* }
|
|
362
|
+
* client.guild.createGuildBan("guild Id", "memberId", banData, "Memes were not good enough")
|
|
363
|
+
*/
|
|
364
|
+
createGuildBan(guildId: string, memberId: string, data?: RESTPutAPIGuildBanJSONBody, reason?: string): Promise<RESTPutAPIGuildBanResult>;
|
|
365
|
+
/**
|
|
366
|
+
* Remove a ban of a user
|
|
367
|
+
* @since 0.18.0
|
|
368
|
+
* @param guildId Id of the guild
|
|
369
|
+
* @param memberId Id of the guild member
|
|
370
|
+
* @param reason Reason for removing the ban
|
|
371
|
+
* @returns Resolves the Promise on successful execution
|
|
372
|
+
*
|
|
373
|
+
* | Permissions needed | Condition |
|
|
374
|
+
* |--------------------|-----------|
|
|
375
|
+
* | BAN_MEMBERS | always |
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* // Remove a ban of a user with a reason
|
|
379
|
+
* const client = new SnowTransfer("TOKEN")
|
|
380
|
+
* client.guild.deleteGuildBan("guildId", "memberId", "This guy was cool")
|
|
381
|
+
*/
|
|
382
|
+
deleteGuildBan(guildId: string, memberId: string, reason?: string): Promise<RESTDeleteAPIGuildBanResult>;
|
|
383
|
+
/**
|
|
384
|
+
* Get a list of roles for a guild
|
|
385
|
+
* @since 0.1.0
|
|
386
|
+
* @param guildId Id of the guild
|
|
387
|
+
* @returns array of [roles](https://discord.com/developers/docs/topics/permissions#role-object)
|
|
388
|
+
*
|
|
389
|
+
* | Permissions needed | Condition |
|
|
390
|
+
* |--------------------|-----------|
|
|
391
|
+
* | MANAGE_ROLES | always |
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* const client = new SnowTransfer("TOKEN")
|
|
395
|
+
* const roles = await client.guild.getGuildRoles("guildId")
|
|
396
|
+
*/
|
|
397
|
+
getGuildRoles(guildId: string): Promise<RESTGetAPIGuildRolesResult>;
|
|
398
|
+
/**
|
|
399
|
+
* Create a new Role
|
|
400
|
+
* @since 0.1.0
|
|
401
|
+
* @param guildId Id of the guild
|
|
402
|
+
* @param data data with role properties
|
|
403
|
+
* @param reason Reason for creating the role
|
|
404
|
+
* @returns [role](https://discord.com/developers/docs/resources/channel#channel-object-channel-structure)
|
|
405
|
+
*
|
|
406
|
+
* | Permissions needed | Condition |
|
|
407
|
+
* |--------------------|-----------|
|
|
408
|
+
* | MANAGE_ROLES | always |
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* // Create a role with the name "Nice Role" and a color of a soft blue
|
|
412
|
+
* const client = new SnowTransfer("TOKEN")
|
|
413
|
+
* const roleData = {
|
|
414
|
+
* name: "Nice Role",
|
|
415
|
+
* color: 0x7c7cf8
|
|
416
|
+
* }
|
|
417
|
+
* client.guild.createGuildRole("guild Id", roleData)
|
|
418
|
+
*/
|
|
419
|
+
createGuildRole(guildId: string, data?: RESTPostAPIGuildRoleJSONBody, reason?: string): Promise<RESTPostAPIGuildRoleResult>;
|
|
420
|
+
/**
|
|
421
|
+
* Modify the positions of roles
|
|
422
|
+
* @since 0.18.0
|
|
423
|
+
* @param guildId Id of the guild
|
|
424
|
+
* @param data Role data to update
|
|
425
|
+
* @param reason Reason for moving the roles
|
|
426
|
+
* @returns array of [roles](https://discord.com/developers/docs/topics/permissions#role-object)
|
|
427
|
+
*
|
|
428
|
+
* | Permissions needed | Condition |
|
|
429
|
+
* |--------------------|-----------|
|
|
430
|
+
* | MANAGE_ROLES | always |
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* const client = new SnowTransfer("TOKEN")
|
|
434
|
+
* const roles = await client.guild.editGuildRolePositions("guildId", [{ id: "guild id", position: 1 }, { id: "role id 2", position: 2 }])
|
|
435
|
+
*/
|
|
436
|
+
editGuildRolePositions(guildId: string, data: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string): Promise<RESTPatchAPIGuildRolePositionsResult>;
|
|
437
|
+
/**
|
|
438
|
+
* Update a guild role
|
|
439
|
+
* @since 0.18.0
|
|
440
|
+
* @param guildId Id of the guild
|
|
441
|
+
* @param roleId Id of the role
|
|
442
|
+
* @param data updated properties of the role
|
|
443
|
+
* @param reason Reason for updating the role
|
|
444
|
+
* @returns [Updated Role](https://discord.com/developers/docs/topics/permissions#role-object)
|
|
445
|
+
*
|
|
446
|
+
* | Permissions needed | Condition |
|
|
447
|
+
* |--------------------|-----------|
|
|
448
|
+
* | MANAGE_ROLES | always |
|
|
449
|
+
*
|
|
450
|
+
* @example
|
|
451
|
+
* const client = new SnowTransfer("TOKEN")
|
|
452
|
+
* const roleData = {
|
|
453
|
+
* name: "Nicer Role",
|
|
454
|
+
* }
|
|
455
|
+
* client.guild.editGuildRole("guildId", "roleId", roleData)
|
|
456
|
+
*/
|
|
457
|
+
editGuildRole(guildId: string, roleId: string, data: RESTPatchAPIGuildRoleJSONBody, reason?: string): Promise<RESTPatchAPIGuildRoleResult>;
|
|
458
|
+
/**
|
|
459
|
+
* Delete a role from the guild
|
|
460
|
+
* @since 0.18.0
|
|
461
|
+
* @param guildId Id of the guild
|
|
462
|
+
* @param roleId Id of the role
|
|
463
|
+
* @param reason Reason for deleting the role
|
|
464
|
+
* @returns Resolves the Promise on successful execution
|
|
465
|
+
*
|
|
466
|
+
* | Permissions needed | Condition |
|
|
467
|
+
* |--------------------|-----------|
|
|
468
|
+
* | MANAGE_ROLES | always |
|
|
469
|
+
*
|
|
470
|
+
* @example
|
|
471
|
+
* // Deletes a role with a reason "This role is too cool"
|
|
472
|
+
* const client = new SnowTransfer("TOKEN")
|
|
473
|
+
* client.guild.deleteGuildRole("guildId", "roleId", "This role is too cool")
|
|
474
|
+
*/
|
|
475
|
+
deleteGuildRole(guildId: string, roleId: string, reason?: string): Promise<RESTDeleteAPIGuildRoleResult>;
|
|
476
|
+
/**
|
|
477
|
+
* Get the amount of members that would be pruned when a prune with the passed amount of days would be started
|
|
478
|
+
* @since 0.1.0
|
|
479
|
+
* @param guildId Id of the guild
|
|
480
|
+
* @param options Object with prune data
|
|
481
|
+
* @returns Object with a "pruned" key indicating the amount of members that would be pruned
|
|
482
|
+
*
|
|
483
|
+
* | Permissions needed | Condition |
|
|
484
|
+
* |--------------------|-----------|
|
|
485
|
+
* | KICK_MEMBERS | always |
|
|
486
|
+
*
|
|
487
|
+
* @example
|
|
488
|
+
* const client = new SnowTransfer("TOKEN")
|
|
489
|
+
* const data = await client.guild.getGuildPruneCount("guildId", { days: 7 })
|
|
490
|
+
*/
|
|
491
|
+
getGuildPruneCount(guildId: string, options?: RESTGetAPIGuildPruneCountQuery): Promise<RESTGetAPIGuildPruneCountResult>;
|
|
492
|
+
/**
|
|
493
|
+
* Start a prune
|
|
494
|
+
* @since 0.1.0
|
|
495
|
+
* @param guildId Id of the guild
|
|
496
|
+
* @param data Object with prune data
|
|
497
|
+
* @param reason Reason for starting the prune
|
|
498
|
+
* @returns Object with a "pruned" key indicating the amount of members that were pruned
|
|
499
|
+
*
|
|
500
|
+
* | Permissions needed | Condition |
|
|
501
|
+
* |--------------------|-----------|
|
|
502
|
+
* | KICK_MEMBERS | always |
|
|
503
|
+
*
|
|
504
|
+
* @example
|
|
505
|
+
* const client = new SnowTransfer("TOKEN")
|
|
506
|
+
* const data = await client.guild.startGuildPrune("guildId", { days: 7 })
|
|
507
|
+
*/
|
|
508
|
+
startGuildPrune(guildId: string, data: RESTPostAPIGuildPruneJSONBody & {
|
|
509
|
+
compute_prune_count: true;
|
|
510
|
+
}, reason?: string): Promise<RESTPostAPIGuildPruneResult & {
|
|
511
|
+
pruned: number;
|
|
512
|
+
}>;
|
|
513
|
+
startGuildPrune(guildId: string, data: RESTPostAPIGuildPruneJSONBody & {
|
|
514
|
+
compute_prune_count: false;
|
|
515
|
+
}, reason?: string): Promise<RESTPostAPIGuildPruneResult & {
|
|
516
|
+
pruned: null;
|
|
517
|
+
}>;
|
|
518
|
+
/**
|
|
519
|
+
* Get a list of voice regions for the guild, includes vip-regions unlike voice.getVoiceRegions
|
|
520
|
+
* @since 0.1.0
|
|
521
|
+
* @param guildId Id of the guild
|
|
522
|
+
* @returns List of [voice regions](https://discord.com/developers/docs/resources/voice#voice-region-object)
|
|
523
|
+
*
|
|
524
|
+
* @example
|
|
525
|
+
* const client = new SnowTransfer("TOKEN")
|
|
526
|
+
* const regions = await client.guild.getGuildVoiceRegions("guildId")
|
|
527
|
+
*/
|
|
528
|
+
getGuildVoiceRegions(guildId: string): Promise<RESTGetAPIGuildVoiceRegionsResult>;
|
|
529
|
+
/**
|
|
530
|
+
* Get invites for a guild
|
|
531
|
+
* @since 0.1.0
|
|
532
|
+
* @param guildId Id of the guild
|
|
533
|
+
* @returns List of [invites](https://discord.com/developers/docs/resources/invite#invite-object) (with metadata)
|
|
534
|
+
*
|
|
535
|
+
* | Permissions needed | Condition |
|
|
536
|
+
* |--------------------|-----------|
|
|
537
|
+
* | MANAGE_GUILD | always |
|
|
538
|
+
*
|
|
539
|
+
* @example
|
|
540
|
+
* const client = new SnowTransfer("TOKEN")
|
|
541
|
+
* const invites = await client.guild.getGuildInvites("guildId")
|
|
542
|
+
*/
|
|
543
|
+
getGuildInvites(guildId: string): Promise<RESTGetAPIGuildInvitesResult>;
|
|
544
|
+
/**
|
|
545
|
+
* Get integrations for a guild
|
|
546
|
+
* @since 0.1.0
|
|
547
|
+
* @param guildId Id of the guild
|
|
548
|
+
* @returns List of [integration objects](https://discord.com/developers/docs/resources/guild#integration-object)
|
|
549
|
+
*
|
|
550
|
+
* | Permissions needed | Condition |
|
|
551
|
+
* |--------------------|-----------|
|
|
552
|
+
* | MANAGE_GUILD | always |
|
|
553
|
+
*
|
|
554
|
+
* @example
|
|
555
|
+
* const client = new SnowTransfer("TOKEN")
|
|
556
|
+
* const integrations = await client.guild.getGuildIntegrations("guildId")
|
|
557
|
+
*/
|
|
558
|
+
getGuildIntegrations(guildId: string): Promise<RESTGetAPIGuildIntegrationsResult>;
|
|
559
|
+
/**
|
|
560
|
+
* Delete a guild integration
|
|
561
|
+
* @since 0.18.0
|
|
562
|
+
* @param guildId Id of the guild
|
|
563
|
+
* @param integrationId Id of the integration
|
|
564
|
+
* @param reason Reason for removing the integration
|
|
565
|
+
* @returns Resolves the Promise on successful execution
|
|
566
|
+
*
|
|
567
|
+
* | Permissions needed | Condition |
|
|
568
|
+
* |--------------------|-----------|
|
|
569
|
+
* | MANAGE_GUILD | always |
|
|
570
|
+
*
|
|
571
|
+
* @example
|
|
572
|
+
* const client = new SnowTransfer("TOKEN")
|
|
573
|
+
* await client.guild.deleteGuildIntegration("guildId", "integrationId", "Didn't need anymore")
|
|
574
|
+
*/
|
|
575
|
+
deleteGuildIntegration(guildId: string, integrationId: string, reason?: string): Promise<RESTDeleteAPIGuildIntegrationResult>;
|
|
576
|
+
/**
|
|
577
|
+
* Get a guild widget settings object
|
|
578
|
+
* @since 0.3.0
|
|
579
|
+
* @param guildId Id of the guild
|
|
580
|
+
* @returns [Guild Widget settings](https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure)
|
|
581
|
+
*
|
|
582
|
+
* | Permissions needed | Condition |
|
|
583
|
+
* |--------------------|-----------|
|
|
584
|
+
* | MANAGE_GUILD | always |
|
|
585
|
+
*
|
|
586
|
+
* @example
|
|
587
|
+
* const client = new SnowTransfer("TOKEN")
|
|
588
|
+
* const widgetSettings = await client.guild.getGuildWidgetSettings("guildId")
|
|
589
|
+
*/
|
|
590
|
+
getGuildWidgetSettings(guildId: string): Promise<RESTGetAPIGuildWidgetSettingsResult>;
|
|
591
|
+
/**
|
|
592
|
+
* Update a guild widget settings object
|
|
593
|
+
* @since 0.18.0
|
|
594
|
+
* @param guildId Id of the guild
|
|
595
|
+
* @param data widget settings
|
|
596
|
+
* @param reason Reason for updating the guild widget settings
|
|
597
|
+
* @returns Updated [Guild Widget settings](https://discord.com/developers/docs/resources/guild#guild-widget-settings-object-guild-widget-settings-structure)
|
|
598
|
+
*
|
|
599
|
+
* | Permissions needed | Condition |
|
|
600
|
+
* |--------------------|-----------|
|
|
601
|
+
* | MANAGE_GUILD | always |
|
|
602
|
+
*
|
|
603
|
+
* @example
|
|
604
|
+
* // Sets a widget as disabled
|
|
605
|
+
* const client = new SnowTransfer("TOKEN")
|
|
606
|
+
* const widgetSettings = await client.guild.editGuildWidgetSettings("guildId", { enabled: false })
|
|
607
|
+
*/
|
|
608
|
+
editGuildWidgetSettings(guildId: string, data: Partial<RESTPatchAPIGuildWidgetSettingsJSONBody>, reason?: string): Promise<RESTPatchAPIGuildWidgetSettingsResult>;
|
|
609
|
+
/**
|
|
610
|
+
* Gets a guild widget object
|
|
611
|
+
* @since 0.3.0
|
|
612
|
+
* @param guildId Id of the guild
|
|
613
|
+
* @returns [Guild Widget](https://discord.com/developers/docs/resources/guild#guild-widget-object)
|
|
614
|
+
*
|
|
615
|
+
* @example
|
|
616
|
+
* const client = new SnowTransfer("TOKEN")
|
|
617
|
+
* const widget = await client.guild.getGuildWidget("guildId")
|
|
618
|
+
*/
|
|
619
|
+
getGuildWidget(guildId: string): Promise<APIGuildWidget>;
|
|
620
|
+
/**
|
|
621
|
+
* Get a guild's vanity URL code
|
|
622
|
+
* @since 0.3.0
|
|
623
|
+
* @param guildId Id of the guild
|
|
624
|
+
* @returns partial [invite object](https://discord.com/developers/docs/resources/guild#get-guild-vanity-url-example-partial-invite-object)
|
|
625
|
+
*
|
|
626
|
+
* | Permissions needed | Condition |
|
|
627
|
+
* |--------------------|-----------|
|
|
628
|
+
* | MANAGE_GUILD | always |
|
|
629
|
+
*
|
|
630
|
+
* @example
|
|
631
|
+
* const client = new SnowTransfer("TOKEN")
|
|
632
|
+
* const vanityUrl = await client.guild.getGuildVanityUrl("guildId")
|
|
633
|
+
*/
|
|
634
|
+
getGuildVanityURL(guildId: string): Promise<RESTGetAPIGuildVanityUrlResult>;
|
|
635
|
+
/**
|
|
636
|
+
* Get a guild's welcome screen object
|
|
637
|
+
* @since 0.3.0
|
|
638
|
+
* @param guildId Id of the guild
|
|
639
|
+
* @returns [Guild Welcome Screen](https://discord.com/developers/docs/resources/guild#welcome-screen-object)
|
|
640
|
+
*
|
|
641
|
+
* | Permissions needed | Condition |
|
|
642
|
+
* |--------------------|--------------------------------------|
|
|
643
|
+
* | MANAGE_GUILD | if the welcome screen is not enabled |
|
|
644
|
+
*
|
|
645
|
+
* @example
|
|
646
|
+
* const client = new SnowTransfer("TOKEN")
|
|
647
|
+
* const welcomeScreen = await client.guild.getGuildWelcomeScreen("guildId")
|
|
648
|
+
*/
|
|
649
|
+
getGuildWelcomeScreen(guildId: string): Promise<RESTGetAPIGuildWelcomeScreenResult>;
|
|
650
|
+
/**
|
|
651
|
+
* Update a guild welcome screen object
|
|
652
|
+
* @since 0.18.0
|
|
653
|
+
* @param guildId Id of guild
|
|
654
|
+
* @param data Welcome screen data
|
|
655
|
+
* @param reason Reason for editing the welcome screen
|
|
656
|
+
* @returns [Guild Welcome Screen](https://discord.com/developers/docs/resources/guild#welcome-screen-object)
|
|
657
|
+
*
|
|
658
|
+
* | Permissions needed | Condition |
|
|
659
|
+
* |--------------------|-----------|
|
|
660
|
+
* | MANAGE_GUILD | always |
|
|
661
|
+
*
|
|
662
|
+
* @example
|
|
663
|
+
* // Disabled the welcome screen
|
|
664
|
+
* const client = new SnowTransfer("TOKEN")
|
|
665
|
+
* const welcomeScreen = await client.guild.editGuildWelcomeScreen("guildId", { enabled: false })
|
|
666
|
+
*/
|
|
667
|
+
editGuildWelcomeScreen(guildId: string, data: RESTPatchAPIGuildWelcomeScreenJSONBody, reason?: string): Promise<RESTPatchAPIGuildWelcomeScreenResult>;
|
|
668
|
+
/**
|
|
669
|
+
* Updates the current user's voice state in a stage channel
|
|
670
|
+
* @since 0.18.0
|
|
671
|
+
* @param guildId Id of the guild
|
|
672
|
+
* @param data Data of the voice state
|
|
673
|
+
* @returns Resolves the Promise on successful execution
|
|
674
|
+
*
|
|
675
|
+
* | Permissions needed | Condition |
|
|
676
|
+
* |--------------------|-------------------------------------|
|
|
677
|
+
* | MUTE_MEMBERS | when trying to un-suppress yourself |
|
|
678
|
+
* | REQUEST_TO_SPEAK | when trying to request to speak |
|
|
679
|
+
*
|
|
680
|
+
* @example
|
|
681
|
+
* // Unsuppresses the CurrentUser in the stage channel they're in
|
|
682
|
+
* const client = new SnowTransfer("TOKEN")
|
|
683
|
+
* client.guild.editCurrentUserVoiceState("guildId", { channel_id: "channel id", suppress: false })
|
|
684
|
+
*/
|
|
685
|
+
editCurrentUserVoiceState(guildId: string, data: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody): Promise<RESTPatchAPIGuildVoiceStateCurrentMemberResult>;
|
|
686
|
+
/**
|
|
687
|
+
* Updates a user's voice state in a stage channel
|
|
688
|
+
* @since 0.18.0
|
|
689
|
+
* @param guildId Id of the guild
|
|
690
|
+
* @param userId Id of the user
|
|
691
|
+
* @param data Data of the voice state
|
|
692
|
+
* @returns Resolves the Promise on successful execution
|
|
693
|
+
*
|
|
694
|
+
* | Permissions needed | Condition |
|
|
695
|
+
* |--------------------|-------------------------------------|
|
|
696
|
+
* | MUTE_MEMBERS | when trying to suppress/un-suppress |
|
|
697
|
+
*
|
|
698
|
+
* @example
|
|
699
|
+
* // Suppresses the user in the stage channel they're in
|
|
700
|
+
* const client = new SnowTransfer("TOKEN")
|
|
701
|
+
* client.guild.editUserVoiceState("guildId", "userId", { channel_id: "channel id", suppress: true })
|
|
702
|
+
*/
|
|
703
|
+
editUserVoiceState(guildId: string, userId: string, data: RESTPatchAPIGuildVoiceStateUserJSONBody): Promise<RESTPatchAPIGuildVoiceStateUserResult>;
|
|
704
|
+
/**
|
|
705
|
+
* Searches a guild for messages that match a query
|
|
706
|
+
* @since 0.17.6
|
|
707
|
+
* @param guildId Id of the guild
|
|
708
|
+
* @param options Options for the search
|
|
709
|
+
* @returns A [search result](https://docs.discord.com/developers/resources/message#search-guild-messages-response-body) containing the matched messages, or an index-not-ready response if the guild hasn't finished indexing yet
|
|
710
|
+
*
|
|
711
|
+
* | Permissions needed | Condition |
|
|
712
|
+
* |----------------------|-----------|
|
|
713
|
+
* | READ_MESSAGE_HISTORY | Always |
|
|
714
|
+
*
|
|
715
|
+
* @example
|
|
716
|
+
* // Finds messages that have the word "poggers" in their content
|
|
717
|
+
* const client = new SnowTransfer("TOKEN")
|
|
718
|
+
* const messages = await client.guild.searchGuildMessages("guildId", { content: "poggers" })
|
|
719
|
+
*/
|
|
720
|
+
searchGuildMessages(guildId: string, options?: RESTGetAPIGuildMessagesSearchQuery): Promise<RESTGetAPIGuildMessagesSearchResult>;
|
|
721
|
+
}
|
|
722
|
+
export = GuildMethods;
|