Chord
Chord
DIAdiscord.js - Imagine an app
Created by Chord on 7/30/2023 in #djs-voice
Error
Thank you and have a good day 🙂
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/30/2023 in #djs-voice
Error
Oh it was running on the discloud. Sorry for taking up your time..
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/30/2023 in #djs-voice
Error
Ok I will try
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/30/2023 in #djs-voice
Error
no I'm only running it in the VS code and here is my full error message :
Error executing 핑
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\stone\Desktop\Ina_2.0\node_modules\@discordjs\rest\dist\index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\stone\Desktop\Ina_2.0\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\stone\Desktop\Ina_2.0\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\stone\Desktop\Ina_2.0\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:69:5)
at async Object.execute (C:\Users\stone\Desktop\Ina_2.0\commands\function\ping.js:8:5)
at async Object.execute (C:\Users\stone\Desktop\Ina_2.0\events\interactionCreate.js:16:4) {
requestBody: { files: undefined, json: { type: 5, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1135242832404299807/aW50ZXJhY3Rpb246MTEzNTI0MjgzMjQwNDI5OTgwNzpZS1ZzSTFvRkZxUGF5THNoWjFhY1kxUGJHdEV5YXNXams3UHFCcFJ1MVNXc0dEZmZOTWIzVVo1NlBEcW1jYlBBRGFZZ0lCT2thZWtNWWpkbFByMjFZNldCTHZoOE53TlFhelpvMWdLdGdXa2FWOTdYVElyZ1piVjVRUWlERFlRNQ/callback'
}
Error executing 핑
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (C:\Users\stone\Desktop\Ina_2.0\node_modules\@discordjs\rest\dist\index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (C:\Users\stone\Desktop\Ina_2.0\node_modules\@discordjs\rest\dist\index.js:736:23)
at async REST.request (C:\Users\stone\Desktop\Ina_2.0\node_modules\@discordjs\rest\dist\index.js:1387:22)
at async ChatInputCommandInteraction.deferReply (C:\Users\stone\Desktop\Ina_2.0\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:69:5)
at async Object.execute (C:\Users\stone\Desktop\Ina_2.0\commands\function\ping.js:8:5)
at async Object.execute (C:\Users\stone\Desktop\Ina_2.0\events\interactionCreate.js:16:4) {
requestBody: { files: undefined, json: { type: 5, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1135242832404299807/aW50ZXJhY3Rpb246MTEzNTI0MjgzMjQwNDI5OTgwNzpZS1ZzSTFvRkZxUGF5THNoWjFhY1kxUGJHdEV5YXNXams3UHFCcFJ1MVNXc0dEZmZOTWIzVVo1NlBEcW1jYlBBRGFZZ0lCT2thZWtNWWpkbFByMjFZNldCTHZoOE53TlFhelpvMWdLdGdXa2FWOTdYVElyZ1piVjVRUWlERFlRNQ/callback'
}
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/30/2023 in #djs-voice
Error
Here is my ping.js code
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/30/2023 in #djs-voice
Error
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('It prints delay time'),
async execute(interaction) {
await interaction.deferReply();

const reply = await interaction.fetchReply();

const ping = reply.createdTimestamp - interaction.createdTimestamp;

interaction.editReply(`🏓pong! (${ping}ms)`);
},
};
const { SlashCommandBuilder } = require('discord.js');

module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('It prints delay time'),
async execute(interaction) {
await interaction.deferReply();

const reply = await interaction.fetchReply();

const ping = reply.createdTimestamp - interaction.createdTimestamp;

interaction.editReply(`🏓pong! (${ping}ms)`);
},
};
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/29/2023 in #djs-voice
Message event listener
thank you for helping me!
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/29/2023 in #djs-voice
Message event listener
Thank you for responding my question, but I received an error : that the intents are disallowed. How can I solve this problem??
7 replies
DIAdiscord.js - Imagine an app
Created by Chord on 7/29/2023 in #djs-voice
Message event listener
my index.js :
onst fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, GatewayIntentBits} = require('discord.js');
const { token } = require('./config.json');

const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages,] });

client.commands = new Collection();
const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ('data' in command && 'execute' in command) {
client.commands.set(command.data.name, command);
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}

const eventsPath = path.join(__dirname, 'events');
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));

for (const file of eventFiles) {
const filePath = path.join(eventsPath, file);
const event = require(filePath);
if (event.once) {
client.once(event.name, (...args) => event.execute(...args));
} else {
client.on(event.name, (...args) => event.execute(...args));
}
}

client.login(token);
onst fs = require('node:fs');
const path = require('node:path');
const { Client, Collection, GatewayIntentBits} = require('discord.js');
const { token } = require('./config.json');

const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages,] });

client.commands = new Collection();
const foldersPath = path.join(__dirname, 'commands');
const commandFolders = fs.readdirSync(foldersPath);

for (const folder of commandFolders) {
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ('data' in command && 'execute' in command) {
client.commands.set(command.data.name, command);
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}

const eventsPath = path.join(__dirname, 'events');
const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js'));

for (const file of eventFiles) {
const filePath = path.join(eventsPath, file);
const event = require(filePath);
if (event.once) {
client.once(event.name, (...args) => event.execute(...args));
} else {
client.on(event.name, (...args) => event.execute(...args));
}
}

client.login(token);
7 replies