Skip to content

Commit 0f776c5

Browse files
authored
Merge pull request #33 from softwarexplus/fix
Remove outdated documentation from command-file-setup.mdx
2 parents 3786264 + 0914d52 commit 0f776c5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

apps/docs/pages/docs/command-file-setup.mdx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ Here's an example `content` command which replies with the content of the target
8383
<Tabs items={['CommonJS', 'ESM', 'TypeScript']}>
8484
<Tabs.Tab>
8585
```js filename="commands/misc/content.js" copy
86-
const { CommandType } = require('commandkit');
87-
86+
const { ApplicationCommandType } = require("discord.js");
87+
8888
module.exports = {
8989
data: {
9090
name: 'content',
91-
type: CommandType.Message,
91+
type: ApplicationCommandType.Message,
9292
},
9393

9494
run: ({ interaction, client, handler }) => {
@@ -107,15 +107,15 @@ Here's an example `content` command which replies with the content of the target
107107
</Tabs.Tab>
108108
<Tabs.Tab>
109109
```js filename="commands/misc/content.js" copy
110-
import { CommandType } from 'commandkit';
110+
import { ApplicationCommandType } from "discord.js";
111111

112112
export const data = {
113113
name: 'content',
114-
type: CommandType.Message,
114+
type: ApplicationCommandType.Message,
115115
}
116116

117117
export function run({ interaction, client, handler }) {
118-
interaction.reply(`The message is: ${interaction.targetMessage}`);
118+
interaction.reply(`The message is: ${interaction.targetMessage.content}`);
119119
}
120120

121121
export const options = {
@@ -129,15 +129,16 @@ Here's an example `content` command which replies with the content of the target
129129
</Tabs.Tab>
130130
<Tabs.Tab>
131131
```ts filename="commands/misc/content.ts" copy
132-
import { CommandType, type CommandData, type ContextMenuCommandProps, type CommandOptions } from 'commandkit';
132+
import { type CommandData, type ContextMenuCommandProps, type CommandOptions } from "commandkit";
133+
import { ApplicationCommandType } from "discord.js";
133134

134135
export const data: CommandData = {
135136
name: 'content',
136-
type: CommandType.Message,
137+
type: ApplicationCommandType.Message,
137138
}
138139

139140
export function run({ interaction, client, handler }: ContextMenuCommandProps) {
140-
interaction.reply(`The message is: ${interaction.targetMessage}`);
141+
interaction.reply(`The message is: ${interaction.targetMessage.content}`);
141142
}
142143

143144
export const options: CommandOptions = {

0 commit comments

Comments
 (0)