disgroove 2.2.6-dev.3f22d60 → 2.2.6-dev.b9cd00b

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.
@@ -29,7 +29,7 @@ import type { User, ApplicationRoleConnection, Connection } from "./types/user";
29
29
  import type { VoiceRegion, VoiceState } from "./types/voice";
30
30
  import type { Webhook } from "./types/webhook";
31
31
  import type { ClientOptions as WebSocketOptions } from "ws";
32
- import type { Embed, AllowedMentions, Attachment, Message, MessageReference, MessageTopLevelComponent } from "./types/message";
32
+ import type { Embed, AllowedMentions, Attachment, Message, MessageReference, MessageTopLevelComponent, MessagePin } from "./types/message";
33
33
  import type { Subscription } from "./types/subscription";
34
34
  import type { SoundboardSound } from "./types/soundboard";
35
35
  export interface GatewayOptions {
@@ -996,7 +996,13 @@ export declare class Client extends EventEmitter {
996
996
  user?: User;
997
997
  }>;
998
998
  /** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
999
- getPinnedMessages(channelID: snowflake): Promise<Array<Message>>;
999
+ getPinnedMessages(channelID: snowflake, options: {
1000
+ before?: timestamp;
1001
+ limit?: number;
1002
+ }): Promise<{
1003
+ items: Array<MessagePin>;
1004
+ hasMore: boolean;
1005
+ }>;
1000
1006
  /** https://discord.com/developers/docs/resources/poll#get-answer-voters */
1001
1007
  getPollAnswerVoters(channelID: snowflake, messageID: snowflake, answerID: snowflake, options?: {
1002
1008
  after?: snowflake;
@@ -2205,9 +2205,17 @@ class Client extends node_events_1.default {
2205
2205
  };
2206
2206
  }
2207
2207
  /** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
2208
- async getPinnedMessages(channelID) {
2209
- const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelID));
2210
- return response.map((message) => transformers_1.Messages.messageFromRaw(message));
2208
+ async getPinnedMessages(channelID, options) {
2209
+ const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelID), {
2210
+ query: options,
2211
+ });
2212
+ return {
2213
+ items: response.items.map((item) => ({
2214
+ pinnetAt: item.pinnet_at,
2215
+ message: transformers_1.Messages.messageFromRaw(item.message),
2216
+ })),
2217
+ hasMore: response.has_more,
2218
+ };
2211
2219
  }
2212
2220
  /** https://discord.com/developers/docs/resources/poll#get-answer-voters */
2213
2221
  async getPollAnswerVoters(channelID, messageID, answerID, options) {
@@ -55,8 +55,8 @@ export declare const channelMessageCrosspost: (channelID: snowflake, messageID:
55
55
  export declare const channelMessageReaction: (channelID: snowflake, messageID: snowflake, emoji: string, userID?: snowflake | "@me") => `channels/${string}/messages/${string}/reactions/${string}/${string}`;
56
56
  export declare const channelMessages: (channelID: snowflake) => `channels/${string}/messages`;
57
57
  export declare const channelPermission: (channelID: snowflake, overwriteID: snowflake) => `channels/${string}/permissions/${string}`;
58
- export declare const channelPin: (channelID: snowflake, messageID: snowflake) => `channels/${string}/pins/${string}`;
59
- export declare const channelPins: (channelID: snowflake) => `channels/${string}/pins`;
58
+ export declare const channelPin: (channelID: snowflake, messageID: snowflake) => `channels/${string}/messages/pins/${string}`;
59
+ export declare const channelPins: (channelID: snowflake) => `channels/${string}/messages/pins`;
60
60
  export declare const channelRecipient: (channelID: snowflake, userID: snowflake) => `channels/${string}/recipients/${string}`;
61
61
  export declare const channelThreads: (channelID: snowflake, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/private` | `channels/${string}/threads/archived/public`;
62
62
  export declare const channelTyping: (channelID: snowflake) => `channels/${string}/typing`;
@@ -119,9 +119,9 @@ const channelMessages = (channelID) => `channels/${channelID}/messages`;
119
119
  exports.channelMessages = channelMessages;
120
120
  const channelPermission = (channelID, overwriteID) => `channels/${channelID}/permissions/${overwriteID}`;
121
121
  exports.channelPermission = channelPermission;
122
- const channelPin = (channelID, messageID) => `channels/${channelID}/pins/${messageID}`;
122
+ const channelPin = (channelID, messageID) => `channels/${channelID}/messages/pins/${messageID}`;
123
123
  exports.channelPin = channelPin;
124
- const channelPins = (channelID) => `channels/${channelID}/pins`;
124
+ const channelPins = (channelID) => `channels/${channelID}/messages/pins`;
125
125
  exports.channelPins = channelPins;
126
126
  const channelRecipient = (channelID, userID) => `channels/${channelID}/recipients/${userID}`;
127
127
  exports.channelRecipient = channelRecipient;
@@ -197,6 +197,11 @@ export interface RawAllowedMentions {
197
197
  users?: Array<snowflake>;
198
198
  replied_user?: boolean;
199
199
  }
200
+ /** https://discord.com/developers/docs/resources/message#message-pin-object-message-pin-structure */
201
+ export interface RawMessagePin {
202
+ pinnet_at: timestamp;
203
+ message: RawMessage;
204
+ }
200
205
  export interface Message {
201
206
  id: snowflake;
202
207
  channelID: snowflake;
@@ -366,3 +371,7 @@ export interface AllowedMentions {
366
371
  users?: Array<snowflake>;
367
372
  repliedUser?: boolean;
368
373
  }
374
+ export interface MessagePin {
375
+ pinnetAt: timestamp;
376
+ message: Message;
377
+ }
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.2.6-dev.3f22d60",
3
+ "version": "2.2.6-dev.b9cd00b",
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.2.6-dev.3f22d60",
3
+ "version": "2.2.6-dev.b9cd00b",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",