tate.b
DIAdiscord.js - Imagine an app
•Created by tate.b on 10/28/2024 in #djs-questions
I am getting this error when the snippet is right.
Hello! I am making a bot, very complex handling system which works perfectly, until now... I have made a command and yet it doesn't work, check the error and snippets below.
That is the command being initialized.
This is the code for the command, it is in the testing stage.
There was an error running this command: TypeError: interaction.options.getSubcommand is not a function.
There was an error running this command: TypeError: interaction.options.getSubcommand is not a function.
name: 'order',
description: '-',
options: [
{
name: 'start',
description: 'Begin the order process, this will notify your customer you are beginning.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'id',
description: 'The ID provided when you prepared the order. Lost it? Check your DMs, the ID will be provided there.',
type: ApplicationCommandOptionType.Number,
required: true,
}
]
},
{
name: 'prepare',
description: 'Prepare your order, add the price, includes the notes.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'customer',
description: 'Client of this order.',
type: ApplicationCommandOptionType.User,
required: true,
},
{
name: 'price',
description: 'The price of the order before tax.',
type: ApplicationCommandOptionType.Number,
required: true,
},
{
name: 'duration',
description: 'Estimated duration of the order. Use terms like: 1w for 1 week, 1d for 1 day, 1m for 1 month.',
type: ApplicationCommandOptionType.String,
required: true,
},
{
name: 'references',
description: 'You have the option to attach any references the designer added.',
type: ApplicationCommandOptionType.Attachment,
required: false,
},
{
name: 'notes',
description: 'Add any additional notes you may need here!',
type: ApplicationCommandOptionType.String,
required: false,
},
],
},
{
name: 'update',
description: 'Update your client on the order status.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'id',
description: 'The ID provided when you prepared the order. Lost it? Check your DMs, the ID will be provided there.',
type: ApplicationCommandOptionType.Number,
required: true,
},
{
name: 'status',
description: 'Select one of our status updates for your order.',
type: ApplicationCommandOptionType.String,
required: true,
choices: [
{
name: 'Preparing the Order',
value: 'order-prep'
},
{
name: 'Designing Product(s)',
value: 'designing-product'
},
{
name: 'Product(s) in QC',
value: 'qc-products'
},
],
},
],
},
{
name: 'complete',
description: 'Complete a current order, this will notify your client of completion.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'id',
description: 'The ID provided when you prepared the order. Lost it? Check your DMs, the ID will be provided there.',
type: ApplicationCommandOptionType.Number,
required: true
},
{
name: 'proof',
description: 'Purchase proof from the roblox store/other provider.',
type: ApplicationCommandOptionType.Attachment,
required: false,
},
],
},
],
name: 'order',
description: '-',
options: [
{
name: 'start',
description: 'Begin the order process, this will notify your customer you are beginning.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'id',
description: 'The ID provided when you prepared the order. Lost it? Check your DMs, the ID will be provided there.',
type: ApplicationCommandOptionType.Number,
required: true,
}
]
},
{
name: 'prepare',
description: 'Prepare your order, add the price, includes the notes.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'customer',
description: 'Client of this order.',
type: ApplicationCommandOptionType.User,
required: true,
},
{
name: 'price',
description: 'The price of the order before tax.',
type: ApplicationCommandOptionType.Number,
required: true,
},
{
name: 'duration',
description: 'Estimated duration of the order. Use terms like: 1w for 1 week, 1d for 1 day, 1m for 1 month.',
type: ApplicationCommandOptionType.String,
required: true,
},
{
name: 'references',
description: 'You have the option to attach any references the designer added.',
type: ApplicationCommandOptionType.Attachment,
required: false,
},
{
name: 'notes',
description: 'Add any additional notes you may need here!',
type: ApplicationCommandOptionType.String,
required: false,
},
],
},
{
name: 'update',
description: 'Update your client on the order status.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'id',
description: 'The ID provided when you prepared the order. Lost it? Check your DMs, the ID will be provided there.',
type: ApplicationCommandOptionType.Number,
required: true,
},
{
name: 'status',
description: 'Select one of our status updates for your order.',
type: ApplicationCommandOptionType.String,
required: true,
choices: [
{
name: 'Preparing the Order',
value: 'order-prep'
},
{
name: 'Designing Product(s)',
value: 'designing-product'
},
{
name: 'Product(s) in QC',
value: 'qc-products'
},
],
},
],
},
{
name: 'complete',
description: 'Complete a current order, this will notify your client of completion.',
type: ApplicationCommandOptionType.Subcommand,
options: [
{
name: 'id',
description: 'The ID provided when you prepared the order. Lost it? Check your DMs, the ID will be provided there.',
type: ApplicationCommandOptionType.Number,
required: true
},
{
name: 'proof',
description: 'Purchase proof from the roblox store/other provider.',
type: ApplicationCommandOptionType.Attachment,
required: false,
},
],
},
],
callback: async (interaction, client) => {
const subcommand = interaction.options.getSubcommand()
const member = interaction.member
const designerRole = ServerConfig && ServerConfig.orderRole
...
}
callback: async (interaction, client) => {
const subcommand = interaction.options.getSubcommand()
const member = interaction.member
const designerRole = ServerConfig && ServerConfig.orderRole
...
}
14 replies