thaferra
DIAdiscord.js - Imagine a bot
•Created by thaferra on 9/6/2024 in #djs-questions
Why my interaction is not defined?
https://sourceb.in/8atz9Es4p2
//
node:events:497
throw er; // Unhandled 'error' event
^
ReferenceError: interaction is not defined
at Client.<anonymous> (/home/container/index.js:363:3)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21)
4 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 9/4/2024 in #djs-questions
Issue by opening a ticket
I can't undestand why when i open a ticket i get this error:
Errore durante la gestione dell'interazione: DiscordAPIError[50035]: Invalid Form Body
role_id[NUMBER_TYPE_COERCE]: Value "tech_support" is not snowflake.
at handleErrors (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:1133:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:963:14)
at async _REST.request (/home/container/node_modules/discord.js/node_modules/@discordjs/rest/dist/index.js:1278:22)
at async GuildMemberRoleManager.add (/home/container/node_modules/discord.js/src/managers/GuildMemberRoleManager.js:131:7)
at async Client.<anonymous> (/home/container/index.js:161:9) {
requestBody: { files: undefined, json: undefined },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: { role_id: [Object] }
},
code: 50035,
status: 400,
method: 'PUT',
url: 'https://discord.com/api/v10/guilds/991321696420245544/members/492320170514186240/roles/tech_support'
}
18 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 8/29/2024 in #djs-questions
Can't find the problem
https://sourceb.in/RvzqpYw6Us
https://sourceb.in/ar4Pe5tAqT
/////////
here's the error:
https://sourceb.in/uUkKuiUpmC
17 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 8/29/2024 in #djs-questions
Anonymous Messages
4 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 8/25/2024 in #djs-questions
Application doesn't respond
I have a problem, every time I make an interaction, whether it's a command or pressing a button it responds to me with: Application doesn't respond.
I share with you my 3 reference codes, the config.js and the other files I personally checked and everything is correct, but in those I can't understand where the problem is
https://sourceb.in/xp8vrRu91W
7 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 5/17/2024 in #djs-questions
channel_id[NUMBER_TYPE_COERCE]: Value "[object Object]" is not snowflake.
Can someone explain to me why the text channel is not created once an option is selected from the selectmenu? Also, can I ask you for advice on how to structure a ticket log such as a transcript of what happened in the chat ticket created?
That's the errors
node:events:497
throw er; // Unhandled 'error' event
^
DiscordAPIError[50035]: Invalid Form Body
channel_id[NUMBER_TYPE_COERCE]: Value "[object Object]" is not snowflake.
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:730:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1133:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:963:14)
at async _REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1278:22)
at async GuildChannelManager.fetch (/home/container/node_modules/discord.js/src/managers/GuildChannelManager.js:387:20)
at async Client.<anonymous> (/home/container/index.js:240:23)
Emitted 'error' event on Client instance at:
at emitUnhandledRejectionOrErr (node:events:402:10)
at process.processTicksAndRejections (node:internal/process/task_queues:84:21) {
requestBody: { files: undefined, json: undefined },
rawError: {
message: 'Invalid Form Body',
code: 50035,
errors: {
channel_id: {
_errors: [
{
code: 'NUMBER_TYPE_COERCE',
message: 'Value "[object Object]" is not snowflake.'
}
]
}
}
},
code: 50035,
status: 400,
method: 'GET',
url: 'https://discord.com/api/v10/channels/[object Object]'
}
Node.js v20.13.1
2 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 5/13/2024 in #djs-questions
"The application is not responding"
15 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 5/10/2024 in #djs-questions
getInteger('amount')
21 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 5/9/2024 in #djs-questions
ReferenceError: rest is not defined
6 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 5/4/2024 in #djs-questions
Role Stats
client.on('guildMemberAdd', () => {
updateVoiceChannels();
});
client.on('guildMemberRemove', () => {
updateVoiceChannels();
});
async function updateVoiceChannels() {
console.log("Inizio aggiornamento canali vocali...");
const guild = client.guilds.cache.get(config.guildID);
if (!guild) {
console.error("Impossibile trovare il server Discord.");
return;
}
const roleChannel = guild.channels.cache.get(config.roleChannelID);
const vipChannel = guild.channels.cache.get(config.vipChannelID);
const staffChannel = guild.channels.cache.get(config.staffChannelID);
if (!roleChannel | | !vipChannel | | !staffChannel) {
console.error("Impossibile trovare tutti e tre i canali vocali.");
return;
}
console.log("Trovati tutti i canali vocali.");
const roleMembers = guild.roles.cache.get(config.roleID).members.size;
const vipMembers = guild.roles.cache.get(config.vipRoleID).members.size;
const staffMembers = guild.roles.cache.get(config.staffRoleID).members.size;
console.log(
Membri con ruolo: ${roleMembers}
);
console.log(Membri VIP: ${vipMembers}
);
console.log(Membri staff: ${staffMembers}
);
// Aggiorna tutti e tre i canali vocali
await roleChannel.setName(🧍┇Utenti: ${roleMembers}
);
await vipChannel.setName(⭐┇Vip: ${vipMembers}
);
await staffChannel.setName(🚧┇Staff: ${staffMembers}
);
console.log("Aggiornamento completato.");
}
// Esegui l'aggiornamento dei canali vocali ogni minuto
client.on("ready", () => {
setInterval(() => {
updateVoiceChannels();
}, 60000);
});
---------
Can someone explain to me why it only counts the people who are connected to a voice chat and not the people who are on the server?
also how do I tell the bot that it should only count real people and not bots in "Utenti"4 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 2/13/2024 in #djs-questions
Ticket Support
Why when i run the bot, the terminal gave me this error?
7 replies
DIAdiscord.js - Imagine a bot
•Created by thaferra on 2/9/2024 in #djs-questions
Embed Message
Hi everyone, I need help regarding this string, apparently when someone joins the server, the embed message doesn't appear and doesn't even assign the role, could it be something related to the intents?
43 replies