@@ -11,9 +11,7 @@ emojis.
1111``` tsx title="src/app/commands/button-example.tsx"
1212import { type ChatInputCommand , ActionRow , Button } from ' commandkit' ;
1313
14- export const chatInput: ChatInputCommand = async ({
15- interaction ,
16- }) => {
14+ export const chatInput: ChatInputCommand = async ({ interaction }) => {
1715 const buttonRow = (
1816 <ActionRow >
1917 <Button customId = " clickme-button" >Click me!</Button >
@@ -36,9 +34,7 @@ Discord provides several button styles that you can import from the
3634import { type ChatInputCommand , ActionRow , Button } from ' commandkit' ;
3735import { ButtonStyle } from ' discord.js' ;
3836
39- export const chatInput: ChatInputCommand = async ({
40- interaction ,
41- }) => {
37+ export const chatInput: ChatInputCommand = async ({ interaction }) => {
4238 const buttons = (
4339 <ActionRow >
4440 <Button style = { ButtonStyle .Primary } customId = " primary" >
@@ -71,9 +67,7 @@ Link buttons redirect users to external URLs:
7167import { type ChatInputCommand , ActionRow , Button } from ' commandkit' ;
7268import { ButtonStyle } from ' discord.js' ;
7369
74- export const chatInput: ChatInputCommand = async ({
75- interaction ,
76- }) => {
70+ export const chatInput: ChatInputCommand = async ({ interaction }) => {
7771 const linkButton = (
7872 <ActionRow >
7973 <Button style = { ButtonStyle .Link } url = " https://discord.com" >
@@ -96,9 +90,7 @@ Add emojis to make your buttons more visually appealing:
9690``` tsx title="src/app/commands/emoji-button.tsx"
9791import { type ChatInputCommand , ActionRow , Button } from ' commandkit' ;
9892
99- export const chatInput: ChatInputCommand = async ({
100- interaction ,
101- }) => {
93+ export const chatInput: ChatInputCommand = async ({ interaction }) => {
10294 const emojiButton = (
10395 <ActionRow >
10496 <Button emoji = " 🎮" customId = " play-game" >
@@ -124,9 +116,7 @@ Disable buttons to prevent interaction:
124116``` tsx title="src/app/commands/disabled-button.tsx"
125117import { type ChatInputCommand , ActionRow , Button } from ' commandkit' ;
126118
127- export const chatInput: ChatInputCommand = async ({
128- interaction ,
129- }) => {
119+ export const chatInput: ChatInputCommand = async ({ interaction }) => {
130120 const disabledButton = (
131121 <ActionRow >
132122 <Button disabled customId = " disabled" >
@@ -156,10 +146,7 @@ import {
156146} from ' commandkit' ;
157147import { MessageFlags } from ' discord.js' ;
158148
159- const handleClick: OnButtonKitClick = async (
160- interaction ,
161- context ,
162- ) => {
149+ const handleClick: OnButtonKitClick = async (interaction , context ) => {
163150 await interaction .reply ({
164151 content: ' Button clicked!' ,
165152 flags: MessageFlags .Ephemeral ,
@@ -169,9 +156,7 @@ const handleClick: OnButtonKitClick = async (
169156 context .dispose ();
170157};
171158
172- export const chatInput: ChatInputCommand = async ({
173- interaction ,
174- }) => {
159+ export const chatInput: ChatInputCommand = async ({ interaction }) => {
175160 const interactiveButton = (
176161 <ActionRow >
177162 <Button onClick = { handleClick } customId = " clickme-button" >
0 commit comments