transcriptify 1.0.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.
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/dist/src/generateHtml.d.ts +3 -0
- package/dist/src/generateHtml.js +303 -0
- package/dist/src/index.d.ts +5 -0
- package/dist/src/index.js +252 -0
- package/dist/src/transcript.d.ts +12 -0
- package/dist/src/transcript.js +179 -0
- package/dist/src/types/entities.d.ts +30 -0
- package/dist/src/types/entities.js +2 -0
- package/dist/src/utils/assetManager.d.ts +12 -0
- package/dist/src/utils/assetManager.js +295 -0
- package/dist/src/utils/authors.d.ts +4 -0
- package/dist/src/utils/authors.js +115 -0
- package/dist/src/utils/cache.d.ts +16 -0
- package/dist/src/utils/cache.js +29 -0
- package/dist/src/utils/extractors.d.ts +112 -0
- package/dist/src/utils/extractors.js +223 -0
- package/dist/src/utils/polls.d.ts +2 -0
- package/dist/src/utils/polls.js +91 -0
- package/dist/src/utils/transformer.d.ts +6 -0
- package/dist/src/utils/transformer.js +78 -0
- package/dist/src/utils/user.d.ts +4 -0
- package/dist/src/utils/user.js +56 -0
- package/dist/src/web/client.d.ts +20 -0
- package/dist/src/web/client.js +21 -0
- package/dist/src/web/discord-components/AudioPlayer.d.ts +5 -0
- package/dist/src/web/discord-components/AudioPlayer.js +231 -0
- package/dist/src/web/discord-components/Button.d.ts +3 -0
- package/dist/src/web/discord-components/Button.js +27 -0
- package/dist/src/web/discord-components/ChannelPinnedMessage.d.ts +7 -0
- package/dist/src/web/discord-components/ChannelPinnedMessage.js +11 -0
- package/dist/src/web/discord-components/DateSeperator.d.ts +3 -0
- package/dist/src/web/discord-components/DateSeperator.js +19 -0
- package/dist/src/web/discord-components/Embed.d.ts +2 -0
- package/dist/src/web/discord-components/Embed.js +78 -0
- package/dist/src/web/discord-components/ForwardedMessage.d.ts +2 -0
- package/dist/src/web/discord-components/ForwardedMessage.js +44 -0
- package/dist/src/web/discord-components/Message.d.ts +2 -0
- package/dist/src/web/discord-components/Message.js +543 -0
- package/dist/src/web/discord-components/PinnedMessagesModal.d.ts +6 -0
- package/dist/src/web/discord-components/PinnedMessagesModal.js +119 -0
- package/dist/src/web/discord-components/PinnedMessagesOverview.d.ts +5 -0
- package/dist/src/web/discord-components/PinnedMessagesOverview.js +22 -0
- package/dist/src/web/discord-components/Reply.d.ts +2 -0
- package/dist/src/web/discord-components/Reply.js +42 -0
- package/dist/src/web/discord-components/StickerPreview.d.ts +6 -0
- package/dist/src/web/discord-components/StickerPreview.js +40 -0
- package/dist/src/web/discord-components/ThemeSwitcher.d.ts +2 -0
- package/dist/src/web/discord-components/ThemeSwitcher.js +54 -0
- package/dist/src/web/discord-components/Transcript.d.ts +2 -0
- package/dist/src/web/discord-components/Transcript.js +174 -0
- package/dist/src/web/discord-components/UserJoinMessage.d.ts +3 -0
- package/dist/src/web/discord-components/UserJoinMessage.js +33 -0
- package/dist/src/web/discord-components/VideoPlayer.d.ts +6 -0
- package/dist/src/web/discord-components/VideoPlayer.js +222 -0
- package/dist/src/web/discord-components/icons/ChevronDownIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/ChevronDownIcon.js +7 -0
- package/dist/src/web/discord-components/icons/CloseIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/CloseIcon.js +7 -0
- package/dist/src/web/discord-components/icons/ExternalLinkIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/ExternalLinkIcon.js +7 -0
- package/dist/src/web/discord-components/icons/FileAudioIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/FileAudioIcon.js +7 -0
- package/dist/src/web/discord-components/icons/FileCodeIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/FileCodeIcon.js +7 -0
- package/dist/src/web/discord-components/icons/FileDocumentIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/FileDocumentIcon.js +7 -0
- package/dist/src/web/discord-components/icons/PinIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/PinIcon.js +7 -0
- package/dist/src/web/discord-components/icons/VerifiedIcon.d.ts +1 -0
- package/dist/src/web/discord-components/icons/VerifiedIcon.js +7 -0
- package/dist/src/web/discord-components/index.d.ts +11 -0
- package/dist/src/web/discord-components/index.js +24 -0
- package/dist/src/web/discord-components/messageHelpers.d.ts +8 -0
- package/dist/src/web/discord-components/messageHelpers.js +72 -0
- package/dist/src/web/discord-components/themeColors.d.ts +9 -0
- package/dist/src/web/discord-components/themeColors.js +320 -0
- package/dist/src/web/discord-components/transcriptHelpers.d.ts +19 -0
- package/dist/src/web/discord-components/transcriptHelpers.js +120 -0
- package/dist/src/web/discord-components/types.d.ts +1 -0
- package/dist/src/web/discord-components/types.js +2 -0
- package/dist/src/web/discord-components/utils/date.d.ts +3 -0
- package/dist/src/web/discord-components/utils/date.js +50 -0
- package/dist/src/web/discord-components/utils/markdown.d.ts +11 -0
- package/dist/src/web/discord-components/utils/markdown.js +538 -0
- package/dist/src/web/discord-components/utils/markdownUtils.d.ts +12 -0
- package/dist/src/web/discord-components/utils/markdownUtils.js +140 -0
- package/dist/src/web/helpers/avatarHelpers.d.ts +2 -0
- package/dist/src/web/helpers/avatarHelpers.js +15 -0
- package/dist/src/web/helpers/cdnHelpers.d.ts +5 -0
- package/dist/src/web/helpers/cdnHelpers.js +48 -0
- package/dist/src/web/helpers/contentHelpers.d.ts +9 -0
- package/dist/src/web/helpers/contentHelpers.js +41 -0
- package/dist/src/web/helpers/renderContent.d.ts +2 -0
- package/dist/src/web/helpers/renderContent.js +15 -0
- package/dist/src/web/helpers/scrollHelpers.d.ts +2 -0
- package/dist/src/web/helpers/scrollHelpers.js +31 -0
- package/dist/src/web/helpers/timestampHelpers.d.ts +6 -0
- package/dist/src/web/helpers/timestampHelpers.js +66 -0
- package/dist/src/web/hooks/useMessageContent.d.ts +5 -0
- package/dist/src/web/hooks/useMessageContent.js +37 -0
- package/dist/src/web/index.d.ts +1 -0
- package/dist/src/web/index.js +17 -0
- package/dist/src/web/types/attachment.d.ts +6 -0
- package/dist/src/web/types/attachment.js +2 -0
- package/dist/src/web/types/author.d.ts +14 -0
- package/dist/src/web/types/author.js +2 -0
- package/dist/src/web/types/channel.d.ts +8 -0
- package/dist/src/web/types/channel.js +2 -0
- package/dist/src/web/types/embed.d.ts +52 -0
- package/dist/src/web/types/embed.js +2 -0
- package/dist/src/web/types/interaction.d.ts +8 -0
- package/dist/src/web/types/interaction.js +2 -0
- package/dist/src/web/types/markdown.d.ts +5 -0
- package/dist/src/web/types/markdown.js +2 -0
- package/dist/src/web/types/message.d.ts +73 -0
- package/dist/src/web/types/message.js +2 -0
- package/dist/src/web/types/poll.d.ts +11 -0
- package/dist/src/web/types/poll.js +2 -0
- package/dist/src/web/types/props.d.ts +155 -0
- package/dist/src/web/types/props.js +2 -0
- package/dist/src/web/types/reaction.d.ts +6 -0
- package/dist/src/web/types/reaction.js +2 -0
- package/dist/src/web/types/theme.d.ts +14 -0
- package/dist/src/web/types/theme.js +2 -0
- package/dist/src/web/types/ui.d.ts +10 -0
- package/dist/src/web/types/ui.js +2 -0
- package/dist/types/download.d.ts +12 -0
- package/dist/types/download.js +2 -0
- package/dist/types/exportableTranscript.d.ts +169 -0
- package/dist/types/exportableTranscript.js +2 -0
- package/dist/types/general.d.ts +90 -0
- package/dist/types/general.js +2 -0
- package/package.json +46 -0
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import type { TranscriptThemes } from "./theme";
|
|
3
|
+
import type { MessageProps, ResolvedUsers, ResolvedRoles } from "./message";
|
|
4
|
+
import type { Author } from "./author";
|
|
5
|
+
import type { Reaction } from "./reaction";
|
|
6
|
+
import type { Poll } from "./poll";
|
|
7
|
+
import type { Attachment } from "./attachment";
|
|
8
|
+
import type { Interaction } from "./interaction";
|
|
9
|
+
import type { ChannelInfo } from "./channel";
|
|
10
|
+
export interface TranscriptProps {
|
|
11
|
+
channel?: ChannelInfo;
|
|
12
|
+
messages?: unknown[];
|
|
13
|
+
className?: string;
|
|
14
|
+
theme?: TranscriptThemes;
|
|
15
|
+
allowThemeSwitching?: boolean;
|
|
16
|
+
allowThemeSwitchingPersist?: boolean;
|
|
17
|
+
poweredBy?: boolean | string;
|
|
18
|
+
resolvedUsers?: Record<string, unknown>;
|
|
19
|
+
resolvedRoles?: Record<string, unknown>;
|
|
20
|
+
resolvedChannels?: Record<string, {
|
|
21
|
+
name?: string | null;
|
|
22
|
+
guildId?: string | null;
|
|
23
|
+
}>;
|
|
24
|
+
exportedAt?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ThemeSwitcherProps {
|
|
27
|
+
currentTheme: TranscriptThemes;
|
|
28
|
+
onThemeChange: (theme: TranscriptThemes) => void;
|
|
29
|
+
}
|
|
30
|
+
export interface ReplyProps {
|
|
31
|
+
replyTo: any;
|
|
32
|
+
onReplyClick: (ev: React.MouseEvent) => void;
|
|
33
|
+
defaultAvatar: string;
|
|
34
|
+
resolvedUsers?: Record<string, unknown>;
|
|
35
|
+
resolvedRoles?: Record<string, unknown>;
|
|
36
|
+
resolvedChannels?: Record<string, {
|
|
37
|
+
name?: string | null;
|
|
38
|
+
guildId?: string | null;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
export interface ForwardedMessageProps {
|
|
42
|
+
message: Partial<MessageProps>;
|
|
43
|
+
brokenImages: Set<string>;
|
|
44
|
+
onImageError: (url: string) => void;
|
|
45
|
+
renderContent: (content: unknown) => React.ReactNode;
|
|
46
|
+
defaultAvatar: string;
|
|
47
|
+
}
|
|
48
|
+
export interface PollEndMessageProps {
|
|
49
|
+
id: string;
|
|
50
|
+
author: Author;
|
|
51
|
+
embeds: unknown[];
|
|
52
|
+
replyTo?: unknown;
|
|
53
|
+
timeAgoDisplay: string;
|
|
54
|
+
}
|
|
55
|
+
export interface MessageStickersProps {
|
|
56
|
+
stickers: {
|
|
57
|
+
url: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
export interface MessageSelectsProps {
|
|
62
|
+
selects: unknown[];
|
|
63
|
+
}
|
|
64
|
+
export interface MessageReactionsProps {
|
|
65
|
+
reactions: Reaction[];
|
|
66
|
+
}
|
|
67
|
+
export interface MessagePollProps {
|
|
68
|
+
poll: Poll;
|
|
69
|
+
}
|
|
70
|
+
export interface MessageHeaderProps {
|
|
71
|
+
author: Author;
|
|
72
|
+
timestamp?: string;
|
|
73
|
+
editedAt?: string | null;
|
|
74
|
+
relativeTimestamp: string;
|
|
75
|
+
tagDate: string;
|
|
76
|
+
pinned?: boolean;
|
|
77
|
+
}
|
|
78
|
+
export interface MessageEmbedsProps {
|
|
79
|
+
embeds: unknown[];
|
|
80
|
+
resolvedUsers?: ResolvedUsers;
|
|
81
|
+
resolvedRoles?: ResolvedRoles;
|
|
82
|
+
resolvedChannels?: Record<string, {
|
|
83
|
+
name?: string | null;
|
|
84
|
+
guildId?: string | null;
|
|
85
|
+
}>;
|
|
86
|
+
channelGuildId?: string | null;
|
|
87
|
+
interaction?: Interaction;
|
|
88
|
+
}
|
|
89
|
+
export interface MessageContentProps {
|
|
90
|
+
content: React.ReactNode;
|
|
91
|
+
}
|
|
92
|
+
export interface MessageButtonsProps {
|
|
93
|
+
buttons: unknown[];
|
|
94
|
+
}
|
|
95
|
+
export interface MessageAvatarProps {
|
|
96
|
+
avatar: string;
|
|
97
|
+
bot?: boolean;
|
|
98
|
+
hasReply?: boolean;
|
|
99
|
+
hasInteraction?: boolean;
|
|
100
|
+
}
|
|
101
|
+
export interface MessageAttachmentsProps {
|
|
102
|
+
attachments: Attachment[];
|
|
103
|
+
brokenImages: Set<string>;
|
|
104
|
+
onImageError: (url: string) => void;
|
|
105
|
+
}
|
|
106
|
+
export interface CompactMessageContentProps {
|
|
107
|
+
timestamp?: string;
|
|
108
|
+
hover: boolean;
|
|
109
|
+
content: React.ReactNode;
|
|
110
|
+
}
|
|
111
|
+
export interface CommandLineProps {
|
|
112
|
+
interaction: Interaction;
|
|
113
|
+
resolvedUsers?: ResolvedUsers;
|
|
114
|
+
defaultAvatar: string;
|
|
115
|
+
}
|
|
116
|
+
export interface PollEndContent {
|
|
117
|
+
question?: string;
|
|
118
|
+
options?: Array<{
|
|
119
|
+
label?: string;
|
|
120
|
+
count?: number;
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
export interface UseMessageContentParams {
|
|
124
|
+
content: any;
|
|
125
|
+
attachments?: Attachment[];
|
|
126
|
+
embeds?: unknown[];
|
|
127
|
+
emojiUrls?: Record<string, string>;
|
|
128
|
+
resolvedUsers?: ResolvedUsers;
|
|
129
|
+
resolvedRoles?: ResolvedRoles;
|
|
130
|
+
resolvedChannels?: Record<string, {
|
|
131
|
+
name?: string | null;
|
|
132
|
+
guildId?: string | null;
|
|
133
|
+
}>;
|
|
134
|
+
channelGuildId?: string | null;
|
|
135
|
+
}
|
|
136
|
+
export interface TranscriptSSRProps {
|
|
137
|
+
channel: ChannelInfo;
|
|
138
|
+
messages: any[];
|
|
139
|
+
theme: TranscriptThemes;
|
|
140
|
+
allowThemeSwitching: boolean;
|
|
141
|
+
allowThemeSwitchingPersist: boolean;
|
|
142
|
+
poweredBy: boolean | string;
|
|
143
|
+
className?: string;
|
|
144
|
+
resolvedUsers?: Record<string, unknown>;
|
|
145
|
+
resolvedRoles?: Record<string, unknown>;
|
|
146
|
+
resolvedChannels?: Record<string, {
|
|
147
|
+
name?: string | null;
|
|
148
|
+
guildId?: string | null;
|
|
149
|
+
}>;
|
|
150
|
+
exportedAt?: string;
|
|
151
|
+
}
|
|
152
|
+
export interface TranscriptCdnConfig {
|
|
153
|
+
cdnBase?: string;
|
|
154
|
+
mediaBase?: string;
|
|
155
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type TranscriptThemes = "light" | "ash" | "dark" | "onyx" | "system" | "mint_apple" | "citrus_sherbert" | "retro_raincloud" | "hanami" | "sunrise" | "cotton_candy" | "lofi_vibes" | "desert_khaki" | "sunset" | "chroma_glow" | "forest" | "crimson_moon" | "midnight_blurple" | "mars" | "dusk" | "under_the_sea" | "retro_storm" | "neon_nights" | "strawberry_lemonade" | "aurora" | "sepia" | "blurple_twilight";
|
|
2
|
+
export interface ThemeColors {
|
|
3
|
+
bg: string;
|
|
4
|
+
text: string;
|
|
5
|
+
header: string;
|
|
6
|
+
border: string;
|
|
7
|
+
subtext: string;
|
|
8
|
+
accent: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ThemePreview {
|
|
11
|
+
primary: string;
|
|
12
|
+
secondary?: string;
|
|
13
|
+
gradient?: boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
export type ButtonVariant = "primary" | "secondary" | "success" | "danger" | "link";
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
label: string;
|
|
5
|
+
url?: string;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
emoji?: string;
|
|
9
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { APIAttachment, APIMessage, Awaitable } from "discord.js";
|
|
2
|
+
import type { WebpOptions } from "sharp";
|
|
3
|
+
export type ResolveImageCallback = (attachment: APIAttachment, message: APIMessage) => Awaitable<string | null | undefined>;
|
|
4
|
+
export type ImageCompression = {
|
|
5
|
+
quality: number;
|
|
6
|
+
convertToWebP?: boolean;
|
|
7
|
+
options?: Omit<WebpOptions, "quality" | "force">;
|
|
8
|
+
};
|
|
9
|
+
export type DownloaderOptions = {
|
|
10
|
+
maxFileSizeKB?: number;
|
|
11
|
+
compression?: ImageCompression;
|
|
12
|
+
};
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
export type SerializableAuthor = {
|
|
2
|
+
id: string;
|
|
3
|
+
username: string;
|
|
4
|
+
tag?: string;
|
|
5
|
+
guildTag?: {
|
|
6
|
+
name?: string | null;
|
|
7
|
+
iconUrl?: string | null;
|
|
8
|
+
} | null;
|
|
9
|
+
nickname?: string | null;
|
|
10
|
+
avatar?: string | null;
|
|
11
|
+
bot?: boolean;
|
|
12
|
+
color?: string | null;
|
|
13
|
+
verified?: boolean | null;
|
|
14
|
+
};
|
|
15
|
+
export type SerializableAttachment = {
|
|
16
|
+
id: string;
|
|
17
|
+
filename: string;
|
|
18
|
+
url: string;
|
|
19
|
+
proxyURL?: string | null;
|
|
20
|
+
contentType?: string | null;
|
|
21
|
+
size?: number;
|
|
22
|
+
width?: number | null;
|
|
23
|
+
height?: number | null;
|
|
24
|
+
};
|
|
25
|
+
export type SerializableEmbedField = {
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
inline?: boolean;
|
|
29
|
+
};
|
|
30
|
+
export type SerializableEmbed = {
|
|
31
|
+
title?: string | null;
|
|
32
|
+
description?: string | null;
|
|
33
|
+
url?: string | null;
|
|
34
|
+
timestamp?: string | null;
|
|
35
|
+
color?: string | null;
|
|
36
|
+
footer?: {
|
|
37
|
+
text?: string | null;
|
|
38
|
+
iconUrl?: string | null;
|
|
39
|
+
} | null;
|
|
40
|
+
image?: {
|
|
41
|
+
url?: string | null;
|
|
42
|
+
} | null;
|
|
43
|
+
thumbnail?: {
|
|
44
|
+
url?: string | null;
|
|
45
|
+
} | null;
|
|
46
|
+
author?: {
|
|
47
|
+
name?: string | null;
|
|
48
|
+
url?: string | null;
|
|
49
|
+
iconUrl?: string | null;
|
|
50
|
+
} | null;
|
|
51
|
+
fields?: SerializableEmbedField[];
|
|
52
|
+
};
|
|
53
|
+
export type SerializableButton = {
|
|
54
|
+
type?: number;
|
|
55
|
+
customId?: string | null;
|
|
56
|
+
label?: string | null;
|
|
57
|
+
style?: number | null;
|
|
58
|
+
emoji?: {
|
|
59
|
+
id?: string | null;
|
|
60
|
+
name?: string | null;
|
|
61
|
+
} | null;
|
|
62
|
+
url?: string | null;
|
|
63
|
+
disabled?: boolean | null;
|
|
64
|
+
};
|
|
65
|
+
export type SerializableSelect = {
|
|
66
|
+
customId?: string | null;
|
|
67
|
+
placeholder?: string | null;
|
|
68
|
+
minValues?: number | null;
|
|
69
|
+
maxValues?: number | null;
|
|
70
|
+
options?: {
|
|
71
|
+
label: string;
|
|
72
|
+
value: string;
|
|
73
|
+
description?: string | null;
|
|
74
|
+
default?: boolean;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
export type SerializableComponent = {
|
|
78
|
+
type: number;
|
|
79
|
+
components?: (SerializableButton | SerializableSelect | any)[];
|
|
80
|
+
};
|
|
81
|
+
export type SerializableSticker = {
|
|
82
|
+
id: string;
|
|
83
|
+
name?: string | null;
|
|
84
|
+
tags?: string | null;
|
|
85
|
+
format?: string | null;
|
|
86
|
+
};
|
|
87
|
+
export type SerializableReaction = {
|
|
88
|
+
emoji: {
|
|
89
|
+
id?: string | null;
|
|
90
|
+
name?: string | null;
|
|
91
|
+
animated?: boolean | null;
|
|
92
|
+
};
|
|
93
|
+
count: number;
|
|
94
|
+
me?: boolean | null;
|
|
95
|
+
};
|
|
96
|
+
export type SerializablePollOption = {
|
|
97
|
+
id?: string | null;
|
|
98
|
+
label?: string | null;
|
|
99
|
+
count?: number | null;
|
|
100
|
+
voters?: string[] | null;
|
|
101
|
+
};
|
|
102
|
+
export type SerializablePoll = {
|
|
103
|
+
type: "reactions" | "buttons" | "selects" | "embed" | "native";
|
|
104
|
+
question?: string | null;
|
|
105
|
+
options: SerializablePollOption[];
|
|
106
|
+
totalVotes?: number | null;
|
|
107
|
+
endsAt?: string | null;
|
|
108
|
+
};
|
|
109
|
+
export type SerializableInteraction = {
|
|
110
|
+
id?: string | null;
|
|
111
|
+
type?: number | null;
|
|
112
|
+
name?: string | null;
|
|
113
|
+
user?: {
|
|
114
|
+
id: string;
|
|
115
|
+
username: string;
|
|
116
|
+
} | null;
|
|
117
|
+
};
|
|
118
|
+
export type SerializableMessage = {
|
|
119
|
+
id: string;
|
|
120
|
+
content: string;
|
|
121
|
+
author: string | null;
|
|
122
|
+
createdAt: string;
|
|
123
|
+
messageType?: string | number;
|
|
124
|
+
embeds?: SerializableEmbed[];
|
|
125
|
+
actionRows?: SerializableComponent[];
|
|
126
|
+
buttons?: SerializableButton[];
|
|
127
|
+
selects?: SerializableSelect[];
|
|
128
|
+
stickers?: SerializableSticker[];
|
|
129
|
+
reactions?: SerializableReaction[];
|
|
130
|
+
editedAt?: string | null;
|
|
131
|
+
attachments: SerializableAttachment[];
|
|
132
|
+
pinned: boolean;
|
|
133
|
+
interaction?: SerializableInteraction | null;
|
|
134
|
+
referencedMessageId?: string | null;
|
|
135
|
+
poll?: SerializablePoll | null;
|
|
136
|
+
forwarded?: {
|
|
137
|
+
fromMessageId?: string | null;
|
|
138
|
+
fromChannelId?: string | null;
|
|
139
|
+
fromGuildId?: string | null;
|
|
140
|
+
original?: {
|
|
141
|
+
id?: string;
|
|
142
|
+
content?: string;
|
|
143
|
+
author?: string | null;
|
|
144
|
+
createdAt?: string | null;
|
|
145
|
+
embeds?: SerializableEmbed[];
|
|
146
|
+
attachments?: SerializableAttachment[];
|
|
147
|
+
stickers?: SerializableSticker[];
|
|
148
|
+
} | null;
|
|
149
|
+
} | null;
|
|
150
|
+
};
|
|
151
|
+
export type ExportableTranscript = {
|
|
152
|
+
meta: {
|
|
153
|
+
channelId: string;
|
|
154
|
+
channelName?: string | null;
|
|
155
|
+
guildId?: string | null;
|
|
156
|
+
generatedAt: string;
|
|
157
|
+
messageCount: number;
|
|
158
|
+
};
|
|
159
|
+
messages: SerializableMessage[];
|
|
160
|
+
resolvedUsers?: Record<string, Omit<SerializableAuthor, "id">>;
|
|
161
|
+
resolvedRoles?: Record<string, {
|
|
162
|
+
name: string;
|
|
163
|
+
color: string | null;
|
|
164
|
+
}>;
|
|
165
|
+
resolvedChannels?: Record<string, {
|
|
166
|
+
name?: string | null;
|
|
167
|
+
guildId?: string | null;
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export type TranscriptThemes = "light" | "ash" | "dark" | "onyx" | "system" | "mint_apple" | "citrus_sherbert" | "retro_raincloud" | "hanami" | "sunrise" | "cotton_candy" | "lofi_vibes" | "desert_khaki" | "sunset" | "chroma_glow" | "forest" | "crimson" | "midnight_blurple" | "mars" | "dusk" | "under_the_sea" | "retro_storm" | "neon_nights" | "strawberry_lemonade" | "aurora" | "sepia";
|
|
2
|
+
export type TranscriptCreateOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* @description The maximum number of messages to include in the transcript. Set to undefined to include all messages.
|
|
5
|
+
* @default undefined
|
|
6
|
+
*/
|
|
7
|
+
limit?: number;
|
|
8
|
+
/**
|
|
9
|
+
* @description Download all attachments and store locally in an assets directory (default "assets").
|
|
10
|
+
* @default false
|
|
11
|
+
*/
|
|
12
|
+
saveAssets?: boolean | {
|
|
13
|
+
/**
|
|
14
|
+
* @description Optional image compression level (1-100). Requires external image processing library.
|
|
15
|
+
* Vanilla Node.js does not support image compression/conversion.
|
|
16
|
+
* @default undefined (no compression)
|
|
17
|
+
*/
|
|
18
|
+
compression?: number;
|
|
19
|
+
/**
|
|
20
|
+
* @description Optional assets output directory.
|
|
21
|
+
* @default "assets"
|
|
22
|
+
*/
|
|
23
|
+
dir?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* @description The Filename of the generated transcript
|
|
27
|
+
* @default "transcript-{channelID}-{timestamp}.html"
|
|
28
|
+
*/
|
|
29
|
+
filename?: string;
|
|
30
|
+
/**
|
|
31
|
+
* @description The 'PoweredBy dcTranscriptify' text at the bottom of the transcript
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
poweredBy?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* @description Allow users to switch the theme of the transcript
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
allowThemeSwitching?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* @description Default theme of the transcript
|
|
42
|
+
* @default dark/light based on system preference
|
|
43
|
+
*/
|
|
44
|
+
theme?: TranscriptThemes;
|
|
45
|
+
/**
|
|
46
|
+
* @description Ignore options for the transcript generation
|
|
47
|
+
*/
|
|
48
|
+
ignore?: {
|
|
49
|
+
/**
|
|
50
|
+
* @description Ignore messages from bot accounts when generating the transcript
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
bots?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @description Array of user IDs to ignore when generating the transcript. Only strings are allowed.
|
|
56
|
+
* @default []
|
|
57
|
+
*/
|
|
58
|
+
userIDs?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* @description Attachment ignore options
|
|
61
|
+
*/
|
|
62
|
+
attachments?: {
|
|
63
|
+
/**
|
|
64
|
+
* @description Ignore image attachments (png, jpg, gif, etc.)
|
|
65
|
+
* @default false
|
|
66
|
+
*/
|
|
67
|
+
images?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* @description Ignore video attachments (mp4, mov, etc.)
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
videos?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* @description Ignore audio attachments (mp3, wav, etc.)
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
audio?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* @description Ignore other file attachments (pdf, zip, etc.)
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
files?: boolean;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* @description Ignore guild badges
|
|
86
|
+
* @default false
|
|
87
|
+
*/
|
|
88
|
+
guildBadges?: boolean;
|
|
89
|
+
};
|
|
90
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "transcriptify",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Generate beautiful, secure HTML transcripts from Discord channels.",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"private": false,
|
|
8
|
+
"files": ["dist"],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc --outDir dist --declaration --module commonjs",
|
|
11
|
+
"prepare": "npm run build",
|
|
12
|
+
"format": "npx @biomejs/biome format --write"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"discord.js": "^14.25.1",
|
|
16
|
+
"dotenv": "^17.2.3",
|
|
17
|
+
"react": "^18.3.1",
|
|
18
|
+
"react-dom": "^18.3.1",
|
|
19
|
+
"sharp": "^0.34.5"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^20.0.0",
|
|
23
|
+
"@types/react": "^18.2.21",
|
|
24
|
+
"@types/react-dom": "^18.2.7",
|
|
25
|
+
"@vitejs/plugin-react": "^4.0.0",
|
|
26
|
+
"autoprefixer": "^10.4.23",
|
|
27
|
+
"esbuild": "^0.27.2",
|
|
28
|
+
"highlight.js": "^11.11.1",
|
|
29
|
+
"postcss": "^8.5.6",
|
|
30
|
+
"tailwindcss": "^3.4.19",
|
|
31
|
+
"typescript": "^5.0.0",
|
|
32
|
+
"vite": "^5.0.0"
|
|
33
|
+
},
|
|
34
|
+
"keywords": ["discord.js", "discord.js-transcripts", "html-transcripts", "ticket-transcripts"],
|
|
35
|
+
"author": "the_unknown_dud3 & anditv21",
|
|
36
|
+
"license": "MIT",
|
|
37
|
+
"type": "commonjs",
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/dev-hoehle/transcriptify.git"
|
|
41
|
+
},
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/dev-hoehle/transcriptify/issues"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/dev-hoehle/transcriptify#readme"
|
|
46
|
+
}
|