lunibee 0.1.4 → 0.1.6

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 (42) hide show
  1. package/README.md +12 -23
  2. package/dist/builders/components.d.ts +108 -0
  3. package/dist/builders/index.d.ts +1 -1
  4. package/dist/builders/index.js +178 -2
  5. package/dist/builders/index.js.map +3 -3
  6. package/dist/collection/index.d.ts +6 -0
  7. package/dist/collection/index.js +33 -2
  8. package/dist/collection/index.js.map +4 -4
  9. package/dist/core/events.d.ts +67 -3
  10. package/dist/core/index.d.ts +120 -90
  11. package/dist/core/index.js +816 -1021
  12. package/dist/core/index.js.map +20 -21
  13. package/dist/formatters/index.js.map +1 -1
  14. package/dist/index.d.ts +5 -4
  15. package/dist/index.js +2215 -1392
  16. package/dist/index.js.map +29 -26
  17. package/dist/managers/guild.d.ts +30 -0
  18. package/dist/managers/index.d.ts +56 -75
  19. package/dist/managers/index.js +339 -48
  20. package/dist/managers/index.js.map +16 -12
  21. package/dist/managers/message.d.ts +7 -12
  22. package/dist/managers/user.d.ts +20 -0
  23. package/dist/rest/index.d.ts +83 -1
  24. package/dist/rest/index.js +48 -8
  25. package/dist/rest/index.js.map +4 -4
  26. package/dist/rest/routes.d.ts +4 -1
  27. package/dist/sharding/index.js +4 -1
  28. package/dist/sharding/index.js.map +4 -4
  29. package/dist/structures/base.d.ts +99 -48
  30. package/dist/structures/embed.d.ts +65 -0
  31. package/dist/structures/index.d.ts +45 -25
  32. package/dist/structures/index.js +569 -36
  33. package/dist/structures/index.js.map +10 -8
  34. package/dist/structures/interactions.d.ts +72 -17
  35. package/dist/structures/resources.d.ts +9 -5
  36. package/dist/types/index.d.ts +530 -85
  37. package/dist/types/index.js +71 -1
  38. package/dist/types/index.js.map +3 -3
  39. package/dist/voice/index.js.map +1 -1
  40. package/dist/ws/index.js +4 -1
  41. package/dist/ws/index.js.map +4 -4
  42. package/package.json +15 -15
@@ -1,39 +1,59 @@
1
+ /** Resource structures for Discord messages and related entities. */
1
2
  import { BaseStructure, Channel, User } from "./base.js";
2
3
  import type { ResourceContext } from "./base.js";
3
- /** Common Discord structure exports. */
4
4
  export { BaseStructure, Channel, Guild, User } from "./base.js";
5
5
  export type { ResourceContext } from "./base.js";
6
- /** Represents a Discord message. */
7
6
  export declare class Message extends BaseStructure {
8
7
  #private;
9
- /** Message content. */ content: string;
10
- /** Message author. */ author: User;
11
- /** Channel ID containing the message. */ channelId: string;
12
- /** Channel containing the message. */ readonly channel: Channel;
13
- /** Guild ID containing the message. */ guildId?: string;
14
- /** Message flags. */ flags: number;
15
- /** Message creation time. */ readonly createdAt: Date;
16
- /** Message attachments. */ readonly attachments: import("@lunibee/types").APIAttachment[];
17
- /** Message embeds. */ readonly embeds: import("@lunibee/types").APIEmbed[];
18
- /** Mentioned users. */ readonly mentions: User[];
19
- /** Mentioned role IDs. */ readonly mentionRoles: string[];
20
- /** Whether the message is pinned. */ pinned: boolean;
21
- /** Whether the message mentions everyone. */ mentionEveryone: boolean;
22
- /** Discord message type. */ type: number;
23
- /** Message reference (reply chain data). */ readonly reference?: import("@lunibee/types").APIMessageReference;
24
- /** The referenced/replied-to message, if included by Discord. */ readonly referencedMessage?: Message | null;
25
- /** Creates a message from Discord API data. @param data Message payload. @param context Optional owning resource context. @throws {TypeError} If required message identifiers are invalid. */
8
+ content: string;
9
+ author: User;
10
+ channelId: string;
11
+ readonly channel: Channel;
12
+ guildId?: string;
13
+ flags: number;
14
+ /** Message creation timestamp (from timestamp field or snowflake). */
15
+ readonly timestamp: Date;
16
+ readonly attachments: import("@lunibee/types").APIAttachment[];
17
+ readonly embeds: import("@lunibee/types").APIEmbed[];
18
+ readonly mentions: User[];
19
+ readonly mentionRoles: string[];
20
+ pinned: boolean;
21
+ mentionEveryone: boolean;
22
+ type: number;
23
+ readonly reference?: import("@lunibee/types").APIMessageReference;
24
+ readonly components: import("@lunibee/types").APIMessageComponent[];
25
+ readonly referencedMessage?: Message | null;
26
+ /** Creates a message structure from Discord message data. */
26
27
  constructor(data: import("@lunibee/types").APIMessage, context?: ResourceContext);
27
- /** Whether embeds are suppressed. @returns True when the suppress-embeds flag is set. */ get embedsSuppressed(): boolean;
28
- /** Edits this message. @param options Edit payload. @returns Updated message. @throws {Error} If detached from a client. */ edit(options: {
28
+ /** Whether embeds are suppressed on this message. */
29
+ get embedsSuppressed(): boolean;
30
+ /** Edits this message. @param options Message fields to change. @returns The updated message. @throws {Error} If the message is not attached to a client. */
31
+ edit(options: Record<string, unknown> & {
29
32
  content?: string;
30
33
  }): Promise<Message>;
31
- /** Deletes this message. @returns Nothing. @throws {Error} If detached from a client. */ delete(): Promise<void>;
32
- /** Crossposts this message. @returns Crossposted message. @throws {Error} If detached from a client. */ crosspost(): Promise<Message>;
33
- /** Replies in this message's channel, auto-populating message_reference. @param options Message content or payload. @returns Created reply. @throws {Error} If detached from a client. */ reply(options: string | {
34
+ /** Updates this message using the same resource operation as edit. @param options Message fields to change. @returns The updated message. @throws {Error} If the message is not attached to a client. */
35
+ update(options: Record<string, unknown> & {
34
36
  content?: string;
35
- [key: string]: unknown;
36
37
  }): Promise<Message>;
38
+ /** Deletes this message. @returns A promise fulfilled when Discord confirms deletion. @throws {Error} If the message is not attached to a client. */
39
+ delete(): Promise<void>;
40
+ /** 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. */
41
+ reply(options: string | (Record<string, unknown> & {
42
+ content?: string;
43
+ })): Promise<Message>;
44
+ /** Crossposts this message. @returns The resulting message. @throws {Error} If the message is not attached to a client. */
45
+ crosspost(): Promise<Message>;
46
+ /** Adds a reaction to this message. @param emoji Emoji identifier. @returns A promise fulfilled when the reaction is added. @throws {Error} If reactions are unavailable. */
47
+ react(emoji: string): Promise<void>;
48
+ /** Removes a reaction from this message. @param emoji Emoji identifier. @param userId User whose reaction should be removed; omit to remove the current user's reaction. @returns A promise fulfilled when the reaction is removed. @throws {Error} If reaction operations are unavailable. */
49
+ removeReaction(emoji: string, userId?: string): Promise<void>;
50
+ /** Removes all reactions from this message. @returns A promise fulfilled when reactions are removed. @throws {Error} If reaction operations are unavailable. */
51
+ removeAllReactions(): Promise<void>;
52
+ /** Pins this message. @returns A promise fulfilled when the message is pinned. @throws {Error} If pin operations are unavailable. */
53
+ pin(): Promise<void>;
54
+ /** Unpins this message. @returns A promise fulfilled when the message is unpinned. @throws {Error} If pin operations are unavailable. */
55
+ unpin(): Promise<void>;
37
56
  }
38
57
  export { GuildMember, Role, TextChannel } from "./resources.js";
39
58
  export * from "./interactions.js";
59
+ export { Embed } from "./embed.js";