@discordeno/rest 19.0.0-next.f5f97e0 → 19.0.0-next.f6bd769

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/dist/manager.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Queue } from './queue.js';
2
- import type { ApplicationCommandPermissions, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuildChannel, CreateGuildEmoji, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAutoModerationRule, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordScheduledEvent, DiscordStageInstance, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
2
+ import type { ApplicationCommandPermissions, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildChannel, CreateGuildEmoji, CreateGuildRole, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAutoModerationRule, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordGuild, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason, AtLeastOne, CreateGuildStickerOptions, DiscordAuditLog, DiscordBan, DiscordSticker, DiscordVanityUrl, DiscordVoiceRegion, EditGuildStickerOptions, GetBans, GetGuildAuditLog, ModifyGuild } from '@discordeno/types';
3
3
  import type { InvalidRequestBucket } from './invalidBucket.js';
4
4
  export declare function createRestManager(options: CreateRestManagerOptions): RestManager;
5
5
  export interface CreateRestManagerOptions {
@@ -132,6 +132,10 @@ export interface RestManager {
132
132
  };
133
133
  /** Routes for guild related endpoints. */
134
134
  guilds: {
135
+ /** Routes for handling a non-specific guild. */
136
+ all: () => string;
137
+ /** Route for handling audit logs in a guild. */
138
+ auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => string;
135
139
  /** Routes for a guilds automoderation. */
136
140
  automod: {
137
141
  /** Route for handling a guild's automoderation. */
@@ -154,6 +158,8 @@ export interface RestManager {
154
158
  emoji: (guildId: BigString, id: BigString) => string;
155
159
  /** Route for handling non-specific emojis. */
156
160
  emojis: (guildId: BigString) => string;
161
+ /** Route for handling a specific guild. */
162
+ guild: (guildId: BigString, withCounts?: boolean) => string;
157
163
  /** Route for handling a specific integration. */
158
164
  integration: (guildId: BigString, integrationId: BigString) => string;
159
165
  /** Route for handling non-specific integrations. */
@@ -168,6 +174,8 @@ export interface RestManager {
168
174
  members: {
169
175
  /** Route for handling a specific guild member's ban. */
170
176
  ban: (guildId: BigString, userId: BigString) => string;
177
+ /** Route for handling non-specific bans in a guild. */
178
+ bans: (guildId: BigString, options?: GetBans) => string;
171
179
  /** Route for handling a the bot guild member. */
172
180
  bot: (guildId: BigString) => string;
173
181
  /** Route for handling a specific guild member. */
@@ -190,6 +198,23 @@ export interface RestManager {
190
198
  /** Route for handling non-specific guild's templates. */
191
199
  all: (guildId: BigString) => string;
192
200
  };
201
+ /** Route for handling a guild's vanity url. */
202
+ vanity: (guildId: BigString) => string;
203
+ /** Route for handling a guild's regions. */
204
+ regions: (guildId: BigString) => string;
205
+ /** Routes for handling a guild's roles. */
206
+ roles: {
207
+ /** Route for handling a specific guild role. */
208
+ one: (guildId: BigString, roleId: BigString) => string;
209
+ /** Route for handling a guild's roles. */
210
+ all: (guildId: BigString) => string;
211
+ /** Route for handling a members roles in a guild. */
212
+ member: (guildId: BigString, memberId: BigString, roleId: BigString) => string;
213
+ };
214
+ /** Route for handling a specific guild sticker. */
215
+ stickers: (guildId: BigString) => string;
216
+ /** Route for handling non-specific guild stickers. */
217
+ sticker: (guildId: BigString, stickerId: BigString) => string;
193
218
  };
194
219
  /** Routes for interaction related endpoints. */
195
220
  interactions: {
@@ -221,9 +246,13 @@ export interface RestManager {
221
246
  message: (applicationId: BigString, token: string, messageId: BigString) => string;
222
247
  };
223
248
  };
249
+ /** Route for handling a sticker. */
250
+ sticker: (stickerId: BigString) => string;
224
251
  };
225
252
  /** Check the rate limits for a url or a bucket. */
226
253
  checkRateLimits: (url: string) => number | false;
254
+ /** Reshapes and modifies the obj as needed to make it ready for discords api. */
255
+ changeToDiscordFormat: (obj: any) => any;
227
256
  /** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
228
257
  createRequest: (options: CreateRequestBodyOptions) => RequestBody;
229
258
  /** This will create a infinite loop running in 1 seconds using tail recursion to keep rate limits clean. When a rate limit resets, this will remove it so the queue can proceed. */
@@ -824,6 +853,19 @@ export interface RestManager {
824
853
  };
825
854
  /** Guild related helper methods */
826
855
  guilds: {
856
+ /**
857
+ * Gets a guild's audit log.
858
+ *
859
+ * @param guildId - The ID of the guild to get the audit log of.
860
+ * @param options - The parameters for the fetching of the audit log.
861
+ * @returns An instance of {@link AuditLog}.
862
+ *
863
+ * @remarks
864
+ * Requires the `VIEW_AUDIT_LOG` permission.
865
+ *
866
+ * @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
867
+ */
868
+ auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
827
869
  automod: {
828
870
  /**
829
871
  * Creates an automod rule in a guild.
@@ -899,6 +941,48 @@ export interface RestManager {
899
941
  rules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
900
942
  };
901
943
  };
944
+ /**
945
+ * Gets a ban by user ID.
946
+ *
947
+ * @param guildId - The ID of the guild to get the ban from.
948
+ * @param userId - The ID of the user to get the ban for.
949
+ * @returns An instance of {@link DiscordBan}.
950
+ *
951
+ * @remarks
952
+ * Requires the `BAN_MEMBERS` permission.
953
+ *
954
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
955
+ */
956
+ ban: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
957
+ /**
958
+ * Gets the list of bans for a guild.
959
+ *
960
+ * @param guildId - The ID of the guild to get the list of bans for.
961
+ * @param options - The parameters for the fetching of the list of bans.
962
+ * @returns A collection of {@link DiscordBan} objects assorted by user ID.
963
+ *
964
+ * @remarks
965
+ * Requires the `BAN_MEMBERS` permission.
966
+ *
967
+ * Users are ordered by their IDs in _ascending_ order.
968
+ *
969
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
970
+ */
971
+ bans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
972
+ /**
973
+ * Creates a guild.
974
+ *
975
+ * @param options - The parameters for the creation of the guild.
976
+ * @returns An instance of the created {@link DiscordGuild}.
977
+ *
978
+ * @remarks
979
+ * ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
980
+ *
981
+ * Fires a _Guild Create_ gateway event.
982
+ *
983
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
984
+ */
985
+ create: (options: CreateGuild) => Promise<Camelize<DiscordGuild>>;
902
986
  /**
903
987
  * Gets the list of channels for a guild.
904
988
  *
@@ -911,6 +995,38 @@ export interface RestManager {
911
995
  * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
912
996
  */
913
997
  channels: (guildId: BigString) => Promise<Camelize<DiscordChannel[]>>;
998
+ /**
999
+ * Deletes a guild.
1000
+ *
1001
+ * @param guildId - The ID of the guild to delete.
1002
+ *
1003
+ * @remarks
1004
+ * The bot user must be the owner of the guild.
1005
+ *
1006
+ * Fires a _Guild Delete_ gateway event.
1007
+ *
1008
+ * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
1009
+ */
1010
+ delete: (guildId: BigString) => Promise<void>;
1011
+ /**
1012
+ * Edits a guild's settings.
1013
+ *
1014
+ * @param guildId - The ID of the guild to edit.
1015
+ * @param shardId - The ID of the shard the guild is in.
1016
+ * @param options - The parameters for the edit of the guild.
1017
+ * @returns An instance of the edited {@link Guild}.
1018
+ *
1019
+ * @remarks
1020
+ * Requires the `MANAGE_GUILD` permission.
1021
+ *
1022
+ * If attempting to add or remove the {@link GuildFeatures.Community} feature:
1023
+ * - Requires the `ADMINISTRATOR` permission.
1024
+ *
1025
+ * Fires a _Guild Update_ gateway event.
1026
+ *
1027
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
1028
+ */
1029
+ edit: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
914
1030
  /**
915
1031
  * Gets the list of emojis for a guild.
916
1032
  *
@@ -1017,6 +1133,18 @@ export interface RestManager {
1017
1133
  }>>;
1018
1134
  };
1019
1135
  };
1136
+ /**
1137
+ * Gets a guild by its ID.
1138
+ *
1139
+ * @param guildId - The ID of the guild to get.
1140
+ * @param options - The parameters for the fetching of the guild.
1141
+ * @returns An instance of {@link Guild}.
1142
+ *
1143
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
1144
+ */
1145
+ get: (guildId: BigString, options?: {
1146
+ counts?: boolean;
1147
+ }) => Promise<Camelize<DiscordGuild>>;
1020
1148
  /** Methods related to a guild's integrations. */
1021
1149
  integrations: {
1022
1150
  /**
@@ -1105,6 +1233,75 @@ export interface RestManager {
1105
1233
  */
1106
1234
  list: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
1107
1235
  };
1236
+ /** Methods related to stickers in a guild. */
1237
+ stickers: {
1238
+ /**
1239
+ * Create a new sticker for the guild.
1240
+ *
1241
+ * @param guildId The ID of the guild to get
1242
+ * @return A {@link DiscordSticker}
1243
+ *
1244
+ * @remarks
1245
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1246
+ * Fires a Guild Stickers Update Gateway event.
1247
+ * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
1248
+ * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
1249
+ *
1250
+ * @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
1251
+ */
1252
+ create: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
1253
+ /**
1254
+ * Delete a new sticker for the guild.
1255
+ *
1256
+ * @param guildId The ID of the guild to get
1257
+ * @return A {@link DiscordSticker}
1258
+ *
1259
+ * @remarks
1260
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1261
+ * Fires a Guild Stickers Update Gateway event.
1262
+ * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
1263
+ * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
1264
+ *
1265
+ * @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
1266
+ */
1267
+ delete: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
1268
+ /**
1269
+ * Edit the given sticker.
1270
+ *
1271
+ * @param guildId The ID of the guild to get
1272
+ * @return A {@link DiscordSticker}
1273
+ *
1274
+ * @remarks
1275
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1276
+ * Fires a Guild Stickers Update Gateway event.
1277
+ *
1278
+ * @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
1279
+ */
1280
+ edit: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
1281
+ /**
1282
+ * Returns a sticker object for the given guild and sticker IDs.
1283
+ *
1284
+ * @param guildId The ID of the guild to get
1285
+ * @param stickerId The ID of the sticker to get
1286
+ * @return A {@link DiscordSticker}
1287
+ *
1288
+ * @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1289
+ *
1290
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
1291
+ */
1292
+ sticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
1293
+ /**
1294
+ * Returns an array of sticker objects for the given guild.
1295
+ *
1296
+ * @param guildId The ID of the guild to get
1297
+ * @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
1298
+ *
1299
+ * @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1300
+ *
1301
+ * @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
1302
+ */
1303
+ stickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
1304
+ };
1108
1305
  /** Methods related to a guild's templates. */
1109
1306
  templates: {
1110
1307
  /**
@@ -1678,7 +1875,144 @@ export interface RestManager {
1678
1875
  };
1679
1876
  };
1680
1877
  };
1878
+ /** Role related helpers methods. */
1879
+ roles: {
1880
+ /**
1881
+ * Adds a role to a member.
1882
+ *
1883
+ * @param guildId - The ID of the guild the member to add the role to is in.
1884
+ * @param userId - The user ID of the member to add the role to.
1885
+ * @param roleId - The ID of the role to add to the member.
1886
+ *
1887
+ * @remarks
1888
+ * Requires the `MANAGE_ROLES` permission.
1889
+ *
1890
+ * Fires a _Guild Member Update_ gateway event.
1891
+ *
1892
+ * @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
1893
+ */
1894
+ add: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
1895
+ /**
1896
+ * Creates a role in a guild.
1897
+ *
1898
+ * @param guildId - The ID of the guild to create the role in.
1899
+ * @param options - The parameters for the creation of the role.
1900
+ * @returns An instance of the created {@link DiscordRole}.
1901
+ *
1902
+ * @remarks
1903
+ * Requires the `MANAGE_ROLES` permission.
1904
+ *
1905
+ * Fires a _Guild Role Create_ gateway event.
1906
+ *
1907
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
1908
+ */
1909
+ create: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
1910
+ /**
1911
+ * Deletes a role from a guild.
1912
+ *
1913
+ * @param guildId - The ID of the guild to delete the role from.
1914
+ * @param roleId - The ID of the role to delete.
1915
+ *
1916
+ * @remarks
1917
+ * Requires the `MANAGE_ROLES` permission.
1918
+ *
1919
+ * Fires a _Guild Role Delete_ gateway event.
1920
+ *
1921
+ * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
1922
+ */
1923
+ delete: (guildId: BigString, roleId: BigString) => Promise<void>;
1924
+ /**
1925
+ * Edits a role in a guild.
1926
+ *
1927
+ * @param guildId - The ID of the guild to edit the role in.
1928
+ * @param roleId - The ID of the role to edit.
1929
+ * @param options - The parameters for the edit of the role.
1930
+ * @returns An instance of the edited {@link DiscordRole}.
1931
+ *
1932
+ * @remarks
1933
+ * Requires the `MANAGE_ROLES` permission.
1934
+ *
1935
+ * Fires a _Guild Role Update_ gateway event.
1936
+ *
1937
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
1938
+ */
1939
+ edit: (guildId: BigString, roleId: BigString, options: EditGuildRole) => Promise<Camelize<DiscordRole>>;
1940
+ /**
1941
+ * Edits the positions of a set of roles.
1942
+ *
1943
+ * @param guildId - The ID of the guild to edit the role positions in.
1944
+ * @param options - The parameters for the edit of the role positions.
1945
+ * @returns A collection of {@link DiscordRole} objects assorted by role ID.
1946
+ *
1947
+ * @remarks
1948
+ * Requires the `MANAGE_ROLES` permission.
1949
+ *
1950
+ * Fires a _Guild Role Update_ gateway event for every role impacted in this change.
1951
+ *
1952
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
1953
+ */
1954
+ positions: (guildId: BigString, options: ModifyRolePositions[]) => Promise<Camelize<DiscordRole[]>>;
1955
+ /**
1956
+ * Gets the list of roles for a guild.
1957
+ *
1958
+ * @param guildId - The ID of the guild to get the list of roles for.
1959
+ * @returns A collection of {@link DisorcRole} objects assorted by role ID.
1960
+ *
1961
+ * @remarks
1962
+ * ⚠️ This endpoint should be used sparingly due to {@link User} objects already being included in guild payloads.
1963
+ *
1964
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
1965
+ */
1966
+ list: (guildId: BigString) => Promise<Camelize<DiscordRole[]>>;
1967
+ /**
1968
+ * Removes a role from a member.
1969
+ *
1970
+ * @param guildId - The ID of the guild the member to remove the role from is in.
1971
+ * @param userId - The user ID of the member to remove the role from.
1972
+ * @param roleId - The ID of the role to remove from the member.
1973
+ *
1974
+ * @remarks
1975
+ * Requires the `MANAGE_ROLES` permission.
1976
+ *
1977
+ * Fires a _Guild Member Update_ gateway event.
1978
+ *
1979
+ * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
1980
+ */
1981
+ remove: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
1982
+ };
1983
+ /**
1984
+ * Gets information about the vanity url of a guild.
1985
+ *
1986
+ * @param guildId - The ID of the guild to get the vanity url information for.
1987
+ * @returns An instance of {@link VanityUrl}.
1988
+ *
1989
+ * @remarks
1990
+ * Requires the `MANAGE_GUILD` permission.
1991
+ *
1992
+ * The `code` property will be `null` if the guild does not have a set vanity url.
1993
+ *
1994
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
1995
+ */
1996
+ vanity: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
1997
+ /**
1998
+ * Gets the list of voice regions for a guild.
1999
+ *
2000
+ * @param guildId - The ID of the guild to get the voice regions for.
2001
+ * @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
2002
+ *
2003
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
2004
+ */
2005
+ regions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
1681
2006
  };
2007
+ /**
2008
+ * Returns a sticker object for the given sticker ID.
2009
+ *
2010
+ * @param stickerId The ID of the sticker to get
2011
+ * @returns A {@link DiscordSticker}
2012
+ *
2013
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
2014
+ */
2015
+ sticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
1682
2016
  /** Webhook related helper methods. */
1683
2017
  webhooks: {
1684
2018
  /**
@@ -1871,6 +2205,21 @@ export interface RestManager {
1871
2205
  */
1872
2206
  channel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
1873
2207
  };
2208
+ /**
2209
+ * Adds a role to a member.
2210
+ *
2211
+ * @param guildId - The ID of the guild the member to add the role to is in.
2212
+ * @param userId - The user ID of the member to add the role to.
2213
+ * @param roleId - The ID of the role to add to the member.
2214
+ *
2215
+ * @remarks
2216
+ * Requires the `MANAGE_ROLES` permission.
2217
+ *
2218
+ * Fires a _Guild Member Update_ gateway event.
2219
+ *
2220
+ * @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
2221
+ */
2222
+ addRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
1874
2223
  /**
1875
2224
  * Adds a member to a thread.
1876
2225
  *
@@ -1969,6 +2318,20 @@ export interface RestManager {
1969
2318
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
1970
2319
  */
1971
2320
  createGlobalApplicationCommand: (command: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
2321
+ /**
2322
+ * Creates a guild.
2323
+ *
2324
+ * @param options - The parameters for the creation of the guild.
2325
+ * @returns An instance of the created {@link DiscordGuild}.
2326
+ *
2327
+ * @remarks
2328
+ * ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
2329
+ *
2330
+ * Fires a _Guild Create_ gateway event.
2331
+ *
2332
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
2333
+ */
2334
+ createGuild: (options: CreateGuild) => Promise<Camelize<DiscordGuild>>;
1972
2335
  /**
1973
2336
  * Creates an application command only accessible in a specific guild.
1974
2337
  *
@@ -1983,6 +2346,21 @@ export interface RestManager {
1983
2346
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
1984
2347
  */
1985
2348
  createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
2349
+ /**
2350
+ * Create a new sticker for the guild.
2351
+ *
2352
+ * @param guildId The ID of the guild to get
2353
+ * @return A {@link DiscordSticker}
2354
+ *
2355
+ * @remarks
2356
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
2357
+ * Fires a Guild Stickers Update Gateway event.
2358
+ * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
2359
+ * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
2360
+ *
2361
+ * @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
2362
+ */
2363
+ createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
1986
2364
  /**
1987
2365
  * Creates a template from a guild.
1988
2366
  *
@@ -2016,6 +2394,21 @@ export interface RestManager {
2016
2394
  * @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
2017
2395
  */
2018
2396
  createInvite: (channelId: BigString, options?: CreateChannelInvite) => Promise<Camelize<DiscordInvite>>;
2397
+ /**
2398
+ * Creates a role in a guild.
2399
+ *
2400
+ * @param guildId - The ID of the guild to create the role in.
2401
+ * @param options - The parameters for the creation of the role.
2402
+ * @returns An instance of the created {@link DiscordRole}.
2403
+ *
2404
+ * @remarks
2405
+ * Requires the `MANAGE_ROLES` permission.
2406
+ *
2407
+ * Fires a _Guild Role Create_ gateway event.
2408
+ *
2409
+ * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
2410
+ */
2411
+ createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
2019
2412
  /**
2020
2413
  * Creates a scheduled event in a guild.
2021
2414
  *
@@ -2153,6 +2546,19 @@ export interface RestManager {
2153
2546
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
2154
2547
  */
2155
2548
  deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>;
2549
+ /**
2550
+ * Deletes a guild.
2551
+ *
2552
+ * @param guildId - The ID of the guild to delete.
2553
+ *
2554
+ * @remarks
2555
+ * The bot user must be the owner of the guild.
2556
+ *
2557
+ * Fires a _Guild Delete_ gateway event.
2558
+ *
2559
+ * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
2560
+ */
2561
+ deleteGuild: (guildId: BigString) => Promise<void>;
2156
2562
  /**
2157
2563
  * Deletes an application command registered in a guild.
2158
2564
  *
@@ -2162,6 +2568,21 @@ export interface RestManager {
2162
2568
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
2163
2569
  */
2164
2570
  deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
2571
+ /**
2572
+ * Delete a new sticker for the guild.
2573
+ *
2574
+ * @param guildId The ID of the guild to get
2575
+ * @return A {@link DiscordSticker}
2576
+ *
2577
+ * @remarks
2578
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
2579
+ * Fires a Guild Stickers Update Gateway event.
2580
+ * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
2581
+ * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
2582
+ *
2583
+ * @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
2584
+ */
2585
+ deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
2165
2586
  /**
2166
2587
  * Deletes a template from a guild.
2167
2588
  *
@@ -2234,6 +2655,20 @@ export interface RestManager {
2234
2655
  * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
2235
2656
  */
2236
2657
  deleteOriginalInteractionResponse: (token: string) => Promise<void>;
2658
+ /**
2659
+ * Deletes a role from a guild.
2660
+ *
2661
+ * @param guildId - The ID of the guild to delete the role from.
2662
+ * @param roleId - The ID of the role to delete.
2663
+ *
2664
+ * @remarks
2665
+ * Requires the `MANAGE_ROLES` permission.
2666
+ *
2667
+ * Fires a _Guild Role Delete_ gateway event.
2668
+ *
2669
+ * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
2670
+ */
2671
+ deleteRole: (guildId: BigString, roleId: BigString) => Promise<void>;
2237
2672
  /**
2238
2673
  * Deletes a scheduled event from a guild.
2239
2674
  *
@@ -2443,6 +2878,25 @@ export interface RestManager {
2443
2878
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
2444
2879
  */
2445
2880
  editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
2881
+ /**
2882
+ * Edits a guild's settings.
2883
+ *
2884
+ * @param guildId - The ID of the guild to edit.
2885
+ * @param shardId - The ID of the shard the guild is in.
2886
+ * @param options - The parameters for the edit of the guild.
2887
+ * @returns An instance of the edited {@link Guild}.
2888
+ *
2889
+ * @remarks
2890
+ * Requires the `MANAGE_GUILD` permission.
2891
+ *
2892
+ * If attempting to add or remove the {@link GuildFeatures.Community} feature:
2893
+ * - Requires the `ADMINISTRATOR` permission.
2894
+ *
2895
+ * Fires a _Guild Update_ gateway event.
2896
+ *
2897
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
2898
+ */
2899
+ editGuild: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
2446
2900
  /**
2447
2901
  * Edits an application command registered in a guild.
2448
2902
  *
@@ -2454,6 +2908,19 @@ export interface RestManager {
2454
2908
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
2455
2909
  */
2456
2910
  editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
2911
+ /**
2912
+ * Edit the given sticker.
2913
+ *
2914
+ * @param guildId The ID of the guild to get
2915
+ * @return A {@link DiscordSticker}
2916
+ *
2917
+ * @remarks
2918
+ * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
2919
+ * Fires a Guild Stickers Update Gateway event.
2920
+ *
2921
+ * @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
2922
+ */
2923
+ editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
2457
2924
  /**
2458
2925
  * Edits a template's settings.
2459
2926
  *
@@ -2521,6 +2988,37 @@ export interface RestManager {
2521
2988
  editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
2522
2989
  threadId?: BigString;
2523
2990
  }) => Promise<Camelize<DiscordMessage>>;
2991
+ /**
2992
+ * Edits a role in a guild.
2993
+ *
2994
+ * @param guildId - The ID of the guild to edit the role in.
2995
+ * @param roleId - The ID of the role to edit.
2996
+ * @param options - The parameters for the edit of the role.
2997
+ * @returns An instance of the edited {@link DiscordRole}.
2998
+ *
2999
+ * @remarks
3000
+ * Requires the `MANAGE_ROLES` permission.
3001
+ *
3002
+ * Fires a _Guild Role Update_ gateway event.
3003
+ *
3004
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
3005
+ */
3006
+ editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole) => Promise<Camelize<DiscordRole>>;
3007
+ /**
3008
+ * Edits the positions of a set of roles.
3009
+ *
3010
+ * @param guildId - The ID of the guild to edit the role positions in.
3011
+ * @param options - The parameters for the edit of the role positions.
3012
+ * @returns A collection of {@link DiscordRole} objects assorted by role ID.
3013
+ *
3014
+ * @remarks
3015
+ * Requires the `MANAGE_ROLES` permission.
3016
+ *
3017
+ * Fires a _Guild Role Update_ gateway event for every role impacted in this change.
3018
+ *
3019
+ * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
3020
+ */
3021
+ editRolePositions: (guildId: BigString, options: ModifyRolePositions[]) => Promise<Camelize<DiscordRole[]>>;
2524
3022
  /**
2525
3023
  * Edits a scheduled event.
2526
3024
  *
@@ -2664,6 +3162,19 @@ export interface RestManager {
2664
3162
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
2665
3163
  */
2666
3164
  getApplicationCommandPermissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
3165
+ /**
3166
+ * Gets a guild's audit log.
3167
+ *
3168
+ * @param guildId - The ID of the guild to get the audit log of.
3169
+ * @param options - The parameters for the fetching of the audit log.
3170
+ * @returns An instance of {@link AuditLog}.
3171
+ *
3172
+ * @remarks
3173
+ * Requires the `VIEW_AUDIT_LOG` permission.
3174
+ *
3175
+ * @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
3176
+ */
3177
+ getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
2667
3178
  /**
2668
3179
  * Gets an automod rule by its ID.
2669
3180
  *
@@ -2689,6 +3200,34 @@ export interface RestManager {
2689
3200
  * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
2690
3201
  */
2691
3202
  getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
3203
+ /**
3204
+ * Gets a ban by user ID.
3205
+ *
3206
+ * @param guildId - The ID of the guild to get the ban from.
3207
+ * @param userId - The ID of the user to get the ban for.
3208
+ * @returns An instance of {@link DiscordBan}.
3209
+ *
3210
+ * @remarks
3211
+ * Requires the `BAN_MEMBERS` permission.
3212
+ *
3213
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
3214
+ */
3215
+ getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
3216
+ /**
3217
+ * Gets the list of bans for a guild.
3218
+ *
3219
+ * @param guildId - The ID of the guild to get the list of bans for.
3220
+ * @param options - The parameters for the fetching of the list of bans.
3221
+ * @returns A collection of {@link DiscordBan} objects assorted by user ID.
3222
+ *
3223
+ * @remarks
3224
+ * Requires the `BAN_MEMBERS` permission.
3225
+ *
3226
+ * Users are ordered by their IDs in _ascending_ order.
3227
+ *
3228
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
3229
+ */
3230
+ getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
2692
3231
  /**
2693
3232
  * Gets a channel by its ID.
2694
3233
  *
@@ -2803,6 +3342,18 @@ export interface RestManager {
2803
3342
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
2804
3343
  */
2805
3344
  getGlobalApplicationCommands: () => Promise<Camelize<DiscordApplicationCommand[]>>;
3345
+ /**
3346
+ * Gets a guild by its ID.
3347
+ *
3348
+ * @param guildId - The ID of the guild to get.
3349
+ * @param options - The parameters for the fetching of the guild.
3350
+ * @returns An instance of {@link Guild}.
3351
+ *
3352
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
3353
+ */
3354
+ getGuild: (guildId: BigString, options?: {
3355
+ counts?: boolean;
3356
+ }) => Promise<Camelize<DiscordGuild>>;
2806
3357
  /**
2807
3358
  * Gets a guild application command by its ID.
2808
3359
  *
@@ -2822,6 +3373,29 @@ export interface RestManager {
2822
3373
  * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
2823
3374
  */
2824
3375
  getGuildApplicationCommands: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
3376
+ /**
3377
+ * Returns a sticker object for the given guild and sticker IDs.
3378
+ *
3379
+ * @param guildId The ID of the guild to get
3380
+ * @param stickerId The ID of the sticker to get
3381
+ * @return A {@link DiscordSticker}
3382
+ *
3383
+ * @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
3384
+ *
3385
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
3386
+ */
3387
+ getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
3388
+ /**
3389
+ * Returns an array of sticker objects for the given guild.
3390
+ *
3391
+ * @param guildId The ID of the guild to get
3392
+ * @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
3393
+ *
3394
+ * @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
3395
+ *
3396
+ * @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
3397
+ */
3398
+ getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
2825
3399
  /**
2826
3400
  * Gets a template by its code.
2827
3401
  *
@@ -2970,6 +3544,18 @@ export interface RestManager {
2970
3544
  * @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
2971
3545
  */
2972
3546
  getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
3547
+ /**
3548
+ * Gets the list of roles for a guild.
3549
+ *
3550
+ * @param guildId - The ID of the guild to get the list of roles for.
3551
+ * @returns A collection of {@link DisorcRole} objects assorted by role ID.
3552
+ *
3553
+ * @remarks
3554
+ * ⚠️ This endpoint should be used sparingly due to {@link User} objects already being included in guild payloads.
3555
+ *
3556
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
3557
+ */
3558
+ getRoles: (guildId: BigString) => Promise<Camelize<DiscordRole[]>>;
2973
3559
  /**
2974
3560
  * Gets a scheduled event by its ID.
2975
3561
  *
@@ -3023,6 +3609,15 @@ export interface RestManager {
3023
3609
  * @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
3024
3610
  */
3025
3611
  getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
3612
+ /**
3613
+ * Returns a sticker object for the given sticker ID.
3614
+ *
3615
+ * @param stickerId The ID of the sticker to get
3616
+ * @returns A {@link DiscordSticker}
3617
+ *
3618
+ * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
3619
+ */
3620
+ getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
3026
3621
  /**
3027
3622
  * Gets a thread member by their user ID.
3028
3623
  *
@@ -3052,6 +3647,29 @@ export interface RestManager {
3052
3647
  * @returns {Camelize<DiscordUser>}
3053
3648
  */
3054
3649
  getUser: (id: BigString) => Promise<Camelize<DiscordUser>>;
3650
+ /**
3651
+ * Gets information about the vanity url of a guild.
3652
+ *
3653
+ * @param guildId - The ID of the guild to get the vanity url information for.
3654
+ * @returns An instance of {@link VanityUrl}.
3655
+ *
3656
+ * @remarks
3657
+ * Requires the `MANAGE_GUILD` permission.
3658
+ *
3659
+ * The `code` property will be `null` if the guild does not have a set vanity url.
3660
+ *
3661
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
3662
+ */
3663
+ getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
3664
+ /**
3665
+ * Gets the list of voice regions for a guild.
3666
+ *
3667
+ * @param guildId - The ID of the guild to get the voice regions for.
3668
+ * @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
3669
+ *
3670
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
3671
+ */
3672
+ getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
3055
3673
  /**
3056
3674
  * Gets a webhook by its ID.
3057
3675
  *
@@ -3130,6 +3748,21 @@ export interface RestManager {
3130
3748
  * @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
3131
3749
  */
3132
3750
  publishMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
3751
+ /**
3752
+ * Removes a role from a member.
3753
+ *
3754
+ * @param guildId - The ID of the guild the member to remove the role from is in.
3755
+ * @param userId - The user ID of the member to remove the role from.
3756
+ * @param roleId - The ID of the role to remove from the member.
3757
+ *
3758
+ * @remarks
3759
+ * Requires the `MANAGE_ROLES` permission.
3760
+ *
3761
+ * Fires a _Guild Member Update_ gateway event.
3762
+ *
3763
+ * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
3764
+ */
3765
+ removeRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
3133
3766
  /**
3134
3767
  * Removes a member from a thread.
3135
3768
  *