v.dll
v.dll
DIAdiscord.js - Imagine an app
Created by v.dll on 1/30/2024 in #djs-questions
Slash command working but still replying with "The application did not respond"
the command works but before its sent it responds with "The application did not respond".
const { EmbedBuilder, PermissionsBitField } = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
const config = require("../config");
const axios = require('axios');
const key = config.key

// Guide: https://discordjs.guide/slash-commands/advanced-creation.html

module.exports = {
data: new SlashCommandBuilder()
.setName("test")
.setDescription("test"),

run: async (client, interaction) => {

axios
.get(`api link`)
.then((res) => {

const data = JSON.stringify(res.data);

const exampleEmbed = new EmbedBuilder()
.setColor(0xff0000)
.setTitle('test ')
.setDescription(data)

interaction.channel.send({ embeds: [exampleEmbed] });
})
}
};
const { EmbedBuilder, PermissionsBitField } = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
const config = require("../config");
const axios = require('axios');
const key = config.key

// Guide: https://discordjs.guide/slash-commands/advanced-creation.html

module.exports = {
data: new SlashCommandBuilder()
.setName("test")
.setDescription("test"),

run: async (client, interaction) => {

axios
.get(`api link`)
.then((res) => {

const data = JSON.stringify(res.data);

const exampleEmbed = new EmbedBuilder()
.setColor(0xff0000)
.setTitle('test ')
.setDescription(data)

interaction.channel.send({ embeds: [exampleEmbed] });
})
}
};
63 replies
DIAdiscord.js - Imagine an app
Created by v.dll on 1/30/2024 in #djs-questions
Hi i am currently trying to fetch json data from an api using slash commands but it keeps erroring
const { EmbedBuilder, PermissionsBitField } = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
const axios = require('axios');

// Guide: https://discordjs.guide/slash-commands/advanced-creation.html

module.exports = {
data: new SlashCommandBuilder()
.setName("test")
.setDescription("test"),

run: async (client, interaction) => {

axios
.get('')
.then((res) => {
console.log("RES:" , res.data)

const exampleEmbed = new EmbedBuilder()
.setColor(0xff0000)
.setTitle('test ')
.setDescription(res.data)

interaction.reply({ embeds: [exampleEmbed] });
})
}
};
const { EmbedBuilder, PermissionsBitField } = require("discord.js");
const { SlashCommandBuilder } = require("@discordjs/builders");
const axios = require('axios');

// Guide: https://discordjs.guide/slash-commands/advanced-creation.html

module.exports = {
data: new SlashCommandBuilder()
.setName("test")
.setDescription("test"),

run: async (client, interaction) => {

axios
.get('')
.then((res) => {
console.log("RES:" , res.data)

const exampleEmbed = new EmbedBuilder()
.setColor(0xff0000)
.setTitle('test ')
.setDescription(res.data)

interaction.reply({ embeds: [exampleEmbed] });
})
}
};
15 replies