Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions apps/docs/pages/docs/command-file-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ Here's an example `content` command which replies with the content of the target
<Tabs items={['CommonJS', 'ESM', 'TypeScript']}>
<Tabs.Tab>
```js filename="commands/misc/content.js" copy
const { CommandType } = require('commandkit');
const { ApplicationCommandType } = require("discord.js");

module.exports = {
data: {
name: 'content',
type: CommandType.Message,
type: ApplicationCommandType.Message,
},

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

export const data = {
name: 'content',
type: CommandType.Message,
type: ApplicationCommandType.Message,
}

export function run({ interaction, client, handler }) {
interaction.reply(`The message is: ${interaction.targetMessage}`);
interaction.reply(`The message is: ${interaction.targetMessage.content}`);
}

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

export const data: CommandData = {
name: 'content',
type: CommandType.Message,
type: ApplicationCommandType.Message,
}

export function run({ interaction, client, handler }: ContextMenuCommandProps) {
interaction.reply(`The message is: ${interaction.targetMessage}`);
interaction.reply(`The message is: ${interaction.targetMessage.content}`);
}

export const options: CommandOptions = {
Expand Down