File tree 3 files changed +26
-5
lines changed
apps/test-bot/src/app/commands/(general)
packages/commandkit/src/components/v2
3 files changed +26
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import CommandKit, {
12
12
Section ,
13
13
Separator ,
14
14
TextDisplay ,
15
+ Thumbnail ,
15
16
} from 'commandkit' ;
16
17
import {
17
18
AttachmentBuilder ,
@@ -53,12 +54,16 @@ export const chatInput: ChatInputCommand = async (ctx) => {
53
54
< TextDisplay content = "# CommandKit Components v2 test" />
54
55
< Section >
55
56
< TextDisplay content = "This is a section" />
57
+ < Thumbnail url = "https://cdn.discordapp.com/embed/avatars/0.png" />
58
+ </ Section >
59
+ < Separator spacing = { SeparatorSpacingSize . Large } />
60
+ < Section >
61
+ < TextDisplay content = "This is after separator" />
56
62
< Button url = "https://commandkit.dev" style = { ButtonStyle . Link } >
57
63
Website
58
64
</ Button >
59
65
</ Section >
60
- < Separator spacing = { SeparatorSpacingSize . Large } />
61
- < TextDisplay content = "This is after separator" />
66
+ < Separator spacing = { SeparatorSpacingSize . Large } dividier />
62
67
< File url = "attachment://components-v2-are-awesome.md" />
63
68
< Separator spacing = { SeparatorSpacingSize . Large } dividier />
64
69
< TextDisplay content = "Discord's default avatars" />
Original file line number Diff line number Diff line change 8
8
SectionBuilder ,
9
9
SeparatorBuilder ,
10
10
TextDisplayBuilder ,
11
+ ThumbnailBuilder ,
11
12
} from 'discord.js' ;
12
13
import { applyId } from './common' ;
13
14
Original file line number Diff line number Diff line change 1
- // import { TextDisplayBuilder, TextDisplayComponentData } from 'discord.js';
2
-
3
1
import {
4
2
ButtonBuilder ,
5
- ComponentBuilder ,
6
3
SectionBuilder ,
7
4
TextDisplayBuilder ,
8
5
ThumbnailBuilder ,
@@ -33,3 +30,21 @@ export function Section(props: SectionProps): SectionBuilder {
33
30
34
31
return section ;
35
32
}
33
+
34
+ export interface ThumbnailProps {
35
+ id ?: number ;
36
+ description ?: string ;
37
+ spoiler ?: boolean ;
38
+ url : string ;
39
+ }
40
+
41
+ export function Thumbnail ( props : ThumbnailProps ) {
42
+ const thumbnail = new ThumbnailBuilder ( {
43
+ description : props . description ,
44
+ spoiler : props . spoiler ,
45
+ id : props . id ,
46
+ media : { url : props . url } ,
47
+ } ) ;
48
+
49
+ return thumbnail ;
50
+ }
You can’t perform that action at this time.
0 commit comments