disgroove 2.1.0 → 2.1.1

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.
@@ -2,7 +2,7 @@
2
2
  import { GatewayIntents, type OAuth2Scopes, type StatusTypes, type ActionTypes, type ImageWidgetStyleOptions, type MFALevel } from "./constants";
3
3
  import { Util } from "./utils";
4
4
  import { RequestManager } from "./rest";
5
- import type { Activity, AuditLogEntry, AutoModerationActionExecutionEventFields, AutoModerationRule, Channel, ChannelPinsUpdateEventFields, GuildApplicationCommandPermissions, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, GuildScheduledEvent, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageDeleteBulkEventFields, MessageDeleteEventFields, MessageReactionAddEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, MessageReactionRemoveEventFields, PresenceUpdateEventFields, StageInstance, StickerPack, ThreadListSyncEventFields, ThreadMember, ThreadMembersUpdateEventFields, TypingStartEventFields, VoiceRegion, VoiceServerUpdateEventFields, Entitlement, UnavailableGuild, CreateGlobalApplicationCommandParams, ApplicationCommand, CreateGuildApplicationCommandParams, CreateTestEntitlementParams, EditCurrentApplicationParams, Application, EditGlobalApplicationCommandParams, EditGuildApplicationCommandParams, ApplicationRoleConnectionMetadata, Sku, BulkEditGlobalApplicationCommandsParams, BulkEditGuildApplicationCommandsParams, CreateGuildParams, CreateGuildFromGuildTemplateParams, CreateStageInstanceParams, EditAutoModerationRuleParams, CreateChannelInviteParams, Invite, CreateMessageParams, Message, CreateThreadFromMessageParams, CreateThreadParams, CreateThreadWithoutMessageParams, Webhook, EditChannelParams, EditMessageParams, FollowedChannel, User, Emoji, EditGuildEmojiParams, AddGuildMemberParams, BeginGuildPruneParams, GuildMember, CreateAutoModerationRuleParams, CreateGuildBanParams, CreateGuildChannelParams, CreateGuildEmojiParams, CreateGuildRoleParams, Role, CreateGuildScheduledEventParams, CreateGuildStickerParams, CreateGuildTemplateParams, GuildTemplate, Sticker, EditGuildParams, Guild, EditGuildChannelPositionsParams, EditGuildMemberParams, EditCurrentUserVoiceStateParams, EditCurrentGuildMemberParams, EditGuildMFALevelParams, EditGuildOnboardingParams, EditGuildRolePositionsParams, EditGuildScheduledEventParams, EditGuildStickerParams, EditGuildTemplateParams, EditGuildWelcomeScreenParams, WelcomeScreen, GuildWidgetSettings, AuditLog, Ban, Integration, GuildOnboarding, GuildPreview, GuildScheduledEventUser, GuildWidget, ExecuteWebhookParams, CreateInteractionFollowupMessageParams, InteractionResponse, EditWebhookMessageParams, EditStageInstanceParams, CreateDMParams, EditCurrentUserParams, ApplicationRoleConnection, Connection, UpdateCurrentUserApplicationRoleConnection, EditWebhookParams, Interaction, VoiceState, GuildCreateEventExtraFields, GuildMemberAddEventExtraFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, MessageCreateEventExtraFields, ThreadMemberUpdateEventExtraFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, BulkGuildBanParams, BulkDeleteMessagesParams } from "./types";
5
+ import type { Activity, AuditLogEntry, AutoModerationActionExecutionEventFields, AutoModerationRule, Channel, ChannelPinsUpdateEventFields, GuildApplicationCommandPermissions, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, GuildScheduledEvent, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageDeleteBulkEventFields, MessageDeleteEventFields, MessageReactionAddEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, MessageReactionRemoveEventFields, PresenceUpdateEventFields, StageInstance, StickerPack, ThreadListSyncEventFields, ThreadMember, ThreadMembersUpdateEventFields, TypingStartEventFields, VoiceRegion, VoiceServerUpdateEventFields, Entitlement, UnavailableGuild, CreateGlobalApplicationCommandParams, ApplicationCommand, CreateGuildApplicationCommandParams, CreateTestEntitlementParams, EditCurrentApplicationParams, Application, EditGlobalApplicationCommandParams, EditGuildApplicationCommandParams, ApplicationRoleConnectionMetadata, Sku, BulkEditGlobalApplicationCommandsParams, BulkEditGuildApplicationCommandsParams, CreateGuildParams, CreateGuildFromGuildTemplateParams, CreateStageInstanceParams, EditAutoModerationRuleParams, CreateChannelInviteParams, Invite, CreateMessageParams, Message, CreateThreadFromMessageParams, CreateThreadParams, CreateThreadWithoutMessageParams, Webhook, EditChannelParams, EditMessageParams, FollowedChannel, User, Emoji, EditGuildEmojiParams, AddGuildMemberParams, BeginGuildPruneParams, GuildMember, CreateAutoModerationRuleParams, CreateGuildBanParams, CreateGuildChannelParams, CreateGuildEmojiParams, CreateGuildRoleParams, Role, CreateGuildScheduledEventParams, CreateGuildStickerParams, CreateGuildTemplateParams, GuildTemplate, Sticker, EditGuildParams, Guild, EditGuildChannelPositionsParams, EditGuildMemberParams, EditCurrentUserVoiceStateParams, EditCurrentGuildMemberParams, EditGuildMFALevelParams, EditGuildOnboardingParams, EditGuildRolePositionsParams, EditGuildScheduledEventParams, EditGuildStickerParams, EditGuildTemplateParams, EditGuildWelcomeScreenParams, WelcomeScreen, GuildWidgetSettings, AuditLog, Ban, Integration, GuildOnboarding, GuildPreview, GuildScheduledEventUser, GuildWidget, ExecuteWebhookParams, CreateInteractionFollowupMessageParams, InteractionResponse, EditWebhookMessageParams, EditStageInstanceParams, CreateDMParams, EditCurrentUserParams, ApplicationRoleConnection, Connection, UpdateCurrentUserApplicationRoleConnection, EditWebhookParams, Interaction, VoiceState, GuildCreateEventExtraFields, GuildMemberAddEventExtraFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, MessageCreateEventExtraFields, ThreadMemberUpdateEventExtraFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, BulkGuildBanParams, BulkDeleteMessagesParams, GuildAuditLogEntryCreateExtraFields } from "./types";
6
6
  import EventEmitter from "node:events";
7
7
  import { ShardManager } from "./gateway";
8
8
  export interface ClientOptions {
@@ -268,7 +268,7 @@ export declare class Client extends EventEmitter {
268
268
  /** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
269
269
  followChannel(channelId: string, options: {
270
270
  webhookChannelId: string;
271
- }): Promise<FollowedChannel>;
271
+ }, reason?: string): Promise<FollowedChannel>;
272
272
  /** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
273
273
  getActiveGuildThreads(guildId: string): Promise<{
274
274
  threads: Array<Channel>;
@@ -613,7 +613,9 @@ export interface ClientEvents {
613
613
  ];
614
614
  guildUpdate: [guild: Guild];
615
615
  guildDelete: [guild: UnavailableGuild];
616
- guildAuditLogEntryCreate: [auditLogEntry: AuditLogEntry];
616
+ guildAuditLogEntryCreate: [
617
+ auditLogEntry: AuditLogEntry & GuildAuditLogEntryCreateExtraFields
618
+ ];
617
619
  guildBanAdd: [ban: GuildBanAddEventFields];
618
620
  guildBanRemove: [ban: GuildBanRemoveEventFields];
619
621
  guildEmojisUpdate: [emojis: Array<Emoji>, guildId: string];
@@ -829,6 +829,7 @@ class Client extends node_events_1.default {
829
829
  json: {
830
830
  username: options.username,
831
831
  avatar: options.avatar,
832
+ banner: options.banner,
832
833
  },
833
834
  })
834
835
  .then((response) => this.util.toCamelCase(response));
@@ -1311,12 +1312,13 @@ class Client extends node_events_1.default {
1311
1312
  .then((response) => response !== null ? this.util.toCamelCase(response) : null);
1312
1313
  }
1313
1314
  /** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
1314
- followChannel(channelId, options) {
1315
+ followChannel(channelId, options, reason) {
1315
1316
  return this.rest
1316
1317
  .request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(channelId), {
1317
1318
  json: {
1318
1319
  webhook_channel_id: options.webhookChannelId,
1319
1320
  },
1321
+ reason,
1320
1322
  })
1321
1323
  .then((response) => this.util.toCamelCase(response));
1322
1324
  }
@@ -896,6 +896,7 @@ export declare enum JSONErrorCodes {
896
896
  ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
897
897
  TagRequiredToCreateAForumPostInThisChannel = 40067,
898
898
  AnEntitlementHasAlreadyBeenGrantedForThisResource = 40074,
899
+ CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent = 40333,
899
900
  MissingAccess = 50001,
900
901
  InvalidAccountType = 50002,
901
902
  CannotExecuteActionOnDMChannel = 50003,
@@ -969,6 +969,7 @@ var JSONErrorCodes;
969
969
  JSONErrorCodes[JSONErrorCodes["ThereAreNoTagsAvailableThatCanBeSetByNonModerators"] = 40066] = "ThereAreNoTagsAvailableThatCanBeSetByNonModerators";
970
970
  JSONErrorCodes[JSONErrorCodes["TagRequiredToCreateAForumPostInThisChannel"] = 40067] = "TagRequiredToCreateAForumPostInThisChannel";
971
971
  JSONErrorCodes[JSONErrorCodes["AnEntitlementHasAlreadyBeenGrantedForThisResource"] = 40074] = "AnEntitlementHasAlreadyBeenGrantedForThisResource";
972
+ JSONErrorCodes[JSONErrorCodes["CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent"] = 40333] = "CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent";
972
973
  JSONErrorCodes[JSONErrorCodes["MissingAccess"] = 50001] = "MissingAccess";
973
974
  JSONErrorCodes[JSONErrorCodes["InvalidAccountType"] = 50002] = "InvalidAccountType";
974
975
  JSONErrorCodes[JSONErrorCodes["CannotExecuteActionOnDMChannel"] = 50003] = "CannotExecuteActionOnDMChannel";
@@ -1,5 +1,5 @@
1
1
  import type { AllowedMentionTypes, ApplicationIntegrationTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, InteractionType, InviteTargetTypes, MessageActivityTypes, MessageFlags, MessageTypes, SortOrderTypes, VideoQualityModes } from "../constants";
2
- import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData, RawPollCreateParams, PollCreateParams } from ".";
2
+ import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData, PollCreateParams, Poll, RawPoll } from ".";
3
3
  import type { File } from "../rest";
4
4
  /** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
5
5
  export interface RawChannel {
@@ -74,7 +74,8 @@ export interface RawMessage {
74
74
  position?: number;
75
75
  role_subscription_data?: RawRoleSubscriptionData;
76
76
  resolved?: RawResolvedData;
77
- poll?: RawPollCreateParams;
77
+ poll?: RawPoll;
78
+ call?: RawMessageCall;
78
79
  }
79
80
  /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
80
81
  export interface RawMessageActivity {
@@ -91,6 +92,11 @@ export interface RawMessageInteractionMetadata {
91
92
  interacted_message_id?: string;
92
93
  triggering_interaction_metadata?: RawMessageInteractionMetadata;
93
94
  }
95
+ /** https://discord.com/developers/docs/resources/channel#message-call-object-message-call-structure */
96
+ export interface RawMessageCall {
97
+ partecipants: Array<string>;
98
+ ended_timestamp?: string | null;
99
+ }
94
100
  /** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */
95
101
  export interface RawMessageReference {
96
102
  message_id?: string;
@@ -323,7 +329,8 @@ export interface Message {
323
329
  position?: number;
324
330
  roleSubscriptionData?: RoleSubscriptionData;
325
331
  resolved?: ResolvedData;
326
- poll?: PollCreateParams;
332
+ poll?: Poll;
333
+ call?: MessageCall;
327
334
  }
328
335
  export interface MessageActivity {
329
336
  type: MessageActivityTypes;
@@ -336,6 +343,11 @@ export interface MessageInteractionMetadata {
336
343
  authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
337
344
  originalResponseMessageId?: string;
338
345
  interactedMessageId?: string;
346
+ triggeringInteractionMetadata?: MessageInteractionMetadata;
347
+ }
348
+ export interface MessageCall {
349
+ partecipants: Array<string>;
350
+ endedTimestamp?: string | null;
339
351
  }
340
352
  export interface MessageReference {
341
353
  messageId?: string;
@@ -53,6 +53,10 @@ export interface RawGuildCreateEventExtraFields {
53
53
  stage_instances?: Array<RawStageInstance>;
54
54
  guild_scheduled_events?: Array<RawGuildScheduledEvent>;
55
55
  }
56
+ /** https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create-guild-audit-log-entry-create-extra-fields */
57
+ export interface RawGuildAuditLogEntryCreateExtraFields {
58
+ guild_id: string;
59
+ }
56
60
  /** https://discord.com/developers/docs/topics/gateway-events#guild-ban-add-guild-ban-add-event-fields */
57
61
  export interface RawGuildBanAddEventFields {
58
62
  guild_id: string;
@@ -320,6 +324,9 @@ export interface GuildCreateEventExtraFields {
320
324
  stageInstances?: Array<StageInstance>;
321
325
  guildScheduledEvents?: Array<GuildScheduledEvent>;
322
326
  }
327
+ export interface GuildAuditLogEntryCreateExtraFields {
328
+ guildId: string;
329
+ }
323
330
  export interface GuildBanAddEventFields {
324
331
  guildId: string;
325
332
  user: User;
@@ -78,6 +78,7 @@ export interface ApplicationRoleConnection {
78
78
  export interface EditCurrentUserParams {
79
79
  username?: string;
80
80
  avatar?: string | null;
81
+ banner?: string | null;
81
82
  }
82
83
  export interface CreateDMParams {
83
84
  recipientId: string;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",