File tree Expand file tree Collapse file tree
apps/test-bot/src/app/commands/(general)
packages/commandkit/src/components/v2 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import CommandKit, {
1212 Section ,
1313 Separator ,
1414 TextDisplay ,
15+ Thumbnail ,
1516} from 'commandkit' ;
1617import {
1718 AttachmentBuilder ,
@@ -53,12 +54,16 @@ export const chatInput: ChatInputCommand = async (ctx) => {
5354 < TextDisplay content = "# CommandKit Components v2 test" />
5455 < Section >
5556 < 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" />
5662 < Button url = "https://commandkit.dev" style = { ButtonStyle . Link } >
5763 Website
5864 </ Button >
5965 </ Section >
60- < Separator spacing = { SeparatorSpacingSize . Large } />
61- < TextDisplay content = "This is after separator" />
66+ < Separator spacing = { SeparatorSpacingSize . Large } dividier />
6267 < File url = "attachment://components-v2-are-awesome.md" />
6368 < Separator spacing = { SeparatorSpacingSize . Large } dividier />
6469 < TextDisplay content = "Discord's default avatars" />
Original file line number Diff line number Diff line change 88 SectionBuilder ,
99 SeparatorBuilder ,
1010 TextDisplayBuilder ,
11+ ThumbnailBuilder ,
1112} from 'discord.js' ;
1213import { applyId } from './common' ;
1314
Original file line number Diff line number Diff line change 1- // import { TextDisplayBuilder, TextDisplayComponentData } from 'discord.js';
2-
31import {
42 ButtonBuilder ,
5- ComponentBuilder ,
63 SectionBuilder ,
74 TextDisplayBuilder ,
85 ThumbnailBuilder ,
@@ -33,3 +30,21 @@ export function Section(props: SectionProps): SectionBuilder {
3330
3431 return section ;
3532}
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