@nerimity/nerimity.js 1.19.0 → 1.20.0

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/build/AsyncFunctionQueue.d.ts +43 -0
  2. package/build/AsyncFunctionQueue.d.ts.map +1 -0
  3. package/build/AsyncFunctionQueue.js +105 -0
  4. package/build/AsyncFunctionQueue.js.map +1 -0
  5. package/build/Attachment.d.ts +8 -0
  6. package/build/Attachment.d.ts.map +1 -0
  7. package/build/Attachment.js +41 -0
  8. package/build/Attachment.js.map +1 -0
  9. package/build/Client.d.ts +233 -121
  10. package/build/Client.d.ts.map +1 -1
  11. package/build/Client.js +211 -7
  12. package/build/Client.js.map +1 -1
  13. package/build/Webhooks.d.ts +73 -0
  14. package/build/Webhooks.d.ts.map +1 -0
  15. package/build/Webhooks.js +122 -0
  16. package/build/Webhooks.js.map +1 -0
  17. package/build/classes/Button.d.ts +19 -0
  18. package/build/classes/Button.d.ts.map +1 -0
  19. package/build/classes/Button.js +29 -0
  20. package/build/classes/Button.js.map +1 -0
  21. package/build/classes/Channel.d.ts +2 -0
  22. package/build/classes/Channel.d.ts.map +1 -1
  23. package/build/classes/Channel.js +16 -12
  24. package/build/classes/Channel.js.map +1 -1
  25. package/build/classes/Message.d.ts +1 -0
  26. package/build/classes/Message.d.ts.map +1 -1
  27. package/build/classes/Message.js +1 -0
  28. package/build/classes/Message.js.map +1 -1
  29. package/build/classes/Webhooks.d.ts.map +1 -1
  30. package/build/classes/Webhooks.js +6 -1
  31. package/build/classes/Webhooks.js.map +1 -1
  32. package/build/services/MessageService.d.ts +1 -0
  33. package/build/services/MessageService.d.ts.map +1 -1
  34. package/build/services/MessageService.js +18 -24
  35. package/build/services/MessageService.js.map +1 -1
  36. package/build/services/PostsService.d.ts.map +1 -1
  37. package/build/services/PostsService.js +0 -8
  38. package/build/services/PostsService.js.map +1 -1
  39. package/build/services/ServerService.d.ts.map +1 -1
  40. package/build/services/ServerService.js +0 -6
  41. package/build/services/ServerService.js.map +1 -1
  42. package/package.json +1 -2
  43. package/src/AsyncFunctionQueue.ts +115 -0
  44. package/src/classes/Channel.ts +17 -12
  45. package/src/classes/Message.ts +2 -0
  46. package/src/classes/Webhooks.ts +8 -1
  47. package/src/services/MessageService.ts +19 -24
  48. package/src/services/PostsService.ts +0 -8
  49. package/src/services/ServerService.ts +0 -6
@@ -0,0 +1,43 @@
1
+ /**
2
+ * A simple and fast async function queue for web environments, with TypeScript types.
3
+ * It ensures that asynchronous functions are executed one after another in the order they were added.
4
+ */
5
+ export declare class AsyncFunctionQueue {
6
+ /**
7
+ * The array that holds the queue items.
8
+ * Using `unknown` is a type-safe alternative to `any`.
9
+ * Type safety for individual items is handled by the generic `add` method.
10
+ * @private
11
+ */
12
+ private queue;
13
+ /**
14
+ * A flag to indicate whether the queue is currently processing an item.
15
+ * @private
16
+ */
17
+ private isProcessing;
18
+ /**
19
+ * Adds an async function to the queue and returns a promise that resolves with the function's return value
20
+ * or rejects with its error.
21
+ * @template T The type of the result that the async function resolves to.
22
+ * @param {() => Promise<T>} asyncFunc - An async function to be added to the queue. It must be a function that returns a Promise.
23
+ * @returns {Promise<T>} A promise that resolves or rejects when the added function is executed.
24
+ */
25
+ add<T>(asyncFunc: () => Promise<T>): Promise<T>;
26
+ /**
27
+ * Processes the next item in the queue.
28
+ * This is a private method and should not be called directly.
29
+ * @private
30
+ */
31
+ private _processNext;
32
+ /**
33
+ * Gets the current size of the queue.
34
+ * @returns {number} The number of items currently in the queue.
35
+ */
36
+ get size(): number;
37
+ /**
38
+ * Checks if the queue is currently processing an item.
39
+ * @returns {boolean} True if processing, false otherwise.
40
+ */
41
+ get isBusy(): boolean;
42
+ }
43
+ //# sourceMappingURL=AsyncFunctionQueue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncFunctionQueue.d.ts","sourceRoot":"","sources":["../src/AsyncFunctionQueue.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B;;;;;OAKG;IACH,OAAO,CAAC,KAAK,CAA4B;IAEzC;;;OAGG;IACH,OAAO,CAAC,YAAY,CAAkB;IAEtC;;;;;;OAMG;IACI,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAmBtD;;;;OAIG;YACW,YAAY;IAuC1B;;;OAGG;IACH,IAAW,IAAI,IAAI,MAAM,CAExB;IAED;;;OAGG;IACH,IAAW,MAAM,IAAI,OAAO,CAE3B;CACF"}
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsyncFunctionQueue = void 0;
4
+ /**
5
+ * A simple and fast async function queue for web environments, with TypeScript types.
6
+ * It ensures that asynchronous functions are executed one after another in the order they were added.
7
+ */
8
+ class AsyncFunctionQueue {
9
+ constructor() {
10
+ /**
11
+ * The array that holds the queue items.
12
+ * Using `unknown` is a type-safe alternative to `any`.
13
+ * Type safety for individual items is handled by the generic `add` method.
14
+ * @private
15
+ */
16
+ this.queue = [];
17
+ /**
18
+ * A flag to indicate whether the queue is currently processing an item.
19
+ * @private
20
+ */
21
+ this.isProcessing = false;
22
+ }
23
+ /**
24
+ * Adds an async function to the queue and returns a promise that resolves with the function's return value
25
+ * or rejects with its error.
26
+ * @template T The type of the result that the async function resolves to.
27
+ * @param {() => Promise<T>} asyncFunc - An async function to be added to the queue. It must be a function that returns a Promise.
28
+ * @returns {Promise<T>} A promise that resolves or rejects when the added function is executed.
29
+ */
30
+ add(asyncFunc) {
31
+ return new Promise((resolve, reject) => {
32
+ // Push the function along with its resolve/reject handlers to the queue.
33
+ // We cast here to satisfy TypeScript's strict checks on function parameter contravariance.
34
+ // This is safe because we ensure that the `resolve` function for a given `asyncFunc`
35
+ // is always called with the result of that specific function.
36
+ this.queue.push({
37
+ asyncFunc,
38
+ resolve,
39
+ reject,
40
+ });
41
+ // If not already processing, start processing the queue.
42
+ if (!this.isProcessing) {
43
+ this._processNext();
44
+ }
45
+ });
46
+ }
47
+ /**
48
+ * Processes the next item in the queue.
49
+ * This is a private method and should not be called directly.
50
+ * @private
51
+ */
52
+ async _processNext() {
53
+ // If there's nothing in the queue, stop processing.
54
+ if (this.queue.length === 0) {
55
+ this.isProcessing = false;
56
+ return;
57
+ }
58
+ // Set the flag to indicate that processing has started.
59
+ this.isProcessing = true;
60
+ // Get the next item from the front of the queue.
61
+ const item = this.queue.shift();
62
+ if (!item) {
63
+ // This case should not be hit due to the length check, but it's good practice for type safety.
64
+ this.isProcessing = false;
65
+ return;
66
+ }
67
+ try {
68
+ // Execute the async function.
69
+ const result = await item.asyncFunc();
70
+ // Resolve the promise associated with this function.
71
+ item.resolve(result);
72
+ }
73
+ catch (error) {
74
+ // Reject the promise if the function throws an error.
75
+ item.reject(error);
76
+ }
77
+ finally {
78
+ // After the function is done (either resolved or rejected),
79
+ // recursively call _processNext to handle the next item in the queue.
80
+ // Using requestAnimationFrame or setTimeout can prevent potential stack overflow with a very long queue of synchronous tasks.
81
+ if (typeof requestAnimationFrame !== "undefined") {
82
+ requestAnimationFrame(() => this._processNext());
83
+ }
84
+ else {
85
+ setTimeout(() => this._processNext(), 0);
86
+ }
87
+ }
88
+ }
89
+ /**
90
+ * Gets the current size of the queue.
91
+ * @returns {number} The number of items currently in the queue.
92
+ */
93
+ get size() {
94
+ return this.queue.length;
95
+ }
96
+ /**
97
+ * Checks if the queue is currently processing an item.
98
+ * @returns {boolean} True if processing, false otherwise.
99
+ */
100
+ get isBusy() {
101
+ return this.isProcessing;
102
+ }
103
+ }
104
+ exports.AsyncFunctionQueue = AsyncFunctionQueue;
105
+ //# sourceMappingURL=AsyncFunctionQueue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncFunctionQueue.js","sourceRoot":"","sources":["../src/AsyncFunctionQueue.ts"],"names":[],"mappings":";;;AAUA;;;GAGG;AACH,MAAa,kBAA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CAAC;gBAAS,CAAC;YACT,4DAA4D;YAC5D,sEAAsE;YACtE,8HAA8H;YAC9H,IAAI,OAAO,qBAAqB,KAAK,WAAW,EAAE,CAAC;gBACjD,qBAAqB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;YACnD,CAAC;iBAAM,CAAC;gBACN,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC3B,CAAC;IAED;;;OAGG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF;AApGD,gDAoGC"}
@@ -0,0 +1,8 @@
1
+ import { Channel } from "./classes/Client";
2
+ export declare class AttachmentBuilder {
3
+ private file;
4
+ private name;
5
+ constructor(file: Blob, name: string);
6
+ build(channel: Channel): Promise<string>;
7
+ }
8
+ //# sourceMappingURL=Attachment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attachment.d.ts","sourceRoot":"","sources":["../src/Attachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAOnC,qBAAa,iBAAiB;IAC1B,OAAO,CAAC,IAAI,CAAO;IACnB,OAAO,CAAC,IAAI,CAAS;gBAET,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM;IAKvB,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;CAOxD"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AttachmentBuilder = void 0;
4
+ const url = 'https://cdn.nerimity.com';
5
+ const uploadUrl = `${url}/upload`;
6
+ const saveUrl = `${url}/attachments`;
7
+ class AttachmentBuilder {
8
+ constructor(file, name) {
9
+ this.file = file;
10
+ this.name = name;
11
+ }
12
+ async build(channel) {
13
+ const formData = new FormData();
14
+ formData.set('file', this.file, this.name);
15
+ const response = await upload(formData);
16
+ await sendUploadChannel(channel.id, response);
17
+ return response.fileId;
18
+ }
19
+ }
20
+ exports.AttachmentBuilder = AttachmentBuilder;
21
+ async function sendUploadChannel(id, cdn) {
22
+ const response = await fetch(`${saveUrl}/${id}/${cdn.fileId}`, {
23
+ method: 'POST',
24
+ body: JSON.stringify(cdn),
25
+ });
26
+ if (!response.ok) {
27
+ throw new Error(`Failed to send attachment: ${response.statusText}`);
28
+ }
29
+ return await response.json();
30
+ }
31
+ async function upload(dat) {
32
+ const response = await fetch(uploadUrl, {
33
+ method: 'POST',
34
+ body: dat,
35
+ });
36
+ if (!response.ok) {
37
+ throw new Error(`Failed to upload attachment: ${response.statusText}`);
38
+ }
39
+ return await response.json();
40
+ }
41
+ //# sourceMappingURL=Attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attachment.js","sourceRoot":"","sources":["../src/Attachment.ts"],"names":[],"mappings":";;;AAGA,MAAM,GAAG,GAAG,0BAA0B,CAAC;AACvC,MAAM,SAAS,GAAG,GAAG,GAAG,SAAS,CAAC;AAClC,MAAM,OAAO,GAAG,GAAG,GAAG,cAAc,CAAC;AAErC,MAAa,iBAAiB;IAI1B,YAAY,IAAU,EAAE,IAAY;QAChC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,OAAgB;QAC/B,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAChC,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;QACxC,MAAM,iBAAiB,CAAC,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QAC9C,OAAO,QAAQ,CAAC,MAAM,CAAC;IAC3B,CAAC;CACJ;AAhBD,8CAgBC;AAED,KAAK,UAAU,iBAAiB,CAAC,EAAU,EAAE,GAAiB;IAC1D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,OAAO,IAAI,EAAE,IAAI,GAAG,CAAC,MAAM,EAAE,EAAE;QAC3D,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC;KAC5B,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC;AAED,KAAK,UAAU,MAAM,CAAC,GAAa;IAC/B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,SAAS,EAAE;QACpC,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,GAAG;KACZ,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC"}
package/build/Client.d.ts CHANGED
@@ -1,160 +1,272 @@
1
1
  import EventEmitter from "eventemitter3";
2
2
  import { Socket } from "socket.io-client";
3
- import { ClientEventMap } from "./EventNames";
4
- import { ChannelType, MessageButtonClickPayload, MessageType, RawChannel, RawMessage, RawMessageButton, RawServer, RawServerMember, RawUser } from "./RawData";
3
+ import { ClientEventMap } from "../EventNames";
4
+ import {
5
+ ChannelType,
6
+ MessageButtonClickPayload,
7
+ MessageType,
8
+ RawBotCommand,
9
+ RawChannel,
10
+ RawMessage,
11
+ RawMessageButton,
12
+ RawPost,
13
+ RawServer,
14
+ RawServerMember,
15
+ RawServerRole,
16
+ RawUser,
17
+ } from "../RawData";
18
+ import { ButtonCallback } from "../services/MessageService";
19
+ import { AvailablePermissions } from "../bitwise";
5
20
  export declare const Events: {
6
- readonly Ready: "ready";
7
- readonly MessageCreate: "messageCreate";
8
- readonly ServerMemberLeft: "serverMemberLeft";
9
- readonly ServerMemberJoined: "serverMemberJoined";
10
- readonly ServerJoined: "serverJoined";
11
- readonly ServerLeft: "serverLeft";
12
- readonly MessageButtonClick: "messageButtonClick";
13
- readonly ServerChannelCreated: "serverChannelCreated";
14
- readonly ServerChannelUpdated: "serverChannelUpdated";
15
- readonly ServerChannelDeleted: "serverChannelDeleted";
21
+ readonly Ready: "ready";
22
+ readonly MessageCreate: "messageCreate";
23
+ readonly MessageUpdate: "messageUpdate";
24
+ readonly ServerMemberLeft: "serverMemberLeft";
25
+ readonly ServerMemberJoined: "serverMemberJoined";
26
+ readonly ServerMemberUpdated: "serverMemberUpdated";
27
+ readonly ServerJoined: "serverJoined";
28
+ readonly ServerLeft: "serverLeft";
29
+ readonly MessageButtonClick: "messageButtonClick";
30
+ readonly ServerChannelCreated: "serverChannelCreated";
31
+ readonly ServerChannelUpdated: "serverChannelUpdated";
32
+ readonly ServerChannelDeleted: "serverChannelDeleted";
33
+ readonly ServerRoleCreated: "serverRoleCreated";
34
+ readonly ServerRoleDeleted: "serverRoleDeleted";
35
+ readonly ServerRoleUpdated: "serverRoleUpdated";
36
+ readonly ServerRoleOrderUpdated: "serverRoleOrderUpdated";
16
37
  };
17
38
  export declare class Client extends EventEmitter<ClientEventMap> {
18
- socket: Socket;
19
- token: string | undefined;
20
- user: ClientUser | undefined;
21
- users: Users;
22
- channels: Channels;
23
- servers: Servers;
24
- constructor(opts?: {
25
- urlOverride?: string;
26
- });
27
- login(token: string): void;
39
+ socket: Socket;
40
+ token: string | undefined;
41
+ user: ClientUser | undefined;
42
+ users: Users;
43
+ channels: Channels;
44
+ servers: Servers;
45
+ posts: Posts;
46
+ constructor(opts?: { urlOverride?: string });
47
+ updateCommands(
48
+ token: string,
49
+ commands: Omit<RawBotCommand, "botUserId">[]
50
+ ): Promise<any>;
51
+ login(token: string): void;
28
52
  }
29
53
  export declare class Users {
30
- client: Client;
31
- cache: Collection<string, User>;
32
- constructor(client: Client);
33
- setCache(rawUser: RawUser): User;
54
+ client: Client;
55
+ cache: Collection<string, User>;
56
+ constructor(client: Client);
57
+ setCache(rawUser: RawUser): User;
34
58
  }
35
59
  export declare class Servers {
36
- client: Client;
37
- cache: Collection<string, Server>;
38
- constructor(client: Client);
39
- setCache(rawServer: RawServer): Server;
60
+ client: Client;
61
+ cache: Collection<string, Server>;
62
+ constructor(client: Client);
63
+ setCache(rawServer: RawServer): Server;
40
64
  }
41
65
  export declare class Server {
42
- client: Client;
43
- id: string;
44
- name: string;
45
- avatar?: string;
46
- members: ServerMembers;
47
- constructor(client: Client, server: RawServer);
66
+ client: Client;
67
+ id: string;
68
+ name: string;
69
+ avatar?: string;
70
+ defaultRoleId: string;
71
+ createdById: string;
72
+ members: ServerMembers;
73
+ roles: ServerRoles;
74
+ constructor(client: Client, server: RawServer);
75
+ banMember(userId: string): Promise<any>;
76
+ }
77
+ export declare class ServerRoles {
78
+ client: Client;
79
+ cache: Collection<string, ServerRole>;
80
+ constructor(client: Client);
81
+ setCache(rawServerRole: RawServerRole): ServerRole;
82
+ }
83
+ export declare class ServerRole {
84
+ client: Client;
85
+ id: string;
86
+ name: string;
87
+ permissions: number;
88
+ hexColor: string;
89
+ server: Server;
90
+ order: number;
91
+ isDefaultRole?: boolean;
92
+ constructor(client: Client, role: RawServerRole);
48
93
  }
49
94
  export declare class ServerMembers {
50
- client: Client;
51
- cache: Collection<string, ServerMember>;
52
- constructor(client: Client);
53
- setCache(rawMember: RawServerMember): ServerMember;
95
+ client: Client;
96
+ cache: Collection<string, ServerMember>;
97
+ constructor(client: Client);
98
+ setCache(rawMember: RawServerMember): ServerMember;
54
99
  }
55
100
  export declare class ServerMember {
56
- client: Client;
57
- id: string;
58
- user: User;
59
- server: Server;
60
- constructor(client: Client, member: RawServerMember);
61
- toString(): string;
101
+ client: Client;
102
+ id: string;
103
+ user: User;
104
+ server: Server;
105
+ roleIds: string[];
106
+ nickname?: string | null;
107
+ constructor(client: Client, member: RawServerMember);
108
+ toString(): string;
109
+ ban(): Promise<any>;
110
+ get roles(): ServerRole[];
111
+ permissions(this: ServerMember): number;
112
+ hasPermission(
113
+ permission: AvailablePermissions,
114
+ ignoreAdmin?: boolean,
115
+ ignoreCreator?: boolean
116
+ ): boolean;
62
117
  }
63
118
  export declare class Channels {
64
- client: Client;
65
- cache: Collection<string, AllChannel>;
66
- constructor(client: Client);
67
- setCache(rawChannel: {
68
- id: string;
69
- } & Omit<Partial<RawChannel>, "id">): AllChannel;
119
+ client: Client;
120
+ cache: Collection<string, AllChannel>;
121
+ constructor(client: Client);
122
+ setCache(
123
+ rawChannel: {
124
+ id: string;
125
+ } & Omit<Partial<RawChannel>, "id">
126
+ ): AllChannel;
70
127
  }
71
128
  export type AllChannel = ServerChannel | Channel;
72
129
  export interface MessageOpts {
73
- htmlEmbed?: string;
74
- buttons?: RawMessageButton[];
75
- silent?: boolean;
130
+ htmlEmbed?: string;
131
+ nerimityCdnFileId?: string;
132
+ buttons?: RawMessageButton[];
133
+ silent?: boolean;
134
+ replyToMessageIds?: string[];
135
+ mentionReplies?: boolean;
136
+ }
137
+ export interface PostOpts {
138
+ nerimityCdnFileId?: string;
139
+ poll?: {
140
+ choices: string[];
141
+ };
76
142
  }
77
143
  export declare class Channel {
78
- client: Client;
79
- id: string;
80
- type: ChannelType;
81
- createdAt?: number;
82
- lastMessagedAt?: number;
83
- constructor(client: Client, channel: RawChannel);
84
- send(content: string, opts?: MessageOpts): Promise<Message>;
85
- toString(): string;
144
+ client: Client;
145
+ id: string;
146
+ type: ChannelType;
147
+ createdAt?: number;
148
+ lastMessagedAt?: number;
149
+ server?: Server;
150
+ constructor(client: Client, channel: RawChannel);
151
+ send(content: string, opts?: MessageOpts): Promise<Message>;
152
+ toString(): string;
86
153
  }
87
154
  export declare class ServerChannel extends Channel {
88
- createdById: string;
89
- name: string;
90
- serverId: string;
91
- permissions: number;
92
- categoryId?: string;
93
- server: Server;
94
- constructor(client: Client, channel: RawChannel);
155
+ createdById: string;
156
+ name: string;
157
+ serverId: string;
158
+ permissions: number;
159
+ categoryId?: string;
160
+ server: Server;
161
+ constructor(client: Client, channel: RawChannel);
95
162
  }
96
163
  export declare class Message {
97
- client: Client;
164
+ client: Client;
165
+ id: string;
166
+ content?: string;
167
+ type: MessageType;
168
+ createdAt: number;
169
+ channelId: string;
170
+ channel: AllChannel;
171
+ user: User;
172
+ mentions: User[];
173
+ command?: {
174
+ name: string;
175
+ args: string[];
176
+ };
177
+ constructor(client: Client, message: RawMessage);
178
+ get member(): ServerMember | undefined;
179
+ reply(content: string, opts?: MessageOpts): Promise<Message>;
180
+ edit(content: string): Promise<Message>;
181
+ delete(): Promise<{
182
+ message: string;
183
+ }>;
184
+ toString(): string;
185
+ }
186
+ declare class Posts {
187
+ client: Client;
188
+ constructor(client: Client);
189
+ get(id?: string): Promise<Post | Post[] | undefined>;
190
+ create(content: string, opts?: PostOpts): Promise<Post>;
191
+ }
192
+ export declare class Post {
193
+ client: Client;
194
+ id: string;
195
+ content?: string;
196
+ attachments?: Array<any>;
197
+ deleted: boolean;
198
+ block?: boolean;
199
+ commentToId: string;
200
+ commentTo?: RawPost;
201
+ createdBy: RawUser;
202
+ createdAt: number;
203
+ editedAt: number;
204
+ likedBy: {
205
+ id: string;
206
+ }[];
207
+ reposts: {
98
208
  id: string;
99
- content?: string;
100
- type: MessageType;
101
- createdAt: number;
102
- channelId: string;
103
- channel: AllChannel;
104
- user: User;
105
- mentions: User[];
106
- constructor(client: Client, message: RawMessage);
107
- reply(content: string, opts?: MessageOpts): Promise<Message>;
108
- edit(content: string): Promise<Message>;
109
- delete(): Promise<{
110
- message: string;
111
- }>;
112
- toString(): string;
209
+ createdBy: {
210
+ id: string;
211
+ username: string;
212
+ };
213
+ }[];
214
+ repost?: RawPost;
215
+ _count: {
216
+ likedBy: number;
217
+ comments: number;
218
+ reposts: number;
219
+ };
220
+ views: number;
221
+ announcement: any;
222
+ poll?: any;
223
+ constructor(client: Client, post: RawPost);
224
+ edit(content: string): Promise<Post>;
225
+ delete(): Promise<void>;
113
226
  }
114
227
  declare class User {
115
- client: Client;
116
- id: string;
117
- avatar?: string;
118
- banner?: string;
119
- username: string;
120
- hexColor: string;
121
- tag: string;
122
- badges: number;
123
- joinedAt?: number;
124
- bot?: boolean;
125
- constructor(client: Client, user: RawUser);
126
- toString(): string;
228
+ client: Client;
229
+ id: string;
230
+ avatar?: string;
231
+ banner?: string;
232
+ username: string;
233
+ hexColor: string;
234
+ tag: string;
235
+ badges: number;
236
+ joinedAt?: number;
237
+ bot?: boolean;
238
+ constructor(client: Client, user: RawUser);
239
+ toString(): string;
127
240
  }
128
241
  export interface ActivityOpts {
129
- action: string;
130
- name: string;
131
- startedAt: number;
132
- endsAt?: number;
133
- imgSrc?: string;
134
- title?: string;
135
- subtitle?: string;
136
- link?: string;
242
+ action: string;
243
+ name: string;
244
+ startedAt: number;
245
+ endsAt?: number;
246
+ imgSrc?: string;
247
+ title?: string;
248
+ subtitle?: string;
249
+ link?: string;
137
250
  }
138
251
  declare class ClientUser extends User {
139
- setActivity(activity?: ActivityOpts | null): void;
140
- constructor(client: Client, user: RawUser);
252
+ setActivity(activity?: ActivityOpts | null): void;
253
+ constructor(client: Client, user: RawUser);
141
254
  }
142
255
  declare class Collection<K, V> extends Map<K, V> {
143
- constructor();
256
+ constructor();
144
257
  }
145
258
  export declare class Button {
146
- client: Client;
147
- id: string;
148
- userId: string;
149
- messageId: string;
150
- channelId: string;
151
- user?: User;
152
- channel: Channel;
153
- constructor(client: Client, payload: MessageButtonClickPayload);
154
- respond(opts?: {
155
- title?: string;
156
- content?: string;
157
- }): Promise<void>;
259
+ client: Client;
260
+ id: string;
261
+ userId: string;
262
+ messageId: string;
263
+ channelId: string;
264
+ user?: User;
265
+ channel: Channel;
266
+ data?: Record<string, string>;
267
+ type: "modal_click" | "button_click";
268
+ constructor(client: Client, payload: MessageButtonClickPayload);
269
+ respond(opts?: ButtonCallback): Promise<void>;
158
270
  }
159
271
  export {};
160
- //# sourceMappingURL=Client.d.ts.map
272
+ //# sourceMappingURL=Client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Client.d.ts","sourceRoot":"","sources":["../src/Client.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,MAAM,EAAM,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EACL,cAAc,EAIf,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,WAAW,EACX,yBAAyB,EACzB,WAAW,EACX,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,eAAe,EACf,OAAO,EACR,MAAM,WAAW,CAAC;AASnB,eAAO,MAAM,MAAM;;;;;;;;;;;CAAe,CAAC;AAEnC,qBAAa,MAAO,SAAQ,YAAY,CAAC,cAAc,CAAC;IACtD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;gBAEL,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE;IAepC,KAAK,CAAC,KAAK,EAAE,MAAM;CAI3B;AAkLD,qBAAa,KAAK;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;gBACpB,MAAM,EAAE,MAAM;IAI1B,QAAQ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