disgroove 2.1.0-dev.bb8ed97 → 2.1.0-dev.cce0fd7

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.
@@ -247,6 +247,7 @@ export declare class Client extends EventEmitter {
247
247
  }): Promise<Message>;
248
248
  /** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
249
249
  editWebhookWithToken(webhookId: string, webhookToken: string, options: Omit<EditWebhookParams, "channelId">, reason?: string): Promise<Webhook>;
250
+ endPoll(channelId: string, messageId: string): Promise<Message>;
250
251
  /** https://discord.com/developers/docs/resources/webhook#execute-webhook */
251
252
  executeWebhook(webhookId: string, webhookToken: string, options: ExecuteWebhookParams & {
252
253
  wait: boolean;
@@ -261,7 +262,6 @@ export declare class Client extends EventEmitter {
261
262
  threadId?: string;
262
263
  wait?: boolean;
263
264
  }): Promise<Message | null>;
264
- expirePoll(channelId: string, messageId: string): Promise<Message>;
265
265
  /** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
266
266
  followChannel(channelId: string, options: {
267
267
  webhookChannelId: string;
@@ -436,6 +436,9 @@ class Client extends node_events_1.default {
436
436
  ? this.util.toSnakeCase(options.data.components)
437
437
  : undefined,
438
438
  attachments: options.data?.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
439
+ poll: options.data?.poll !== undefined
440
+ ? this.util.toSnakeCase(options.data?.poll)
441
+ : undefined,
439
442
  },
440
443
  },
441
444
  files: options.data?.files,
@@ -517,6 +520,9 @@ class Client extends node_events_1.default {
517
520
  attachments: options.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
518
521
  flags: options.flags,
519
522
  enforce_nonce: options.enforceNonce,
523
+ poll: options.poll !== undefined
524
+ ? this.util.toSnakeCase(options.poll)
525
+ : undefined,
520
526
  },
521
527
  files: options.files,
522
528
  })
@@ -1238,6 +1244,11 @@ class Client extends node_events_1.default {
1238
1244
  })
1239
1245
  .then((response) => this.util.toCamelCase(response));
1240
1246
  }
1247
+ endPoll(channelId, messageId) {
1248
+ return this.rest
1249
+ .request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId))
1250
+ .then((response) => this.util.toCamelCase(response));
1251
+ }
1241
1252
  /** https://discord.com/developers/docs/resources/webhook#execute-webhook */
1242
1253
  executeWebhook(webhookId, webhookToken, options) {
1243
1254
  return this.rest
@@ -1265,6 +1276,10 @@ class Client extends node_events_1.default {
1265
1276
  attachments: options.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
1266
1277
  flags: options.flags,
1267
1278
  thread_name: options.threadName,
1279
+ applied_tags: options.appliedTags,
1280
+ poll: options.poll !== undefined
1281
+ ? this.util.toSnakeCase(options.poll)
1282
+ : undefined,
1268
1283
  },
1269
1284
  files: options.files,
1270
1285
  query: {
@@ -1290,11 +1305,6 @@ class Client extends node_events_1.default {
1290
1305
  })
1291
1306
  .then((response) => response !== null ? this.util.toCamelCase(response) : null);
1292
1307
  }
1293
- expirePoll(channelId, messageId) {
1294
- return this.rest
1295
- .request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId))
1296
- .then((response) => this.util.toCamelCase(response));
1297
- }
1298
1308
  /** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
1299
1309
  followChannel(channelId, options) {
1300
1310
  return this.rest
@@ -76,6 +76,12 @@ export declare enum InteractionType {
76
76
  ApplicationCommandAutocomplete = 4,
77
77
  ModalSubmit = 5
78
78
  }
79
+ /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types */
80
+ export declare enum InterationContextTypes {
81
+ Guild = 0,
82
+ BotDM = 1,
83
+ PrivateChannel = 2
84
+ }
79
85
  /** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */
80
86
  export declare enum ComponentTypes {
81
87
  ActionRow = 1,
@@ -566,9 +572,11 @@ export declare enum GatewayIntents {
566
572
  GuildScheduledEvents = 65536,
567
573
  AutoModerationConfiguration = 1048576,
568
574
  AutoModerationActionExecution = 2097152,
569
- AllNonPrivileged = 3243773,
575
+ GuildMessagePolls = 16777216,
576
+ DirectMessagePolls = 33554432,
577
+ AllNonPrivileged = 53575421,
570
578
  AllPrivileged = 33026,
571
- All = 3276799
579
+ All = 53608447
572
580
  }
573
581
  /** https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types */
574
582
  export declare enum StatusTypes {
@@ -1068,6 +1076,7 @@ export declare const BitwisePermissionFlags: {
1068
1076
  readonly CreateEvents: bigint;
1069
1077
  readonly UseExternalSounds: bigint;
1070
1078
  readonly SendVoiceMessages: bigint;
1079
+ readonly SendPolls: bigint;
1071
1080
  };
1072
1081
  /** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
1073
1082
  export declare enum RoleFlags {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.InviteTargetTypes = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = void 0;
4
- exports.EntitlementTypes = exports.SkuFlags = exports.SkuTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = void 0;
3
+ exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.InviteTargetTypes = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.InterationContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = void 0;
4
+ exports.EntitlementTypes = exports.SkuFlags = exports.SkuTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = void 0;
5
5
  /** https://discord.com/developers/docs/reference#image-formatting-image-formats */
6
6
  var ImageFormats;
7
7
  (function (ImageFormats) {
@@ -86,6 +86,13 @@ var InteractionType;
86
86
  InteractionType[InteractionType["ApplicationCommandAutocomplete"] = 4] = "ApplicationCommandAutocomplete";
87
87
  InteractionType[InteractionType["ModalSubmit"] = 5] = "ModalSubmit";
88
88
  })(InteractionType || (exports.InteractionType = InteractionType = {}));
89
+ /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types */
90
+ var InterationContextTypes;
91
+ (function (InterationContextTypes) {
92
+ InterationContextTypes[InterationContextTypes["Guild"] = 0] = "Guild";
93
+ InterationContextTypes[InterationContextTypes["BotDM"] = 1] = "BotDM";
94
+ InterationContextTypes[InterationContextTypes["PrivateChannel"] = 2] = "PrivateChannel";
95
+ })(InterationContextTypes || (exports.InterationContextTypes = InterationContextTypes = {}));
89
96
  /** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */
90
97
  var ComponentTypes;
91
98
  (function (ComponentTypes) {
@@ -627,9 +634,11 @@ var GatewayIntents;
627
634
  GatewayIntents[GatewayIntents["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
628
635
  GatewayIntents[GatewayIntents["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration";
629
636
  GatewayIntents[GatewayIntents["AutoModerationActionExecution"] = 2097152] = "AutoModerationActionExecution";
630
- GatewayIntents[GatewayIntents["AllNonPrivileged"] = 3243773] = "AllNonPrivileged";
637
+ GatewayIntents[GatewayIntents["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
638
+ GatewayIntents[GatewayIntents["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
639
+ GatewayIntents[GatewayIntents["AllNonPrivileged"] = 53575421] = "AllNonPrivileged";
631
640
  GatewayIntents[GatewayIntents["AllPrivileged"] = 33026] = "AllPrivileged";
632
- GatewayIntents[GatewayIntents["All"] = 3276799] = "All";
641
+ GatewayIntents[GatewayIntents["All"] = 53608447] = "All";
633
642
  })(GatewayIntents || (exports.GatewayIntents = GatewayIntents = {}));
634
643
  /** https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types */
635
644
  var StatusTypes;
@@ -1142,6 +1151,7 @@ exports.BitwisePermissionFlags = {
1142
1151
  CreateEvents: 1n << 44n,
1143
1152
  UseExternalSounds: 1n << 45n,
1144
1153
  SendVoiceMessages: 1n << 46n,
1154
+ SendPolls: 1n << 49n,
1145
1155
  };
1146
1156
  /** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
1147
1157
  var RoleFlags;
@@ -1,5 +1,5 @@
1
1
  import type { LocaleMap } from ".";
2
- import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType } from "../constants";
2
+ import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InterationContextTypes } from "../constants";
3
3
  /** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
4
4
  export interface RawApplicationCommand {
5
5
  id: string;
@@ -14,6 +14,8 @@ export interface RawApplicationCommand {
14
14
  default_member_permissions: string | null;
15
15
  dm_permission?: boolean;
16
16
  default_permission?: boolean | null;
17
+ integration_types?: Array<ApplicationIntegrationTypes>;
18
+ contexts?: Array<InterationContextTypes>;
17
19
  nsfw?: boolean;
18
20
  version: string;
19
21
  }
@@ -66,6 +68,8 @@ export interface ApplicationCommand {
66
68
  defaultMemberPermissions: string | null;
67
69
  dmPermission?: boolean;
68
70
  defaultPermission?: boolean | null;
71
+ integrationTypes?: Array<ApplicationIntegrationTypes>;
72
+ contexts?: Array<InterationContextTypes>;
69
73
  nsfw?: boolean;
70
74
  version: string;
71
75
  }
@@ -1,7 +1,6 @@
1
1
  import type { AllowedMentionTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, 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 } from ".";
2
+ import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData, RawPollCreateParams, PollCreateParams } from ".";
3
3
  import type { File } from "../rest";
4
- import type { Poll, RawPoll } from "./poll";
5
4
  /** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
6
5
  export interface RawChannel {
7
6
  id: string;
@@ -74,7 +73,7 @@ export interface RawMessage {
74
73
  position?: number;
75
74
  role_subscription_data?: RawRoleSubscriptionData;
76
75
  resolved?: RawResolvedData;
77
- poll?: RawPoll;
76
+ poll?: RawPollCreateParams;
78
77
  }
79
78
  /** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
80
79
  export interface RawMessageActivity {
@@ -312,7 +311,7 @@ export interface Message {
312
311
  position?: number;
313
312
  roleSubscriptionData?: RoleSubscriptionData;
314
313
  resolved?: ResolvedData;
315
- poll?: Poll;
314
+ poll?: PollCreateParams;
316
315
  }
317
316
  export interface MessageActivity {
318
317
  type: MessageActivityTypes;
@@ -498,7 +497,7 @@ export interface CreateMessageParams {
498
497
  attachments?: Array<Attachment>;
499
498
  flags?: MessageFlags;
500
499
  enforceNonce?: boolean;
501
- poll?: Poll;
500
+ poll?: PollCreateParams;
502
501
  }
503
502
  export interface EditMessageParams {
504
503
  content?: string | null;
@@ -14,6 +14,7 @@ export * from "./guild";
14
14
  export * from "./interaction";
15
15
  export * from "./invite";
16
16
  export * from "./message-components";
17
+ export * from "./poll";
17
18
  export * from "./role";
18
19
  export * from "./sku";
19
20
  export * from "./stage-instance";
@@ -29,6 +29,7 @@ __exportStar(require("./guild"), exports);
29
29
  __exportStar(require("./interaction"), exports);
30
30
  __exportStar(require("./invite"), exports);
31
31
  __exportStar(require("./message-components"), exports);
32
+ __exportStar(require("./poll"), exports);
32
33
  __exportStar(require("./role"), exports);
33
34
  __exportStar(require("./sku"), exports);
34
35
  __exportStar(require("./stage-instance"), exports);
@@ -1,7 +1,6 @@
1
- import type { RawAttachment, RawChannel, RawGuildMember, RawMessage, RawUser, RawRole, Attachment, User, GuildMember, Message, Role, Channel, Entitlement, RawEntitlement, RawEmbed, RawAllowedMentions, RawActionRow, RawApplicationCommandOptionChoice, Embed, AllowedMentions, ActionRow, ApplicationCommandOptionChoice, RawTextInput, TextInput, ExecuteWebhookParams } from ".";
1
+ import type { RawAttachment, RawChannel, RawGuildMember, RawMessage, RawUser, RawRole, Attachment, User, GuildMember, Message, Role, Channel, Entitlement, RawEntitlement, RawEmbed, RawAllowedMentions, RawActionRow, RawApplicationCommandOptionChoice, Embed, AllowedMentions, ActionRow, ApplicationCommandOptionChoice, RawTextInput, TextInput, ExecuteWebhookParams, RawPollCreateParams, PollCreateParams } from ".";
2
2
  import type { ApplicationCommandOptionType, ApplicationCommandTypes, ComponentTypes, InteractionCallbackType, InteractionType, MessageFlags } from "../constants";
3
3
  import type { File } from "../rest";
4
- import type { Poll, RawPoll } from "./poll";
5
4
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */
6
5
  export interface RawInteraction {
7
6
  id: string;
@@ -85,7 +84,7 @@ export interface RawInteractionCallbackData {
85
84
  flags?: MessageFlags;
86
85
  components?: Array<RawActionRow>;
87
86
  attachments?: Array<RawAttachment>;
88
- poll?: RawPoll;
87
+ poll?: RawPollCreateParams;
89
88
  files?: Array<File>;
90
89
  choices?: Array<RawApplicationCommandOptionChoice>;
91
90
  custom_id?: string;
@@ -165,7 +164,7 @@ export interface InteractionCallbackData {
165
164
  flags?: MessageFlags;
166
165
  components?: Array<ActionRow>;
167
166
  attachments?: Array<Attachment>;
168
- poll?: Poll;
167
+ poll?: PollCreateParams;
169
168
  files?: Array<File>;
170
169
  choices?: Array<ApplicationCommandOptionChoice>;
171
170
  customId?: string;
@@ -25,6 +25,13 @@ export interface RawPollAnswerCount {
25
25
  count: number;
26
26
  me_voted: boolean;
27
27
  }
28
+ export interface RawPollCreateParams {
29
+ question: RawPollMedia;
30
+ answers: Array<RawPollAnswer>;
31
+ duration: number;
32
+ allow_multiselect: boolean;
33
+ layout_type?: LayoutType;
34
+ }
28
35
  export interface Poll {
29
36
  question: PollMedia;
30
37
  answers: Array<PollAnswer>;
@@ -50,3 +57,10 @@ export interface PollAnswerCount {
50
57
  count: number;
51
58
  meVoted: boolean;
52
59
  }
60
+ export interface PollCreateParams {
61
+ question: PollMedia;
62
+ answers: Array<PollAnswer>;
63
+ duration: number;
64
+ allowMultiselect: boolean;
65
+ layoutType?: LayoutType;
66
+ }
@@ -1,7 +1,6 @@
1
1
  import type { MessageFlags, WebhookTypes } from "../constants";
2
- import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser } from ".";
2
+ import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser, PollCreateParams } from ".";
3
3
  import type { File } from "../rest";
4
- import type { Poll } from "./poll";
5
4
  /** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
6
5
  export interface RawWebhook {
7
6
  id: string;
@@ -53,7 +52,7 @@ export interface ExecuteWebhookParams {
53
52
  flags?: MessageFlags | null;
54
53
  threadName?: string;
55
54
  appliedTags?: Array<string>;
56
- poll?: Poll;
55
+ poll?: PollCreateParams;
57
56
  }
58
57
  export interface EditWebhookMessageParams {
59
58
  content?: string | null;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.1.0-dev.bb8ed97",
3
+ "version": "2.1.0-dev.cce0fd7",
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-dev.bb8ed97",
3
+ "version": "2.1.0-dev.cce0fd7",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",