sweety-html-transcripts 0.2.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 (81) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +127 -0
  3. package/dist/adapters/core.d.ts +41 -0
  4. package/dist/adapters/core.js +30 -0
  5. package/dist/adapters/core.js.map +1 -0
  6. package/dist/adapters/discordjs.d.ts +26 -0
  7. package/dist/adapters/discordjs.js +102 -0
  8. package/dist/adapters/discordjs.js.map +1 -0
  9. package/dist/adapters/seyfert.d.ts +26 -0
  10. package/dist/adapters/seyfert.js +67 -0
  11. package/dist/adapters/seyfert.js.map +1 -0
  12. package/dist/downloader/images.d.ts +37 -0
  13. package/dist/downloader/images.js +119 -0
  14. package/dist/downloader/images.js.map +1 -0
  15. package/dist/generator/index.d.ts +34 -0
  16. package/dist/generator/index.js +81 -0
  17. package/dist/generator/index.js.map +1 -0
  18. package/dist/generator/renderers/attachment.d.ts +24 -0
  19. package/dist/generator/renderers/attachment.js +133 -0
  20. package/dist/generator/renderers/attachment.js.map +1 -0
  21. package/dist/generator/renderers/components.d.ts +8 -0
  22. package/dist/generator/renderers/components.js +179 -0
  23. package/dist/generator/renderers/components.js.map +1 -0
  24. package/dist/generator/renderers/content.d.ts +32 -0
  25. package/dist/generator/renderers/content.js +168 -0
  26. package/dist/generator/renderers/content.js.map +1 -0
  27. package/dist/generator/renderers/embed.d.ts +15 -0
  28. package/dist/generator/renderers/embed.js +77 -0
  29. package/dist/generator/renderers/embed.js.map +1 -0
  30. package/dist/generator/renderers/message.d.ts +15 -0
  31. package/dist/generator/renderers/message.js +95 -0
  32. package/dist/generator/renderers/message.js.map +1 -0
  33. package/dist/generator/renderers/reply.d.ts +7 -0
  34. package/dist/generator/renderers/reply.js +76 -0
  35. package/dist/generator/renderers/reply.js.map +1 -0
  36. package/dist/generator/renderers/systemMessage.d.ts +19 -0
  37. package/dist/generator/renderers/systemMessage.js +109 -0
  38. package/dist/generator/renderers/systemMessage.js.map +1 -0
  39. package/dist/generator/transcript.d.ts +12 -0
  40. package/dist/generator/transcript.js +85 -0
  41. package/dist/generator/transcript.js.map +1 -0
  42. package/dist/index.d.ts +26 -0
  43. package/dist/index.js +143 -0
  44. package/dist/index.js.map +1 -0
  45. package/dist/static/client.d.ts +2 -0
  46. package/dist/static/client.js +30 -0
  47. package/dist/static/client.js.map +1 -0
  48. package/dist/types.d.ts +69 -0
  49. package/dist/types.js +10 -0
  50. package/dist/types.js.map +1 -0
  51. package/dist/utils/api.d.ts +19 -0
  52. package/dist/utils/api.js +364 -0
  53. package/dist/utils/api.js.map +1 -0
  54. package/dist/utils/cdn.d.ts +28 -0
  55. package/dist/utils/cdn.js +61 -0
  56. package/dist/utils/cdn.js.map +1 -0
  57. package/dist/utils/channel.d.ts +34 -0
  58. package/dist/utils/channel.js +51 -0
  59. package/dist/utils/channel.js.map +1 -0
  60. package/dist/utils/embeds.d.ts +2 -0
  61. package/dist/utils/embeds.js +17 -0
  62. package/dist/utils/embeds.js.map +1 -0
  63. package/dist/utils/guild.d.ts +9 -0
  64. package/dist/utils/guild.js +19 -0
  65. package/dist/utils/guild.js.map +1 -0
  66. package/dist/utils/message.d.ts +6 -0
  67. package/dist/utils/message.js +11 -0
  68. package/dist/utils/message.js.map +1 -0
  69. package/dist/utils/profiles.d.ts +18 -0
  70. package/dist/utils/profiles.js +67 -0
  71. package/dist/utils/profiles.js.map +1 -0
  72. package/dist/utils/replacer.d.ts +28 -0
  73. package/dist/utils/replacer.js +67 -0
  74. package/dist/utils/replacer.js.map +1 -0
  75. package/dist/utils/user.d.ts +18 -0
  76. package/dist/utils/user.js +38 -0
  77. package/dist/utils/user.js.map +1 -0
  78. package/dist/utils/utils.d.ts +32 -0
  79. package/dist/utils/utils.js +61 -0
  80. package/dist/utils/utils.js.map +1 -0
  81. package/package.json +90 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,127 @@
1
+ # `sweety-html-transcripts`
2
+
3
+ [![Discord](https://img.shields.io/discord/555474311637499955?label=discord)](https://discord.gg/4JmKY8wgB6)
4
+ [![npm](https://img.shields.io/npm/dw/sweety-html-transcripts)](http://npmjs.org/package/sweety-html-transcripts)
5
+ ![GitHub package.json version](https://img.shields.io/github/package-json/v/Ganyu-Studios/sweety-html-transcripts)
6
+ ![GitHub Repo stars](https://img.shields.io/github/stars/Ganyu-Studios/sweety-html-transcripts?style=social)
7
+
8
+ Discord HTML Transcripts is a node.js module to generate nice looking HTML
9
+ transcripts. Processes discord markdown like **bold**, _italics_,
10
+ ~~strikethroughs~~, and more. Nicely formats attachments and embeds. Built in
11
+ XSS protection, preventing users from inserting arbitrary html tags.
12
+
13
+ This module can format the following:
14
+
15
+ - Discord flavored markdown
16
+ - Uses
17
+ [discord-markdown-parser](https://github.com/ItzDerock/discord-markdown-parser)
18
+ - Allows for complex markdown syntax to be parsed properly
19
+ - Embeds
20
+ - System messages
21
+ - Join messages
22
+ - Message Pins
23
+ - Boost messages
24
+ - Slash commands
25
+ - Will show the name of the command in the same style as Discord
26
+ - Buttons
27
+ - Reactions
28
+ - Attachments
29
+ - Images, videos, audio, and generic files
30
+ - Replies
31
+ - Mentions
32
+ - Threads
33
+
34
+ **This module is designed to work with [seyfert](https://seyfert.dev) 3.2 or
35
+ above _only_.**
36
+
37
+ Styles from
38
+ [@penwin/discord-components-core](https://github.com/Ganyu-Studios/discord-components).\
39
+ Behind the scenes, this package uses React SSR to generate a static site.
40
+
41
+ ## 👋 Support
42
+
43
+ Please do not DM me requesting support with this package, I will not respond.\
44
+ Instead, please open a thread on [this](https://discord.gg/4JmKY8wgB6) server.
45
+
46
+ ## 🖨️ Example Output
47
+
48
+ ![output](./assets/output.gif)
49
+
50
+ ## 📝 Usage
51
+
52
+ ### Example usage using the built in message fetcher.
53
+
54
+ ```js
55
+ const discordTranscripts = require('sweety-html-transcripts');
56
+ // or (if using typescript) import * as discordTranscripts from 'sweety-html-transcripts';
57
+
58
+ const channel = await client.channels.raw(channelId); // or however you get your channel raw object
59
+
60
+ // Must be awaited
61
+ const attachment = await discordTranscripts.createTranscript({ channel });
62
+
63
+ client.channel.messages.write(channelId, {
64
+ files: [attachment],
65
+ });
66
+ ```
67
+
68
+ ### Or if you prefer, you can pass in your own messages.
69
+
70
+ ```js
71
+ const discordTranscripts = require('sweety-html-transcripts');
72
+ // or (if using typescript) import * as discordTranscripts from 'sweety-html-transcripts';
73
+
74
+ const messages = someWayToGetMessages(); // Must be Collection<string, Message> or Message[]
75
+ const channel = someWayToGetChannel(); // Used for ticket name, guild icon, and guild name
76
+
77
+ // Must be awaited
78
+ const attachment = await discordTranscripts.generateFromMessages(messages, {
79
+ channel,
80
+ });
81
+
82
+ client.channel.messages.write(channelId, {
83
+ files: [attachment],
84
+ });
85
+ ```
86
+
87
+ ## ⚙️ Configuration
88
+
89
+ Both methods of generating a transcript allow for an option object as the last
90
+ parameter.\
91
+ **All configuration options are optional!**
92
+
93
+ ### Built in Message Fetcher
94
+
95
+ ```js
96
+ const attachment = await discordTranscripts.createTranscript({
97
+ channel: channel, // The API channel object to create the transcript.
98
+ limit: -1, // Max amount of messages to fetch. `-1` recursively fetches.
99
+ returnType: 'attachment', // Valid options: 'buffer' | 'string' | 'attachment' Default: 'attachment' OR use the enum ExportReturnType
100
+ filename: 'transcript.html', // Only valid with returnType is 'attachment'. Name of attachment.
101
+ saveImages: false, // Download all images and include the image data in the HTML (allows viewing the image even after it has been deleted) (! WILL INCREASE FILE SIZE !)
102
+ footerText: "Exported {number} message{s}", // Change text at footer, don't forget to put {number} to show how much messages got exported, and {s} for plural
103
+ adapter: new SomeAdapter(), // The adapter to use to generate the transcripts
104
+ callbacks: {
105
+ // register custom callbacks for the following:
106
+ resolveChannel: (channelId: string) => Awaitable<AllAPIChannel | null>,
107
+ resolveUser: (userId: string) => Awaitable<APIUser | null>,
108
+ resolveRole: (roleId: string) => Awaitable<APIRole | null>,
109
+ },
110
+ poweredBy: true, // Whether to include the "Powered by sweety-html-transcripts" footer
111
+ hydrate: true, // Whether to hydrate the html server-side
112
+ filter: (APIMessage) => true // Filter messages, e.g. (message) => !message.author.bot
113
+ });
114
+ ```
115
+
116
+ ### Providing your own messages
117
+
118
+ ```js
119
+ const attachment = await discordTranscripts.generateFromMessages(messages, {
120
+ // Same as createTranscript, except no limit or filter
121
+ channel: channel, // The API channel object to create the transcript.
122
+ });
123
+ ```
124
+
125
+ ## 🤝 Enjoy the package?
126
+
127
+ Give it a star ⭐ and/or support me on [ko-fi](https://ko-fi.com/justevil)
@@ -0,0 +1,41 @@
1
+ import type { ChannelSelectMenuOptionData, RoleSelectMenuOptionData, UserSelectMenuOptionData } from '@penwin/discord-components-core';
2
+ import type { APIGuild, APIMessage, APIRole, APIUser, GatewayGuildCreateDispatchData } from 'discord-api-types/v10';
3
+ import type { Profile } from '../utils/profiles';
4
+ import type { AllAPIChannel, APIMessageData, GuildMemberData } from '../utils/channel';
5
+ export type Awaitable<T> = Promise<T> | T;
6
+ export declare abstract class TranscriptAdapter<Client> {
7
+ protected client: Client;
8
+ constructor(client: Client);
9
+ abstract resolveChannel(id: string): Awaitable<AllAPIChannel | null>;
10
+ abstract resolveUser(id: string): Awaitable<APIUser | null>;
11
+ abstract resolveRole(guildId: string, id: string): Awaitable<APIRole | null>;
12
+ abstract resolveGuild(id: string): Awaitable<APIGuild | GatewayGuildCreateDispatchData | null>;
13
+ abstract resolveMessage(channelId: string, messageId: string): Awaitable<APIMessageData | null>;
14
+ abstract listChannelMessages(channelId: string, options?: {
15
+ limit?: number;
16
+ before?: string;
17
+ }): Awaitable<APIMessage[]>;
18
+ abstract createTranscriptAttachment(html: string, filename: string): Awaitable<unknown>;
19
+ abstract resolveGuildRoles(guildId: string): Awaitable<APIRole[]>;
20
+ abstract resolveGuildMember(guildId: string, userId: string): Awaitable<GuildMemberData | null>;
21
+ abstract resolveGuildChannels(guildId: string): Awaitable<AllAPIChannel[]>;
22
+ resolveGuildMemberRoles(member: Pick<GuildMemberData, 'roles'>, guildId: string): Promise<APIRole[]>;
23
+ resolveHighestGuildMemberRole(member: Pick<GuildMemberData, 'roles'>, guildId: string): Promise<APIRole>;
24
+ renderContext: {
25
+ selectMenu: {
26
+ users: {
27
+ data: UserSelectMenuOptionData[];
28
+ injectedScript: boolean;
29
+ } | null;
30
+ roles: {
31
+ data: RoleSelectMenuOptionData[];
32
+ injectedScript: boolean;
33
+ } | null;
34
+ channels: {
35
+ data: ChannelSelectMenuOptionData[];
36
+ injectedScript: boolean;
37
+ } | null;
38
+ };
39
+ profiles: Record<string, Profile>;
40
+ };
41
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TranscriptAdapter = void 0;
4
+ class TranscriptAdapter {
5
+ constructor(client) {
6
+ this.client = client;
7
+ this.renderContext = {
8
+ selectMenu: {
9
+ users: null,
10
+ roles: null,
11
+ channels: null,
12
+ },
13
+ profiles: {},
14
+ };
15
+ }
16
+ async resolveGuildMemberRoles(member, guildId) {
17
+ if (!member)
18
+ return [];
19
+ const guildRoles = await this.resolveGuildRoles(guildId);
20
+ if (!Array.isArray(guildRoles) || !guildRoles.length)
21
+ return [];
22
+ return guildRoles.filter((role) => member.roles.includes(role.id));
23
+ }
24
+ async resolveHighestGuildMemberRole(member, guildId) {
25
+ const roles = await this.resolveGuildMemberRoles(member, guildId);
26
+ return roles.sort((a, b) => b.position - a.position)[0];
27
+ }
28
+ }
29
+ exports.TranscriptAdapter = TranscriptAdapter;
30
+ //# sourceMappingURL=core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/adapters/core.ts"],"names":[],"mappings":";;;AAWA,MAAsB,iBAAiB;IACrC,YAAsB,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QA+BpC,kBAAa,GAAG;YACd,UAAU,EAAE;gBACV,KAAK,EAAwE,IAAI;gBACjF,KAAK,EAAwE,IAAI;gBACjF,QAAQ,EAA2E,IAAI;aACxF;YACD,QAAQ,EAA2B,EAAE;SACtC,CAAC;IAtCqC,CAAC;IAgBxC,KAAK,CAAC,uBAAuB,CAAC,MAAsC,EAAE,OAAe;QACnF,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAEvB,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAEzD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM;YAAE,OAAO,EAAE,CAAC;QAEhE,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,6BAA6B,CAAC,MAAsC,EAAE,OAAe;QACzF,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,uBAAuB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,CAAC;CAUF;AAxCD,8CAwCC"}
@@ -0,0 +1,26 @@
1
+ import { AttachmentBuilder } from 'discord.js';
2
+ import { TranscriptAdapter } from './core';
3
+ import type { GatewayGuildCreateDispatchData, Client, Channel } from 'discord.js';
4
+ import type { APIUser, APIRole, APIGuild, APIMessage } from 'discord-api-types/v10';
5
+ import type { AllAPIChannel, APIMessageData, GuildMemberData } from '../utils/channel';
6
+ import type { CreateTranscriptOptions, ExportReturnType } from '../types';
7
+ export declare class DiscordJSTranscriptAdapter extends TranscriptAdapter<Client> {
8
+ resolveChannel(id: string): Promise<AllAPIChannel | null>;
9
+ resolveUser(id: string): Promise<APIUser | null>;
10
+ resolveRole(guildId: string, id: string): Promise<APIRole | null>;
11
+ resolveGuild(id: string): Promise<APIGuild | GatewayGuildCreateDispatchData | null>;
12
+ resolveMessage(channelId: string, messageId: string): Promise<APIMessageData | null>;
13
+ listChannelMessages(channelId: string, options?: {
14
+ limit?: number;
15
+ before?: string;
16
+ }): Promise<APIMessage[]>;
17
+ createTranscriptAttachment(html: string, filename: string): AttachmentBuilder;
18
+ resolveGuildRoles(guildId: string): Promise<APIRole[]>;
19
+ resolveGuildMember(guildId: string, userId: string): Promise<GuildMemberData | null>;
20
+ resolveGuildChannels(guildId: string): Promise<AllAPIChannel[]>;
21
+ }
22
+ export declare class DiscordJSTranscript {
23
+ static create<T extends ExportReturnType = ExportReturnType.Attachment>(options: Omit<CreateTranscriptOptions<T, DiscordJSTranscriptAdapter>, 'adapter' | 'channel'> & {
24
+ channel: Channel;
25
+ }): Promise<import("..").ObjectType<T, DiscordJSTranscriptAdapter>>;
26
+ }
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DiscordJSTranscript = exports.DiscordJSTranscriptAdapter = void 0;
4
+ const discord_js_1 = require("discord.js");
5
+ const core_1 = require("./core");
6
+ const __1 = require("..");
7
+ const api_1 = require("../utils/api");
8
+ class DiscordJSTranscriptAdapter extends core_1.TranscriptAdapter {
9
+ async resolveChannel(id) {
10
+ const channel = await this.client.channels.fetch(id).catch(() => null);
11
+ if (!channel)
12
+ return null;
13
+ return api_1.apiUtils.channel(channel);
14
+ }
15
+ async resolveUser(id) {
16
+ const user = await this.client.users.fetch(id).catch(() => null);
17
+ if (!user)
18
+ return null;
19
+ return api_1.apiUtils.user(user);
20
+ }
21
+ async resolveRole(guildId, id) {
22
+ const guild = await this.client.guilds.fetch(guildId).catch(() => null);
23
+ if (!guild)
24
+ return null;
25
+ const role = await guild.roles.fetch(id).catch(() => null);
26
+ if (!role)
27
+ return null;
28
+ return api_1.apiUtils.role(role);
29
+ }
30
+ async resolveGuild(id) {
31
+ const guild = await this.client.guilds.fetch(id).catch(() => null);
32
+ if (!guild)
33
+ return null;
34
+ return api_1.apiUtils.guild(guild);
35
+ }
36
+ async resolveMessage(channelId, messageId) {
37
+ const channel = await this.client.channels.fetch(channelId).catch(() => null);
38
+ if (!channel?.isTextBased())
39
+ return null;
40
+ const message = await channel.messages.fetch(messageId).catch(() => null);
41
+ if (!message)
42
+ return null;
43
+ return api_1.apiUtils.message(message);
44
+ }
45
+ async listChannelMessages(channelId, options) {
46
+ const channel = await this.client.channels.fetch(channelId).catch(() => null);
47
+ if (!channel?.isTextBased())
48
+ return [];
49
+ const messages = await channel.messages.fetch(options).catch(() => null);
50
+ if (!messages)
51
+ return [];
52
+ return Promise.all(messages.map((message) => api_1.apiUtils.message(message)));
53
+ }
54
+ createTranscriptAttachment(html, filename) {
55
+ return new discord_js_1.AttachmentBuilder(Buffer.from(html)).setName(filename);
56
+ }
57
+ async resolveGuildRoles(guildId) {
58
+ const guild = await this.client.guilds.fetch(guildId).catch(() => null);
59
+ if (!guild)
60
+ return [];
61
+ const roles = await guild.roles.fetch().catch(() => null);
62
+ if (!roles)
63
+ return [];
64
+ return roles.map((role) => api_1.apiUtils.role(role));
65
+ }
66
+ async resolveGuildMember(guildId, userId) {
67
+ const guild = await this.client.guilds.fetch(guildId).catch(() => null);
68
+ if (!guild)
69
+ return null;
70
+ const member = await guild.members.fetch(userId).catch(() => null);
71
+ if (!member)
72
+ return null;
73
+ return api_1.apiUtils.member(member);
74
+ }
75
+ async resolveGuildChannels(guildId) {
76
+ const guild = await this.client.guilds.fetch(guildId).catch(() => null);
77
+ if (!guild)
78
+ return [];
79
+ const channels = await guild.channels.fetch().catch(() => null);
80
+ if (!channels)
81
+ return [];
82
+ return channels
83
+ .map((channel) => {
84
+ if (!channel)
85
+ return null;
86
+ return api_1.apiUtils.channel(channel);
87
+ })
88
+ .filter((channel) => channel !== null);
89
+ }
90
+ }
91
+ exports.DiscordJSTranscriptAdapter = DiscordJSTranscriptAdapter;
92
+ class DiscordJSTranscript {
93
+ static async create(options) {
94
+ return (0, __1.createTranscript)({
95
+ ...options,
96
+ adapter: new DiscordJSTranscriptAdapter(options.channel.client),
97
+ channel: api_1.apiUtils.channel(options.channel),
98
+ });
99
+ }
100
+ }
101
+ exports.DiscordJSTranscript = DiscordJSTranscript;
102
+ //# sourceMappingURL=discordjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discordjs.js","sourceRoot":"","sources":["../../src/adapters/discordjs.ts"],"names":[],"mappings":";;;AAAA,2CAA+C;AAC/C,iCAA2C;AAK3C,0BAAsC;AACtC,sCAAwC;AAExC,MAAa,0BAA2B,SAAQ,wBAAyB;IAC9D,KAAK,CAAC,cAAc,CAAC,EAAU;QACtC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACvE,IAAI,CAAC,OAAO;YAAE,OAAO,IAAI,CAAC;QAE1B,OAAO,cAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAEQ,KAAK,CAAC,WAAW,CAAC,EAAU;QACnC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAEvB,OAAO,cAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IAEQ,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,EAAU;QACpD,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,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B,MAAM,CAAC,KAAK,CAAC,MAAM,CACjB,OAEC;QAED,OAAO,IAAA,oBAAgB,EAAgC;YACrD,GAAG,OAAO;YACV,OAAO,EAAE,IAAI,0BAA0B,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC;YAC/D,OAAO,EAAE,cAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC;SAC3C,CAAC,CAAC;IACL,CAAC;CACF;AAZD,kDAYC"}
@@ -0,0 +1,26 @@
1
+ import type { APIGuild, APIRole, APIUser } from 'discord-api-types/v10';
2
+ import type { AllChannels, UsingClient } from 'seyfert';
3
+ import { AttachmentBuilder } from 'seyfert';
4
+ import type { AllAPIChannel, APIMessageData, GuildMemberData } from '../utils/channel';
5
+ import { TranscriptAdapter } from './core';
6
+ import type { CreateTranscriptOptions, ExportReturnType } from '../types';
7
+ export declare class SeyfertTranscriptAdapter extends TranscriptAdapter<UsingClient> {
8
+ resolveChannel(id: string): Promise<AllAPIChannel | null>;
9
+ resolveUser(id: string): Promise<APIUser | null>;
10
+ resolveRole(guildId: string, id: string): Promise<APIRole | null>;
11
+ resolveGuild(id: string): Promise<APIGuild | null>;
12
+ resolveMessage(channelId: string, messageId: string): Promise<APIMessageData | null>;
13
+ listChannelMessages(channelId: string, options: {
14
+ limit?: number;
15
+ before?: string;
16
+ }): Promise<APIMessageData[]>;
17
+ resolveGuildChannels(guildId: string): Promise<AllAPIChannel[]>;
18
+ createTranscriptAttachment(html: string, filename: string): AttachmentBuilder;
19
+ resolveGuildRoles(guildId: string): Promise<APIRole[]>;
20
+ resolveGuildMember(guildId: string, userId: string): Promise<GuildMemberData | null>;
21
+ }
22
+ export declare class SeyfertTranscript {
23
+ static create<T extends ExportReturnType = ExportReturnType.Attachment>(options: Omit<CreateTranscriptOptions<T, SeyfertTranscriptAdapter>, 'adapter' | 'channel'> & {
24
+ channel: AllChannels;
25
+ }): Promise<import("..").ObjectType<T, SeyfertTranscriptAdapter>>;
26
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SeyfertTranscript = exports.SeyfertTranscriptAdapter = void 0;
4
+ const seyfert_1 = require("seyfert");
5
+ const core_1 = require("./core");
6
+ const __1 = require("..");
7
+ class SeyfertTranscriptAdapter extends core_1.TranscriptAdapter {
8
+ resolveChannel(id) {
9
+ return this.client.channels.raw(id).catch(() => null);
10
+ }
11
+ resolveUser(id) {
12
+ return this.client.users.raw(id).catch(() => null);
13
+ }
14
+ resolveRole(guildId, id) {
15
+ return this.client.roles.raw(guildId, id).catch(() => null);
16
+ }
17
+ resolveGuild(id) {
18
+ return this.client.guilds.raw(id).catch(() => null);
19
+ }
20
+ async resolveMessage(channelId, messageId) {
21
+ const message = (await this.client.messages.raw(messageId, channelId).catch(() => null));
22
+ if (!message)
23
+ return null;
24
+ // why seyfert? WHY
25
+ message.author ?? (message.author = (await this.resolveUser(message.user_id)));
26
+ return message;
27
+ }
28
+ listChannelMessages(channelId, options) {
29
+ if (options && !options?.before)
30
+ delete options.before;
31
+ return this.client.messages
32
+ .list(channelId, options)
33
+ .then((messages) => Promise.all(messages.map((message) => this.client.messages.raw(message.id, message.channelId))))
34
+ .catch(() => []);
35
+ }
36
+ resolveGuildChannels(guildId) {
37
+ return this.client.guilds.channels
38
+ .list(guildId)
39
+ .then((channels) => Promise.all(channels.map((channel) => this.client.channels.raw(channel.id))))
40
+ .catch(() => []);
41
+ }
42
+ createTranscriptAttachment(html, filename) {
43
+ return new seyfert_1.AttachmentBuilder().setFile('buffer', Buffer.from(html)).setName(filename);
44
+ }
45
+ resolveGuildRoles(guildId) {
46
+ return this.client.roles
47
+ .list(guildId)
48
+ .then((roles) => Promise.all(roles.map((role) => this.client.roles.raw(role.guildId, role.id))))
49
+ .catch(() => []);
50
+ }
51
+ resolveGuildMember(guildId, userId) {
52
+ return this.client.members.raw(guildId, userId).catch(() => null);
53
+ }
54
+ }
55
+ exports.SeyfertTranscriptAdapter = SeyfertTranscriptAdapter;
56
+ class SeyfertTranscript {
57
+ static async create(options) {
58
+ const raw = await options.channel.client.channels.raw(options.channel.id);
59
+ return (0, __1.createTranscript)({
60
+ ...options,
61
+ adapter: new SeyfertTranscriptAdapter(options.channel.client),
62
+ channel: raw,
63
+ });
64
+ }
65
+ }
66
+ exports.SeyfertTranscript = SeyfertTranscript;
67
+ //# sourceMappingURL=seyfert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seyfert.js","sourceRoot":"","sources":["../../src/adapters/seyfert.ts"],"names":[],"mappings":";;;AAEA,qCAA4C;AAE5C,iCAA2C;AAE3C,0BAAsC;AAEtC,MAAa,wBAAyB,SAAQ,wBAA8B;IACjE,cAAc,CAAC,EAAU;QAChC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAkC,CAAC;IACzF,CAAC;IAEQ,WAAW,CAAC,EAAU;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAEQ,WAAW,CAAC,OAAe,EAAE,EAAU;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IAEQ,YAAY,CAAC,EAAU;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAA6B,CAAC;IAClF,CAAC;IAEQ,KAAK,CAAC,cAAc,CAAC,SAAiB,EAAE,SAAiB;QAChE,MAAM,OAAO,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,Q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