discord-message-transcript-base 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.
@@ -0,0 +1,698 @@
1
+ body {
2
+ background-color: #3a3c43;
3
+ color: #dbdee1;
4
+ font-family: "Whitney", "Helvetica Neue", Helvetica, Arial, sans-serif;
5
+ margin: 0;
6
+ padding: 0;
7
+ width: 100%;
8
+ }
9
+ header {
10
+ height: fit-content;
11
+ border-bottom: 2px solid black;
12
+ margin-top: 2rem;
13
+ padding-left: 2rem;
14
+ padding-bottom: 1rem;
15
+ display: flex;
16
+ flex-direction: column;
17
+ display: flex;
18
+ flex-direction: row;
19
+ }
20
+ a {
21
+ text-decoration: none;
22
+ color: #1E90FF;
23
+ }
24
+ p {
25
+ margin: 0;
26
+ }
27
+ h1 {
28
+ margin: 0.5rem 0;
29
+ }
30
+ h2 {
31
+ margin: 0.3rem 0;
32
+ }
33
+ h3 {
34
+ margin: 0.15rem
35
+ }
36
+ h4 {
37
+ margin: 0;
38
+ }
39
+ code {
40
+ border: 1px solid #202225;
41
+ border-radius: 0.25rem;
42
+ }
43
+ blockquote {
44
+ margin: 0.5rem 0;
45
+ border-left: 0.25rem solid #4f545c;
46
+ padding: 0.4rem 0.6rem;
47
+ border-radius: 0.25rem;
48
+ color: #9f9fa6;
49
+ }
50
+ .line {
51
+ display: flex;
52
+ align-items: baseline;
53
+ gap: 0.5rem
54
+ }
55
+ .badge {
56
+ background-color: #5865f2;
57
+ color: white;
58
+ font-weight: 600;
59
+ font-size: 80%;
60
+ padding: 0.1rem 0.35rem;
61
+ border-radius: 0.25rem;
62
+ letter-spacing: 0.03rem;
63
+ height: fit-content;
64
+ width: fit-content;
65
+ align-self: flex-start;
66
+ }
67
+ .badgeTag {
68
+ background-color: #747F8D50;
69
+ color: white;
70
+ font-weight: 600;
71
+ font-size: 70%;
72
+ padding: 0.1rem 0.35rem;
73
+ border-radius: 0.25rem;
74
+ letter-spacing: 0.03rem;
75
+ height: fit-content;
76
+ width: fit-content;
77
+ align-self: center;
78
+ }
79
+ .mention {
80
+ background-color: #5664fa41;
81
+ padding: 0.2rem;
82
+ border-radius: 0.25rem;
83
+ transition: background-color 0.2s ease;
84
+ }
85
+ .mention:hover {
86
+ background-color: #5664fa7e;
87
+ }
88
+ .guildInitialsIcon {
89
+ width: 7rem;
90
+ height: 7rem;
91
+ border-radius: 50%;
92
+ background-color: #4f545c;
93
+ display: flex;
94
+ align-items: center;
95
+ justify-content: center;
96
+ font-size: 3rem;
97
+ font-weight: 600;
98
+ }
99
+ .messageDiv {
100
+ display: flex;
101
+ flex-direction: column;
102
+ gap: 0.2rem;
103
+ padding: 0.5rem;
104
+ border-radius: 1rem;
105
+ }
106
+ .messageDiv.highlight, .messageDiv:hover {
107
+ background-color: #40434b;
108
+ transition: background-color 0.3s ease-in-out;
109
+ }
110
+ .messageBotton {
111
+ display: flex;
112
+ flex-direction: row;
113
+ gap: 1rem;
114
+ padding: 0.5rem;
115
+ border-radius: 0.25rem;
116
+ }
117
+ .messageImg {
118
+ width: 3.5rem;
119
+ height: 3.5rem;
120
+ border-radius: 50%;
121
+ }
122
+ .messageDivRight {
123
+ display: flex;
124
+ flex-direction: column;
125
+ gap: 0.25rem
126
+ }
127
+ .messageUser {
128
+ display: flex;
129
+ flex-direction: row;
130
+ gap: 0.75rem;
131
+ }
132
+ .messageUsername {
133
+ margin: 0;
134
+ }
135
+ .messageTimeStamp {
136
+ color: #999999;
137
+ font-size: 77.5%;
138
+ align-self: center;
139
+ }
140
+ .messageContent {
141
+ line-height: 1.5;
142
+ }
143
+ .pList {
144
+ white-space: pre-wrap;
145
+ }
146
+ .subtext {
147
+ font-size: 85%;
148
+ color: #808080;
149
+ }
150
+ .spoilerMsg {
151
+ display: inline-block;
152
+ background-color: #202225;
153
+ color: #202225;
154
+ padding: 0 0.2rem;
155
+ border-radius: 0.2rem;
156
+ cursor: pointer;
157
+ transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out;
158
+ }
159
+ .spoilerMsg.revealed {
160
+ background-color: transparent;
161
+ color: inherit;
162
+ }
163
+ .messageReply {
164
+ display: flex;
165
+ align-items: center;
166
+ gap: 0.5rem;
167
+ font-size: 0.8rem;
168
+ color: #b5bac1;
169
+ cursor: pointer;
170
+ margin-left: 2rem;
171
+ }
172
+ .messageReplySvg {
173
+ flex-shrink: 0;
174
+ width: 2.25rem;
175
+ height: 2.25rem;
176
+ color: #b5bac1;
177
+ }
178
+ .messageReplyImg {
179
+ width: 1.75rem;
180
+ height: 1.75rem;
181
+ border-radius: 50%;
182
+ flex-shrink: 0;
183
+ }
184
+ .messageReplyAuthor {
185
+ font-weight: 600;
186
+ color: #dbdee1;
187
+ margin-right: 0.3rem;
188
+ }
189
+ .badgeReply {
190
+ background-color: #5865f2;
191
+ color: white;
192
+ font-weight: 600;
193
+ font-size: 70%;
194
+ padding: 0.1rem 0.3rem;
195
+ border-radius: 0.25rem;
196
+ letter-spacing: 0.03rem;
197
+ height: fit-content;
198
+ align-self: center;
199
+ flex-shrink: 0;
200
+ }
201
+ .messageReplyText {
202
+ flex-grow: 1;
203
+ white-space: nowrap;
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ color: #b5bac1;
207
+ font-size: 0.75rem;
208
+ }
209
+ .embed {
210
+ background-color: #2b2d31;
211
+ border: 0.15rem solid #2b2d31;
212
+ border-left: 0.25rem solid;
213
+ border-radius: 0.25rem;
214
+ padding: 0.5rem 0.75rem;
215
+ margin-top: 0.5rem;
216
+ display: flex;
217
+ flex-direction: column;
218
+ gap: 0.5rem;
219
+ max-width: 40rem;
220
+ min-width: 30rem;
221
+ }
222
+ .embed a {
223
+ color: #00aff4;
224
+ text-decoration: none;
225
+ }
226
+ .embed a:hover {
227
+ text-decoration: underline;
228
+ }
229
+ .embedHeader {
230
+ display: flex;
231
+ justify-content: space-between;
232
+ align-items: flex-start;
233
+ gap: 0.5rem;
234
+ }
235
+ .embedHeaderLeft {
236
+ display: flex;
237
+ flex-direction: column;
238
+ gap: 0.25rem;
239
+ }
240
+ .embedHeaderLeftAuthor {
241
+ display: flex;
242
+ align-items: center;
243
+ gap: 0.5rem;
244
+ font-size: 0.875rem;
245
+ font-weight: 500;
246
+ color: #ffffff;
247
+ margin-bottom: 0.5rem;
248
+ }
249
+ .embedHeaderLeftAuthorImg {
250
+ width: 1.5rem;
251
+ height: 1.5rem;
252
+ border-radius: 50%;
253
+ }
254
+ .embedHeaderLeftAuthorName {
255
+ color: #ffffff;
256
+ font-weight: 500;
257
+ }
258
+ .embedHeaderLeftTitle {
259
+ font-size: 1rem;
260
+ font-weight: bold;
261
+ color: #ffffff;
262
+ margin-bottom: 0.75rem;
263
+ }
264
+ .embedHeaderThumbnail {
265
+ max-width: 80px;
266
+ max-height: 80px;
267
+ object-fit: contain;
268
+ border-radius: 0.25rem;
269
+ flex-shrink: 0;
270
+ }
271
+ .embedDescription {
272
+ font-size: 0.875rem;
273
+ color: #dcddde;
274
+ }
275
+ .embedFields {
276
+ display: flex;
277
+ flex-wrap: wrap;
278
+ gap: 0.5rem;
279
+ }
280
+ .embedFieldsField {
281
+ flex: 1;
282
+ min-width: 150px;
283
+ }
284
+ .embedFieldsFieldTitle {
285
+ font-size: 0.75rem;
286
+ font-weight: bold;
287
+ color: #ffffff;
288
+ margin-bottom: 0.25rem;
289
+ }
290
+ .embedFieldsFieldValue {
291
+ font-size: 0.875rem;
292
+ color: #dcddde;
293
+ }
294
+ .embedImage {
295
+ margin-top: 0.5rem;
296
+ max-width: 100%;
297
+ height: auto;
298
+ }
299
+ .embedImage img {
300
+ max-width: 100%;
301
+ max-height: 300px;
302
+ object-fit: contain;
303
+ border-radius: 0.25rem;
304
+ }
305
+ .embedFooter {
306
+ display: flex;
307
+ align-items: center;
308
+ gap: 0.5rem;
309
+ font-size: 0.75rem;
310
+ color: #999999;
311
+ margin-top: 0.5rem;
312
+ }
313
+ .embedFooterImg {
314
+ width: 1.25rem;
315
+ height: 1.25rem;
316
+ border-radius: 50%;
317
+ }
318
+ .embedFooterText {
319
+ color: #999999;
320
+ }
321
+ .attachmentImage, .attachmentVideo {
322
+ max-width: 400px;
323
+ height: auto;
324
+ border-radius: 0.25rem;
325
+ margin-top: 0.5rem;
326
+ }
327
+ .attachmentAudio {
328
+ width: 300px;
329
+ margin-top: 0.5rem;
330
+ }
331
+ .attachmentFile {
332
+ background-color: #2b2d31;
333
+ border: 1px solid #202225;
334
+ border-radius: 0.75rem;
335
+ padding: 0.75rem;
336
+ display: flex;
337
+ align-items: center;
338
+ gap: 0.75rem;
339
+ max-width: 400px;
340
+ margin-top: 0.5rem;
341
+ width: fit-content;
342
+ }
343
+ .attachmentFileIcon {
344
+ width: 2.5rem;
345
+ height: 2.5rem;
346
+ fill: #b9bbbe;
347
+ flex-shrink: 0;
348
+ }
349
+ .attachmentFileInfo {
350
+ display: flex;
351
+ flex-direction: column;
352
+ gap: 0.1rem;
353
+ overflow: hidden;
354
+ flex-grow: 1;
355
+ }
356
+ .attachmentFileName {
357
+ color: #ffffff;
358
+ text-decoration: none;
359
+ white-space: nowrap;
360
+ overflow: hidden;
361
+ text-overflow: ellipsis;
362
+ }
363
+ .attachmentFileSize {
364
+ font-size: 0.75rem;
365
+ color: #72767d;
366
+ }
367
+ .attachmentDownload {
368
+ display: block;
369
+ flex-shrink: 0;
370
+ }
371
+ .attachmentDownloadIcon {
372
+ width: 1.5rem;
373
+ height: 1.5rem;
374
+ fill: #b9bbbe;
375
+ transition: fill 0.2s ease;
376
+ }
377
+ .attachmentDownload:hover .attachmentDownloadIcon {
378
+ fill: #ffffff;
379
+ }
380
+ .spoilerAttachment {
381
+ position: relative;
382
+ display: inline-block;
383
+ border-radius: 0.5rem;
384
+ overflow: hidden;
385
+ cursor: pointer;
386
+ }
387
+ .spoilerAttachment .spoilerAttachmentContent {
388
+ filter: blur(64px);
389
+ pointer-events: none;
390
+ transition: filter 0.2s ease;
391
+ width: 100%;
392
+ height: 100%;
393
+ }
394
+ .spoilerAttachment .spoilerAttachmentOverlay {
395
+ position: absolute;
396
+ inset: 0;
397
+ background: rgba(32, 34, 37, 0.85);
398
+ color: #fff;
399
+ font-weight: 600;
400
+ letter-spacing: 0.05em;
401
+ display: flex;
402
+ align-items: center;
403
+ justify-content: center;
404
+ z-index: 2;
405
+ user-select: none;
406
+ }
407
+ .spoilerAttachment.revealed .spoilerAttachmentContent {
408
+ filter: none;
409
+ pointer-events: auto;
410
+ }
411
+ .spoilerAttachment.revealed .spoilerAttachmentOverlay {
412
+ display: none;
413
+ }
414
+ .actionRow {
415
+ display: flex;
416
+ gap: 0.5rem;
417
+ margin-top: 0.5rem;
418
+ }
419
+ .button {
420
+ display: flex;
421
+ align-items: center;
422
+ gap: 0.5rem;
423
+ padding: 0rem 0.8rem;
424
+ height: 2.5rem;
425
+ border-radius: 0.6rem;
426
+ color: white;
427
+ font-weight: 600;
428
+ cursor: pointer;
429
+ transition: filter 0.2s ease;
430
+ }
431
+ .button:hover {
432
+ filter: brightness(1.1);
433
+ }
434
+ .buttonEmoji {
435
+ font-size: 1.25rem;
436
+ }
437
+ .buttonLabel {
438
+ font-size: 0.875rem;
439
+ }
440
+ .buttonLink {
441
+ display: flex;
442
+ align-items: center;
443
+ gap: 0.5rem;
444
+ color: white;
445
+ font-weight: 600;
446
+ }
447
+ .buttonLinkIcon {
448
+ width: 1.25rem;
449
+ height: 1.25rem;
450
+ }
451
+ .selector {
452
+ width: 100%;
453
+ position: relative;
454
+ }
455
+ .selectorInput {
456
+ background-color: #2b2d31;
457
+ border: 1px solid #202225;
458
+ border-radius: 0.75rem;
459
+ padding: 0.75rem;
460
+ min-width: 17.5rem;
461
+ cursor: pointer;
462
+ user-select: none;
463
+ }
464
+ .selectorInputText {
465
+ color: #808080;
466
+ }
467
+ .selectorOptionMenu {
468
+ display: none;
469
+ position: absolute;
470
+ top: 100%;
471
+ left: 0;
472
+ width: 100%;
473
+ background-color: #2b2d31;
474
+ border: 1px solid #202225;
475
+ border-radius: 1rem;
476
+ margin-top: 0.25rem;
477
+ padding: 0.5rem;
478
+ z-index: 10;
479
+ box-sizing: border-box;
480
+ }
481
+ .selector.active .selectorOptionMenu {
482
+ display: block;
483
+ }
484
+ .selectorOption {
485
+ display: flex;
486
+ align-items: center;
487
+ gap: 0.5rem;
488
+ padding: 0.75rem;
489
+ border-radius: 0.75rem;
490
+ cursor: pointer;
491
+ transition: background-color 0.2s ease;
492
+ }
493
+ .selectorOption:hover {
494
+ background-color: #4f545c;
495
+ }
496
+ .selectorOptionEmoji {
497
+ font-size: 1.25rem;
498
+ }
499
+ .selectorOptionRight {
500
+ display: flex;
501
+ flex-direction: column;
502
+ }
503
+ .selectorOptionTitle {
504
+ font-weight: 500;
505
+ }
506
+ .selectorOptionDesc {
507
+ font-size: 0.75rem;
508
+ color: #808080;
509
+ }
510
+ .mediaGallery {
511
+ display: flex;
512
+ flex-wrap: wrap;
513
+ gap: 0.25rem;
514
+ width: 100%;
515
+ max-width: 40rem;
516
+ aspect-ratio: 1 / 1;
517
+ padding: 0.35rem;
518
+ overflow: hidden;
519
+ }
520
+ .mediaGalleryItem {
521
+ flex-grow: 1;
522
+ flex-basis: 0;
523
+ min-width: 30%;
524
+ display: flex;
525
+ }
526
+ .mediaGalleryImg {
527
+ width: 100%;
528
+ height: 100%;
529
+ object-fit: cover;
530
+ display: block;
531
+ border-radius: 1rem;
532
+ }
533
+ .container {
534
+ background-color: #2b2d31;
535
+ border-radius: 0.5rem;
536
+ padding: 1rem;
537
+ max-width: 40rem;
538
+ min-width: 30rem;
539
+ border-left: 0.25rem solid;
540
+ }
541
+ .section {
542
+ display: flex;
543
+ flex-direction: row;
544
+ justify-content: space-between;
545
+ padding: 0.5rem 0;
546
+ }
547
+ .sectionRight {
548
+ margin-right: 0.5rem;
549
+ margin-left: 1rem;
550
+ }
551
+ .sectionThumbnail {
552
+ width: 5rem;
553
+ height: 5rem;
554
+ border-radius: 0.5rem;
555
+ }
556
+ .textDisplay {
557
+ padding: 0.5rem 0;
558
+ }
559
+ .separator {
560
+ border: 1px solid #808080;
561
+ }
562
+ .pollDiv {
563
+ background-color: #2b2d31;
564
+ border-radius: 0.5rem;
565
+ padding: 1rem;
566
+ margin-top: 0.5rem;
567
+ max-width: 40rem;
568
+ min-width: 25rem
569
+ }
570
+ .pollQuestion {
571
+ font-size: 1.1rem;
572
+ font-weight: bold;
573
+ margin-bottom: 1rem;
574
+ display: flex;
575
+ align-items: center;
576
+ gap: 0.5rem;
577
+ }
578
+ .pollAnswers {
579
+ display: flex;
580
+ flex-direction: column;
581
+ gap: 0.5rem;
582
+ }
583
+ .pollAnswer {
584
+ background-color: #3a3c42;
585
+ border-radius: 0.3rem;
586
+ padding: 0.75rem;
587
+ cursor: pointer;
588
+ border: 1px solid transparent;
589
+ transition: border-color 0.2s ease;
590
+ position: relative;
591
+ overflow: hidden;
592
+ }
593
+ .pollAnswer:hover {
594
+ border-color: #4d515a;
595
+ }
596
+ .pollAnswerBar {
597
+ position: absolute;
598
+ top: 0;
599
+ left: 0;
600
+ height: 100%;
601
+ background-color: #5664fa7a;
602
+ border-radius: 0.2rem;
603
+ z-index: 1;
604
+ }
605
+ .pollAnswerContent {
606
+ position: relative;
607
+ z-index: 2;
608
+ display: flex;
609
+ align-items: center;
610
+ justify-content: space-between;
611
+ }
612
+ .pollAnswerDetails {
613
+ display: flex;
614
+ align-items: center;
615
+ gap: 0.5rem;
616
+ }
617
+ .pollAnswerEmoji {
618
+ font-size: 1.25rem;
619
+ }
620
+ .pollAnswerText {
621
+ font-weight: 500;
622
+ }
623
+ .pollAnswerVotes {
624
+ font-size: 0.8rem;
625
+ color: #b5bac1;
626
+ font-weight: bold;
627
+ }
628
+ .pollFooter {
629
+ margin-top: 1rem;
630
+ font-size: 0.75rem;
631
+ color: #949ba4;
632
+ }
633
+ .pollResultEmbed {
634
+ background-color: #2b2d31;
635
+ border-radius: 0.5rem;
636
+ padding: 1rem;
637
+ margin-top: 0.5rem;
638
+ border: 1px solid #3a3c42;
639
+ min-width: 20rem;
640
+ max-width: 40rem;
641
+ display: flex;
642
+ flex-direction: row;
643
+ justify-content: space-between;
644
+ }
645
+ .pollResultEmbedWinner {
646
+ display: flex;
647
+ align-items: center;
648
+ gap: 0.5rem;
649
+ font-size: 1rem;
650
+ font-weight: 600;
651
+ margin-bottom: 0.4rem;
652
+ }
653
+ .pollResultEmbedCheckmark {
654
+ color: #57f287;
655
+ font-size: 1.1em;
656
+ }
657
+ .pollResultEmbedSubtitle {
658
+ font-size: 0.9rem;
659
+ color: #b5bac1;
660
+ }
661
+ .pollResultEmbedButtonDiv {
662
+ margin-right: 0.5rem;
663
+ margin-left: 1rem;
664
+ align-self: center;
665
+ }
666
+ .pollResultEmbedButton {
667
+ background-color: black;
668
+ color: white;
669
+ padding: 0.5rem 1rem;
670
+ border-radius: 0.3rem;
671
+ text-decoration: none;
672
+ font-weight: 500;
673
+ transition: background-color 0.2s ease;
674
+ cursor: pointer;
675
+ }
676
+ .pollResultEmbedButton:hover {
677
+ filter: brightness(1.1);
678
+ }
679
+ .reactionsDiv {
680
+ display: flex;
681
+ flex-wrap: wrap;
682
+ gap: 0.5rem;
683
+ margin-top: 0.5rem;
684
+ }
685
+ .reaction {
686
+ align-items: center;
687
+ background-color: #2b2d31;
688
+ border: 1px solid #3a3c42;
689
+ border-radius: 1rem;
690
+ padding: 0.25rem 0.6rem;
691
+ font-size: 1rem;
692
+ color: #dcddde;
693
+ font-weight: bold;
694
+ cursor: pointer;
695
+ }
696
+ .reaction:hover {
697
+ filter: brightness(1.1);
698
+ }
@@ -0,0 +1,3 @@
1
+ export declare class CustomError extends Error {
2
+ constructor(message: string);
3
+ }
@@ -0,0 +1,7 @@
1
+ export class CustomError extends Error {
2
+ constructor(message) {
3
+ super(`[discord-message-transcript] ${message}`);
4
+ this.name = 'DiscordMessageTranscriptError';
5
+ Object.setPrototypeOf(this, CustomError.prototype);
6
+ }
7
+ }
@@ -0,0 +1,2 @@
1
+ import { ReturnType, ReturnTypeBase } from "../types/types.js";
2
+ export declare function returnTypeMapper(type: ReturnType): ReturnTypeBase;
@@ -0,0 +1,16 @@
1
+ import { ReturnType, ReturnTypeBase } from "../types/types.js";
2
+ import { CustomError } from "./error.js";
3
+ export function returnTypeMapper(type) {
4
+ switch (type) {
5
+ case ReturnType.Buffer:
6
+ return ReturnTypeBase.Buffer;
7
+ case ReturnType.Stream:
8
+ return ReturnTypeBase.Stream;
9
+ case ReturnType.String:
10
+ return ReturnTypeBase.String;
11
+ case ReturnType.Uploadable:
12
+ return ReturnTypeBase.Uploadable;
13
+ default:
14
+ throw new CustomError(`Can't convert ReturnType.Attachment to ReturnTypeBase!`);
15
+ }
16
+ }
@@ -0,0 +1,2 @@
1
+ import { ArrayMentions } from "../types/types.js";
2
+ export declare function markdownToHTML(text: string, mentions: ArrayMentions, everyone: boolean, dateFormat: Intl.DateTimeFormat): string;