Ruthless_Mercy_
Ruthless_Mercy_
DIAdiscord.js - Imagine a boo! 👻
Created by Ruthless_Mercy_ on 8/13/2024 in #djs-questions
call translation
I am creating a bot that is capable of: 1) Recognize what the user says 2) Translate what the user said into a certain language 3) Clone the user's voice 4) Repeat what he had said in the translated In order to be able to communicate with my friends who speak other languages more easily without having to learn the lenguajes. In this case, my question is, is there any way for the bot to collect audio from a specific user? Example, if there are 5 users talking, the bot will only recognize the audio from 1 user, Or from 2 users individually, so you can translate and identify who each phrase belongs to.Since I have not seen any way to filter the user's call Individual. On the other hand, knowing what a specific user says will also allow the bot to monitor that they do not have discussions or say bad words in the absence of moderators, And thus be able to punish people as they deserve respectively. The project is a bit small, but I hope you can answer my question, thank you very much in advance
4 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Ruthless_Mercy_ on 9/20/2023 in #djs-questions
interactive data collection
I have an "interactive" chat with the bot, it asks me questions, I answer them and it saves that information to send it in a single message later on x channel, it worked normally, but I wanted to add some buttons so that depending on what they choose in the buttons the bot will continue a different code, the fact is that with the buttons I could only implement 1 action and the action is continued in a 'client.on('messageCreate', async (message) => {' because if not I won't It worked, but when collecting data, it only collects the first one and leaves the rest as undefined
js
const userId = message.author.id;
if (datosTicket[userId] && datosTicket[userId].tipo_solicitud === 'Live/Streaming Class') {
console.log(datosTicket);
if (!datosTicket[userId].tipo_transmicion || datosTicket[userId].tipo_transmicion === 'undefined') {
datosTicket[userId].tipo_transmicion = message.content;
console.log(datosTicket);
await message.author.send('At what time in UTC time do you want the transmission to be and what day in DD/MM format');
} else if ((!datosTicket[userId].hora || datosTicket[userId].hora === 'undefined') && datosTicket[userId].tipo_transmicion) {
datosTicket[userId].hora = message.content;
console.log(datosTicket);
await message.author.send('Any additional notes?');
} else if ((!datosTicket[userId].nota || datosTicket[userId].nota === 'undefined') && datosTicket[userId].hora) {
datosTicket[userId].nota = message.content;
}
console.log(datosTicket);
js
const userId = message.author.id;
if (datosTicket[userId] && datosTicket[userId].tipo_solicitud === 'Live/Streaming Class') {
console.log(datosTicket);
if (!datosTicket[userId].tipo_transmicion || datosTicket[userId].tipo_transmicion === 'undefined') {
datosTicket[userId].tipo_transmicion = message.content;
console.log(datosTicket);
await message.author.send('At what time in UTC time do you want the transmission to be and what day in DD/MM format');
} else if ((!datosTicket[userId].hora || datosTicket[userId].hora === 'undefined') && datosTicket[userId].tipo_transmicion) {
datosTicket[userId].hora = message.content;
console.log(datosTicket);
await message.author.send('Any additional notes?');
} else if ((!datosTicket[userId].nota || datosTicket[userId].nota === 'undefined') && datosTicket[userId].hora) {
datosTicket[userId].nota = message.content;
}
console.log(datosTicket);
5 replies
DIAdiscord.js - Imagine a boo! 👻
Created by Ruthless_Mercy_ on 9/12/2023 in #djs-questions
The bot does not detect the contents of the messages
jsclient.on(Events.MessageCreate, async message => {

if (message.author.bot) return;

console.log('Contenido del mensaje: ', message.content);

if (message.embeds.length > 0) {
console.log('Contenido del embed: ', message.embeds[0].description);
}
}); js
jsclient.on(Events.MessageCreate, async message => {

if (message.author.bot) return;

console.log('Contenido del mensaje: ', message.content);

if (message.embeds.length > 0) {
console.log('Contenido del embed: ', message.embeds[0].description);
}
}); js
This is a fragment of my index file.js, since the complete code does not want to work I began to make it simpler and simpler until I got what the error is, and I realized that the bot is not getting the content of the messages, if I send a message that says "Hello" the bot detects almost everything, except for the content, the bot already verifies that it has all the permissions (literally it is as administrator) and that the necessary resources are called, I am using the latest version of Discord.js I already updated the file while searching for the error
5 replies