Keep saying The application did not respond

Help
7 Replies
d.js toolkit
d.js toolkit6mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Mussaplays
MussaplaysOP6mo ago
const { SlashCommandBuilder, EmbedBuilder } = require('@discordjs/builders');
const orderSchema = require('../../Schemas/orderlog');

module.exports = {
dzn: true,
data: new SlashCommandBuilder()
.setName('order-log')
.setDescription('Log an order')
.addUserOption(option =>
option.setName('customer')
.setDescription('Select the customer')
.setRequired(true))
.addStringOption(option =>
option.setName('price')
.setDescription('Enter the price of the order')
.setRequired(true))
.addStringOption(option =>
option.setName('product')
.setDescription('Enter the product ordered')
.setRequired(true)),
async execute(interaction) {
const customer = interaction.options.getUser('customer');
const price = parseFloat(interaction.options.getString('price'));
const product = interaction.options.getString('product');

const orderLog = new orderSchema({
customer: customer.id,
price: price,
product: product,

});

try {
await orderLog.save();

const embed = new EmbedBuilder()
.setAuthor({ name: `Order log by ${interaction.user.username}`, iconURL: interaction.user.displayAvatarURL() })
.setColor(0x2B2D31)
.setTitle('New Order Logged')
.addFields(
{ name: ':Ed_arrowright: Customer', value: customer.toString(), inline: true },
{ name: ':Ed_arrowright: Price', value: price.toString(), inline: true },
{ name: ':Ed_arrowright: Product', value: product, inline: true }
)
.setTimestamp();

const channelId = '1217193438441639989';
const channel = interaction.guild.channels.cache.get(channelId);
const sentMessage1 = await channel.send({ embeds: [embed] });
interaction.reply({ content: ':ED_checkmark: Order logged successfully!', ephemeral: true });

} catch (error) {
console.error( 'Failed to log order:', error)

await interaction.reply({ content: 'Failed to log order.', ephemeral: true });
}
}
};
const { SlashCommandBuilder, EmbedBuilder } = require('@discordjs/builders');
const orderSchema = require('../../Schemas/orderlog');

module.exports = {
dzn: true,
data: new SlashCommandBuilder()
.setName('order-log')
.setDescription('Log an order')
.addUserOption(option =>
option.setName('customer')
.setDescription('Select the customer')
.setRequired(true))
.addStringOption(option =>
option.setName('price')
.setDescription('Enter the price of the order')
.setRequired(true))
.addStringOption(option =>
option.setName('product')
.setDescription('Enter the product ordered')
.setRequired(true)),
async execute(interaction) {
const customer = interaction.options.getUser('customer');
const price = parseFloat(interaction.options.getString('price'));
const product = interaction.options.getString('product');

const orderLog = new orderSchema({
customer: customer.id,
price: price,
product: product,

});

try {
await orderLog.save();

const embed = new EmbedBuilder()
.setAuthor({ name: `Order log by ${interaction.user.username}`, iconURL: interaction.user.displayAvatarURL() })
.setColor(0x2B2D31)
.setTitle('New Order Logged')
.addFields(
{ name: ':Ed_arrowright: Customer', value: customer.toString(), inline: true },
{ name: ':Ed_arrowright: Price', value: price.toString(), inline: true },
{ name: ':Ed_arrowright: Product', value: product, inline: true }
)
.setTimestamp();

const channelId = '1217193438441639989';
const channel = interaction.guild.channels.cache.get(channelId);
const sentMessage1 = await channel.send({ embeds: [embed] });
interaction.reply({ content: ':ED_checkmark: Order logged successfully!', ephemeral: true });

} catch (error) {
console.error( 'Failed to log order:', error)

await interaction.reply({ content: 'Failed to log order.', ephemeral: true });
}
}
};
I try everthing keep saying same thing i reset token i do everthing
TheOtherMaurice
TheOtherMaurice6mo ago
I'm noticing that the interaction.reply({ content: ... }) is never awaited, try it calling it like:
await interaction.reply({ content: '<:ED_checkmark:1221299182166347857\> Order logged successfully!', ephemeral: true });
await interaction.reply({ content: '<:ED_checkmark:1221299182166347857\> Order logged successfully!', ephemeral: true });
Mussaplays
MussaplaysOP6mo ago
same error :monkaStop:
TÆMBØ
TÆMBØ6mo ago
Including checking if the code is actually executing?
Mussaplays
MussaplaysOP6mo ago
it is
TÆMBØ
TÆMBØ6mo ago
How have you verified that? And have you tried deferring beforehand, given that you're making a DB request above where you reply as well as send a message?
Want results from more Discord servers?
Add your server