lunibee 0.2.1 → 0.2.3

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.
Files changed (49) hide show
  1. package/README.md +6 -6
  2. package/dist/builders/attachment.d.ts +5 -1
  3. package/dist/builders/commands.d.ts +136 -47
  4. package/dist/builders/components.d.ts +164 -45
  5. package/dist/builders/embed.d.ts +5 -1
  6. package/dist/builders/index.d.ts +9 -4
  7. package/dist/builders/index.js +206 -105
  8. package/dist/builders/index.js.map +8 -8
  9. package/dist/core/events.d.ts +28 -12
  10. package/dist/core/index.d.ts +2 -1
  11. package/dist/core/index.js +377 -150
  12. package/dist/core/index.js.map +25 -25
  13. package/dist/core/permissions.d.ts +6 -2
  14. package/dist/index.d.ts +5 -4
  15. package/dist/index.js +662 -268
  16. package/dist/index.js.map +33 -32
  17. package/dist/managers/base.d.ts +4 -0
  18. package/dist/managers/emoji.d.ts +7 -1
  19. package/dist/managers/guild-resources.d.ts +11 -3
  20. package/dist/managers/guild.d.ts +13 -5
  21. package/dist/managers/index.d.ts +31 -14
  22. package/dist/managers/index.js +167 -80
  23. package/dist/managers/index.js.map +18 -18
  24. package/dist/managers/member.d.ts +5 -3
  25. package/dist/managers/message.d.ts +7 -3
  26. package/dist/managers/role.d.ts +13 -1
  27. package/dist/rest/error-codes.d.ts +48 -0
  28. package/dist/rest/errors.d.ts +1 -0
  29. package/dist/rest/index.d.ts +1 -0
  30. package/dist/rest/index.js +53 -3
  31. package/dist/rest/index.js.map +7 -6
  32. package/dist/rest/routes.d.ts +4 -2
  33. package/dist/sharding/index.js +7 -6
  34. package/dist/sharding/index.js.map +6 -6
  35. package/dist/structures/base.d.ts +18 -9
  36. package/dist/structures/index.d.ts +15 -9
  37. package/dist/structures/index.js +198 -68
  38. package/dist/structures/index.js.map +12 -12
  39. package/dist/structures/interactions.d.ts +85 -11
  40. package/dist/structures/resources.d.ts +11 -1
  41. package/dist/types/gateway.d.ts +14 -0
  42. package/dist/types/index.d.ts +204 -16
  43. package/dist/types/index.js +37 -10
  44. package/dist/types/index.js.map +4 -4
  45. package/dist/voice/index.js +4 -3
  46. package/dist/voice/index.js.map +3 -3
  47. package/dist/ws/index.js +2 -1
  48. package/dist/ws/index.js.map +5 -5
  49. package/package.json +15 -15
@@ -14,16 +14,16 @@ export interface ResourceContext {
14
14
  editMessage(channelId: string, messageId: string, options: Record<string, unknown> & {
15
15
  content?: string;
16
16
  }): Promise<import("./index.js").Message>;
17
- deleteMessage(channelId: string, messageId: string): Promise<void>;
17
+ deleteMessage(channelId: string, messageId: string, reason?: string): Promise<void>;
18
18
  crosspostMessage(channelId: string, messageId: string): Promise<import("./index.js").Message>;
19
19
  editChannel?(channelId: string, options: Record<string, unknown>): Promise<import("./base.js").Channel>;
20
- deleteChannel?(channelId: string): Promise<void>;
20
+ deleteChannel?(channelId: string, reason?: string): Promise<void>;
21
21
  addReaction?(channelId: string, messageId: string, emoji: string): Promise<void>;
22
22
  removeOwnReaction?(channelId: string, messageId: string, emoji: string): Promise<void>;
23
23
  removeReaction?(channelId: string, messageId: string, emoji: string, userId: string): Promise<void>;
24
24
  removeAllReactions?(channelId: string, messageId: string): Promise<void>;
25
- pinMessage?(channelId: string, messageId: string): Promise<void>;
26
- unpinMessage?(channelId: string, messageId: string): Promise<void>;
25
+ pinMessage?(channelId: string, messageId: string, reason?: string): Promise<void>;
26
+ unpinMessage?(channelId: string, messageId: string, reason?: string): Promise<void>;
27
27
  /**
28
28
  * A member's permissions from cached state: guild-level, or channel-level
29
29
  * (with overwrites) when a channel ID is given. Null when the guild (or
@@ -97,11 +97,11 @@ export declare class Channel extends BaseStructure {
97
97
  /** Creates a channel structure from Discord channel data. */
98
98
  constructor(data: import("@lunibee/types").APIChannel, context?: ResourceContext);
99
99
  /** Sends a message to this channel. @param options Message payload. @returns The created message. @throws {Error} If the channel is not attached to a client. */
100
- sendMessage(options: Record<string, unknown> & {
100
+ send(options: Record<string, unknown> & {
101
101
  content?: string;
102
102
  }): Promise<import("./index.js").Message>;
103
- /** Sends a message using Lunibee's concise channel API. @param options Message payload. @returns The created message. @throws {Error} If the channel is not attached to a client. */
104
- send(options: Record<string, unknown> & {
103
+ /** @deprecated Use {@link Channel.send}. Removed in 0.3.0. */
104
+ sendMessage(options: Record<string, unknown> & {
105
105
  content?: string;
106
106
  }): Promise<import("./index.js").Message>;
107
107
  /** Edits this channel. @param options Channel fields to change. @returns The updated channel. @throws {Error} If the channel is not attached to a client. */
@@ -123,8 +123,8 @@ export declare class Channel extends BaseStructure {
123
123
  reason?: string;
124
124
  }): Promise<void>;
125
125
  editParent(parentId: string | null): Promise<Channel>;
126
- /** Deletes this channel. @returns A promise fulfilled when Discord confirms deletion. @throws {Error} If the channel is not attached to a client. */
127
- delete(): Promise<void>;
126
+ /** Deletes this channel. @param reason Audit-log reason. @returns A promise fulfilled when Discord confirms deletion. @throws {Error} If the channel is not attached to a client. */
127
+ delete(reason?: string): Promise<void>;
128
128
  /** Updates this channel using the same resource operation as edit. @param options Channel fields to change. @returns The updated channel. @throws {Error} If the channel is not attached to a client. */
129
129
  update(options: Record<string, unknown>): Promise<Channel>;
130
130
  /** Whether this is a thread (announcement, public or private). */
@@ -170,6 +170,15 @@ export declare class Guild extends BaseStructure {
170
170
  explicitContentFilter: number;
171
171
  /** Default notification level for new members. */
172
172
  defaultMessageNotifications: number;
173
+ /** AFK voice channel, or null. */ afkChannelId: string | null;
174
+ /** Seconds before a silent member is moved to the AFK channel. */ afkTimeout?: number;
175
+ /** Whether the server widget is on. */ widgetEnabled: boolean;
176
+ /** Channel the widget invites to, or null. */ widgetChannelId: string | null;
177
+ /** Application that created the guild, if a bot did. */ applicationId: string | null;
178
+ /** Channel for Discord's community updates, or null. */ publicUpdatesChannelId: string | null;
179
+ /** Channel for safety alerts, or null. */ safetyAlertsChannelId: string | null;
180
+ /** Maximum presences (null for the default limit). */ maxPresences: number | null;
181
+ /** Maximum users in a video channel. */ maxVideoChannelUsers?: number;
173
182
  constructor(data: import("@lunibee/types").APIGuild);
174
183
  /** Returns the guild icon URL, or null if no icon is set. */
175
184
  iconURL(options?: ImageURLOptions): string | null;
@@ -9,8 +9,8 @@ export interface ComponentCollectorOptions extends CollectorOptions<ComponentInt
9
9
  componentType?: number;
10
10
  }
11
11
  import type { ResourceContext } from "./base.js";
12
- export { BaseStructure, Channel, Guild, User } from "./base.js";
13
- export type { ResourceContext } from "./base.js";
12
+ export { BaseStructure, Channel, Guild, User, CDN_BASE, cdnURL, } from "./base.js";
13
+ export type { ResourceContext, ImageURLOptions } from "./base.js";
14
14
  export declare class Message extends BaseStructure {
15
15
  #private;
16
16
  content: string;
@@ -31,6 +31,12 @@ export declare class Message extends BaseStructure {
31
31
  readonly reference?: import("@lunibee/types").APIMessageReference;
32
32
  readonly components: import("@lunibee/types").APIMessageComponent[];
33
33
  readonly referencedMessage?: Message | null;
34
+ /** Stickers sent with the message (`sticker_items`). */
35
+ readonly stickers: import("@lunibee/types").APIStickerItem[];
36
+ /** The poll, when the message is one. */
37
+ readonly poll: import("@lunibee/types").APIPoll | null;
38
+ /** For a forwarded message, the snapshot of the original. */
39
+ readonly messageSnapshots: import("@lunibee/types").APIMessageSnapshot[];
34
40
  /**
35
41
  * The author as a guild member, on guild messages from the Gateway. Its
36
42
  * `permissions` are computed from the cached roles; `member.kick()` and the
@@ -55,8 +61,8 @@ export declare class Message extends BaseStructure {
55
61
  update(options: Record<string, unknown> & {
56
62
  content?: string;
57
63
  }): Promise<Message>;
58
- /** Deletes this message. @returns A promise fulfilled when Discord confirms deletion. @throws {Error} If the message is not attached to a client. */
59
- delete(): Promise<void>;
64
+ /** Deletes this message. @param reason Audit-log reason (shown when deleting someone else's message). @returns A promise fulfilled when Discord confirms deletion. @throws {Error} If the message is not attached to a client. */
65
+ delete(reason?: string): Promise<void>;
60
66
  /** Replies to this message. @param options Message content or payload. @returns The created reply message. @throws {Error} If the message is not attached to a client. */
61
67
  reply(options: string | (Record<string, unknown> & {
62
68
  content?: string;
@@ -84,10 +90,10 @@ export declare class Message extends BaseStructure {
84
90
  removeReaction(emoji: string, userId?: string): Promise<void>;
85
91
  /** Removes all reactions from this message. @returns A promise fulfilled when reactions are removed. @throws {Error} If reaction operations are unavailable. */
86
92
  removeAllReactions(): Promise<void>;
87
- /** Pins this message. @returns A promise fulfilled when the message is pinned. @throws {Error} If pin operations are unavailable. */
88
- pin(): Promise<void>;
89
- /** Unpins this message. @returns A promise fulfilled when the message is unpinned. @throws {Error} If pin operations are unavailable. */
90
- unpin(): Promise<void>;
93
+ /** Pins this message. @param reason Audit-log reason. @returns A promise fulfilled when the message is pinned. @throws {Error} If pin operations are unavailable. */
94
+ pin(reason?: string): Promise<void>;
95
+ /** Unpins this message. @param reason Audit-log reason. @returns A promise fulfilled when the message is unpinned. @throws {Error} If pin operations are unavailable. */
96
+ unpin(reason?: string): Promise<void>;
91
97
  /** Whether this message was sent ephemerally (only visible to the recipient). */
92
98
  get isEphemeral(): boolean;
93
99
  /** Whether this message is currently pinned in its channel. */
@@ -109,7 +115,7 @@ export declare class Message extends BaseStructure {
109
115
  /** Returns a plain-object snapshot of all message fields. */
110
116
  toJSON(): Record<string, unknown>;
111
117
  }
112
- export { GuildMember, Role, TextChannel, Invite, Webhook, WebhookType, Emoji, AutoModerationRule, WelcomeScreenChannel, GuildWelcomeScreen, OnboardingPromptOption, OnboardingPrompt, GuildOnboarding, } from "./resources.js";
118
+ export { GuildMember, Role, TextChannel, Invite, Webhook, WebhookEnum, WebhookType, Emoji, AutoModerationRule, WelcomeScreenChannel, GuildWelcomeScreen, OnboardingPromptOption, OnboardingPrompt, GuildOnboarding, } from "./resources.js";
113
119
  export { NewsChannel, DMChannel, VoiceChannel, StageChannel, CategoryChannel, ThreadChannel, ForumChannel, MediaChannel, createChannel, } from "./channels.js";
114
120
  export * from "./interactions.js";
115
121
  export { Embed } from "./embed.js";