@discordjs/core 0.6.1-dev.1684023067-7196fe3.0 → 0.6.1-dev.1684411513-46167a7.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.
@@ -1,6 +1,6 @@
1
1
  import { REST, RequestData, RawFile } from '@discordjs/rest';
2
2
  import * as discord_api_types_v10 from 'discord-api-types/v10';
3
- import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTGetAPIChannelWebhooksResult, RESTPostAPIGuildsJSONBody, RESTPatchAPIGuildJSONBody, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildChannelsResult, RESTPostAPIGuildChannelJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTGetAPIGuildBansResult, RESTPutAPIGuildBanJSONBody, RESTGetAPIGuildRolesResult, RESTPostAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleJSONBody, GuildMFALevel, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTPostAPIGuildPruneJSONBody, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildIntegrationsResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTGetAPIGuildVanityUrlResult, GuildWidgetStyle, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTGetAPIGuildEmojisResult, RESTPostAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTPostAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventQuery, RESTPatchAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildTemplatesResult, RESTPatchAPIGuildTemplateJSONBody, RESTGetAPIGuildStickersResult, RESTPostAPIGuildStickerFormDataBody, RESTPatchAPIGuildStickerJSONBody, RESTGetAPIAuditLogQuery, RESTGetAPIAutoModerationRulesResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleJSONBody, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPatchAPIGuildMemberJSONBody, RESTPostAPITemplateCreateGuildJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTGetNitroStickerPacksResult, RESTPostAPIGuildForumThreadsJSONBody, APIThreadChannel, RESTPostAPIChannelThreadsJSONBody, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTGetAPIVoiceRegionsResult } from 'discord-api-types/v10';
3
+ import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTGetAPIChannelWebhooksResult, RESTPostAPIGuildsJSONBody, RESTPatchAPIGuildJSONBody, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildChannelsResult, RESTPostAPIGuildChannelJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTPutAPIGuildBanJSONBody, RESTGetAPIGuildRolesResult, RESTPostAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleJSONBody, GuildMFALevel, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTPostAPIGuildPruneJSONBody, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildIntegrationsResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTGetAPIGuildVanityUrlResult, GuildWidgetStyle, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTGetAPIGuildEmojisResult, RESTPostAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTPostAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventQuery, RESTPatchAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildTemplatesResult, RESTPatchAPIGuildTemplateJSONBody, RESTGetAPIGuildStickersResult, RESTPostAPIGuildStickerFormDataBody, RESTPatchAPIGuildStickerJSONBody, RESTGetAPIAuditLogQuery, RESTGetAPIAutoModerationRulesResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleJSONBody, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPatchAPIGuildMemberJSONBody, RESTPostAPITemplateCreateGuildJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTGetNitroStickerPacksResult, RESTPostAPIGuildForumThreadsJSONBody, APIThreadChannel, RESTPostAPIChannelThreadsJSONBody, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTGetAPIVoiceRegionsResult } from 'discord-api-types/v10';
4
4
 
5
5
  declare class ApplicationCommandsAPI {
6
6
  private readonly rest;
@@ -490,11 +490,21 @@ declare class GuildsAPI {
490
490
  /**
491
491
  * Fetches a guild member ban
492
492
  *
493
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
493
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
494
494
  * @param guildId - The id of the guild to fetch the ban from
495
- * @param options - The options for fetching the guild member ban
495
+ * @param userId - The id of the user to fetch the ban
496
+ * @param options - The options for fetching the ban
497
+ */
498
+ getMemberBan(guildId: Snowflake, userId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIBan>;
499
+ /**
500
+ * Fetches guild member bans
501
+ *
502
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
503
+ * @param guildId - The id of the guild to fetch the bans from
504
+ * @param query - The query options for fetching the bans
505
+ * @param options - The options for fetching the bans
496
506
  */
497
- getMemberBans(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildBansResult>;
507
+ getMemberBans(guildId: Snowflake, query?: RESTGetAPIGuildBansQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildBansResult>;
498
508
  /**
499
509
  * Bans a user from a guild
500
510
  *
@@ -955,6 +965,15 @@ declare class GuildsAPI {
955
965
  * @param options - The options for editing the guild member
956
966
  */
957
967
  editMember(guildId: Snowflake, userId: Snowflake, body?: RESTPatchAPIGuildMemberJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIGuildMember>;
968
+ /**
969
+ * Removes a member from a guild
970
+ *
971
+ * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
972
+ * @param guildId - The id of the guild
973
+ * @param userId - The id of the user
974
+ * @param options - The options for removing the guild member
975
+ */
976
+ removeMember(guildId: Snowflake, userId: Snowflake, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<unknown>;
958
977
  /**
959
978
  * Adds a role to a guild member
960
979
  *
@@ -1,4 +1,4 @@
1
- export { A as API, a as ApplicationCommandsAPI, C as ChannelsAPI, D as DescriptiveRawFile, G as GuildsAPI, I as InteractionsAPI, b as InvitesAPI, O as OAuth2API, R as RoleConnectionsAPI, c as StartForumThreadOptions, S as StickersAPI, T as ThreadsAPI, U as UsersAPI, V as VoiceAPI, W as WebhooksAPI, w as withFiles } from './files-7932138f.js';
1
+ export { A as API, a as ApplicationCommandsAPI, C as ChannelsAPI, D as DescriptiveRawFile, G as GuildsAPI, I as InteractionsAPI, b as InvitesAPI, O as OAuth2API, R as RoleConnectionsAPI, c as StartForumThreadOptions, S as StickersAPI, T as ThreadsAPI, U as UsersAPI, V as VoiceAPI, W as WebhooksAPI, w as withFiles } from './files-2a988976.js';
2
2
  export * from 'discord-api-types/v10';
3
3
  import '@discordjs/rest';
4
4
 
package/dist/http-only.js CHANGED
@@ -727,12 +727,27 @@ var GuildsAPI = class {
727
727
  /**
728
728
  * Fetches a guild member ban
729
729
  *
730
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
730
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
731
731
  * @param guildId - The id of the guild to fetch the ban from
732
- * @param options - The options for fetching the guild member ban
732
+ * @param userId - The id of the user to fetch the ban
733
+ * @param options - The options for fetching the ban
733
734
  */
734
- async getMemberBans(guildId, { signal } = {}) {
735
- return this.rest.get(import_v103.Routes.guildBans(guildId), { signal });
735
+ async getMemberBan(guildId, userId, { signal } = {}) {
736
+ return this.rest.get(import_v103.Routes.guildBan(guildId, userId), { signal });
737
+ }
738
+ /**
739
+ * Fetches guild member bans
740
+ *
741
+ * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
742
+ * @param guildId - The id of the guild to fetch the bans from
743
+ * @param query - The query options for fetching the bans
744
+ * @param options - The options for fetching the bans
745
+ */
746
+ async getMemberBans(guildId, query = {}, { signal } = {}) {
747
+ return this.rest.get(import_v103.Routes.guildBans(guildId), {
748
+ query: (0, import_rest3.makeURLSearchParams)(query),
749
+ signal
750
+ });
736
751
  }
737
752
  /**
738
753
  * Bans a user from a guild
@@ -1387,6 +1402,17 @@ var GuildsAPI = class {
1387
1402
  signal
1388
1403
  });
1389
1404
  }
1405
+ /**
1406
+ * Removes a member from a guild
1407
+ *
1408
+ * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
1409
+ * @param guildId - The id of the guild
1410
+ * @param userId - The id of the user
1411
+ * @param options - The options for removing the guild member
1412
+ */
1413
+ async removeMember(guildId, userId, { reason, signal } = {}) {
1414
+ return this.rest.delete(import_v103.Routes.guildMember(guildId, userId), { reason, signal });
1415
+ }
1390
1416
  /**
1391
1417
  * Adds a role to a guild member
1392
1418
  *
@@ -2331,7 +2357,7 @@ __name(withFiles, "withFiles");
2331
2357
 
2332
2358
  // src/http-only/index.ts
2333
2359
  __reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
2334
- var version = "0.6.1-dev.1684023067-7196fe3.0";
2360
+ var version = "0.6.1-dev.1684411513-46167a7.0";
2335
2361
  // Annotate the CommonJS export names for ESM import in node:
2336
2362
  0 && (module.exports = {
2337
2363
  API,