File tree Expand file tree Collapse file tree 9 files changed +83
-28
lines changed
packages/create-jellycommands/src Expand file tree Collapse file tree 9 files changed +83
-28
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' create-jellycommands ' : minor
3
+ ---
4
+
5
+ update templates to have buttons
Original file line number Diff line number Diff line change
1
+ import { button } from 'jellycommands' ;
2
+
3
+ export default button ( {
4
+ id : 'hello' ,
5
+
6
+ async run ( { interaction } ) {
7
+ interaction . reply ( {
8
+ content : 'Hello from a button!' ,
9
+ } ) ;
10
+ } ,
11
+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { ActionRowBuilder , ButtonBuilder , ButtonStyle } from 'discord.js' ;
2
+ import { command } from 'jellycommands' ;
3
+
4
+ export default command ( {
5
+ name : 'test' ,
6
+ description : 'Testing that the bot works fine' ,
7
+
8
+ global : true ,
9
+
10
+ run : ( { interaction } ) => {
11
+ const row = new ActionRowBuilder ( ) ;
12
+
13
+ const button = new ButtonBuilder ( )
14
+ . setCustomId ( 'hello' )
15
+ . setLabel ( 'Click me!' )
16
+ . setStyle ( ButtonStyle . Primary ) ;
17
+
18
+ row . addComponents ( button ) ;
19
+
20
+ interaction . reply ( {
21
+ content : 'Hello, world!' ,
22
+ components : [ row ] ,
23
+ } ) ;
24
+ } ,
25
+ } ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ const client = new JellyCommands({
9
9
// https://jellycommands.dev/guide/events/loading
10
10
events : 'src/events' ,
11
11
12
+ // https://jellycommands.dev/guide/buttons/loading
13
+ buttons : 'src/buttons' ,
14
+
12
15
clientOptions : {
13
16
intents : [ IntentsBitField . Flags . Guilds ] ,
14
17
} ,
Original file line number Diff line number Diff line change
1
+ import { button } from 'jellycommands' ;
2
+
3
+ export default button ( {
4
+ id : 'hello' ,
5
+
6
+ async run ( { interaction } ) {
7
+ interaction . reply ( {
8
+ content : 'Hello from a button!' ,
9
+ } ) ;
10
+ } ,
11
+ } ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { ActionRowBuilder , ButtonBuilder , ButtonStyle } from 'discord.js' ;
2
+ import { command } from 'jellycommands' ;
3
+
4
+ export default command ( {
5
+ name : 'test' ,
6
+ description : 'Testing that the bot works fine' ,
7
+
8
+ global : true ,
9
+
10
+ run : ( { interaction } ) => {
11
+ const row = new ActionRowBuilder < ButtonBuilder > ( ) ;
12
+
13
+ const button = new ButtonBuilder ( )
14
+ . setCustomId ( 'hello' )
15
+ . setLabel ( 'Click me!' )
16
+ . setStyle ( ButtonStyle . Primary ) ;
17
+
18
+ row . addComponents ( button ) ;
19
+
20
+ interaction . reply ( {
21
+ content : 'Hello, world!' ,
22
+ components : [ row ] ,
23
+ } ) ;
24
+ } ,
25
+ } ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ const client = new JellyCommands({
9
9
// https://jellycommands.dev/guide/events/loading
10
10
events : 'src/events' ,
11
11
12
+ // https://jellycommands.dev/guide/buttons/loading
13
+ buttons : 'src/buttons' ,
14
+
12
15
clientOptions : {
13
16
intents : [ IntentsBitField . Flags . Guilds ] ,
14
17
} ,
You can’t perform that action at this time.
0 commit comments