Martoz
Martoz
DIAdiscord.js - Imagine an app
Created by Martoz on 12/15/2024 in #djs-questions
help download canvas
3 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 12/15/2024 in #djs-questions
error modal
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (D:\MartozAifoo\node_modules\@discordjs\rest\dist\index.js:727:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (D:\MartozAifoo\node_modules\@discordjs\rest\dist\index.js:831:23)
at async _REST.request (D:\MartozAifoo\node_modules\@discordjs\rest\dist\index.js:1272:22)
at async ButtonInteraction.showModal (D:\MartozAifoo\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:257:5)
at async InteractionCollector.<anonymous> (D:\MartozAifoo\core\commands\VerifySystem.js:82:17) {
requestBody: { files: undefined, json: { type: 9, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1317790941397913632/aW50ZXJhY3Rpb246MTMxNzc5MDk0MTM5NzkxMzYzMjpNTk9oaVJqUDVidXZlcGgyTk5DSmw3dWkyNWJWR2dNZ205bTdMbjk2aEpUdktJV3c2ZGhsWEhMRjE4aTBQb1lQckhlUVhtb3FzRFZ3RUVRUHhWdWFqSU9qVTR2NVlHa245UUdrcXFheHg4Z09ick1aVkZFSlMwT1FuZzk2TzFYWg/callback'
}
DiscordAPIError[40060]: Interaction has already been acknowledged.
at handleErrors (D:\MartozAifoo\node_modules\@discordjs\rest\dist\index.js:727:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async BurstHandler.runRequest (D:\MartozAifoo\node_modules\@discordjs\rest\dist\index.js:831:23)
at async _REST.request (D:\MartozAifoo\node_modules\@discordjs\rest\dist\index.js:1272:22)
at async ButtonInteraction.showModal (D:\MartozAifoo\node_modules\discord.js\src\structures\interfaces\InteractionResponses.js:257:5)
at async InteractionCollector.<anonymous> (D:\MartozAifoo\core\commands\VerifySystem.js:82:17) {
requestBody: { files: undefined, json: { type: 9, data: [Object] } },
rawError: {
message: 'Interaction has already been acknowledged.',
code: 40060
},
code: 40060,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/interactions/1317790941397913632/aW50ZXJhY3Rpb246MTMxNzc5MDk0MTM5NzkxMzYzMjpNTk9oaVJqUDVidXZlcGgyTk5DSmw3dWkyNWJWR2dNZ205bTdMbjk2aEpUdktJV3c2ZGhsWEhMRjE4aTBQb1lQckhlUVhtb3FzRFZ3RUVRUHhWdWFqSU9qVTR2NVlHa245UUdrcXFheHg4Z09ick1aVkZFSlMwT1FuZzk2TzFYWg/callback'
}
const collector = dmChannel.createMessageComponentCollector({ filter, time: 60000 });

collector.on('collect', async (interaction) => {
try {
if (interaction.replied || interaction.deferred) {
console.log('Взаимодействие уже завершено или отложено');
return;
}

if (interaction.isModalSubmit()) {
console.log('Модальное окно уже было показано');
return;
}

const modal = new ModalBuilder()
.setCustomId('captcha_modal')
.setTitle('Введите капчу')
.addComponents(
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId('captcha_input')
.setLabel('Введите текст с картинки')
.setStyle(TextInputStyle.Short)
.setRequired(true)
)
);
await interaction.showModal(modal);
} catch(error) {
console.log(error)
}
})



collector.on('end', async (collected) => {
if (collected.size === 0) {
await user.send('⏳ Время вышло. Попробуйте снова использовать команду /verify.');
}
});
} catch (error) {
console.error('Ошибка в процессе верификации:', error);
await user.send('Произошла ошибка. Попробуйте снова позже.');
}
}
const collector = dmChannel.createMessageComponentCollector({ filter, time: 60000 });

collector.on('collect', async (interaction) => {
try {
if (interaction.replied || interaction.deferred) {
console.log('Взаимодействие уже завершено или отложено');
return;
}

if (interaction.isModalSubmit()) {
console.log('Модальное окно уже было показано');
return;
}

const modal = new ModalBuilder()
.setCustomId('captcha_modal')
.setTitle('Введите капчу')
.addComponents(
new ActionRowBuilder().addComponents(
new TextInputBuilder()
.setCustomId('captcha_input')
.setLabel('Введите текст с картинки')
.setStyle(TextInputStyle.Short)
.setRequired(true)
)
);
await interaction.showModal(modal);
} catch(error) {
console.log(error)
}
})



collector.on('end', async (collected) => {
if (collected.size === 0) {
await user.send('⏳ Время вышло. Попробуйте снова использовать команду /verify.');
}
});
} catch (error) {
console.error('Ошибка в процессе верификации:', error);
await user.send('Произошла ошибка. Попробуйте снова позже.');
}
}
18 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 5/19/2024 in #djs-questions
An invalid token was provided.
if (!token || typeof token !== 'string') throw new Error('TOKEN_INVALID');
^

Error [TOKEN_INVALID]: An invalid token was provided.
at Client.login (E:\MartozAi\node_modules\discord.js\src\client\Client.js:237:52)
at Object.<anonymous> (E:\MartozAi\index.js:77:8)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
[Symbol(code)]: 'TOKEN_INVALID'
}
if (!token || typeof token !== 'string') throw new Error('TOKEN_INVALID');
^

Error [TOKEN_INVALID]: An invalid token was provided.
at Client.login (E:\MartozAi\node_modules\discord.js\src\client\Client.js:237:52)
at Object.<anonymous> (E:\MartozAi\index.js:77:8)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
[Symbol(code)]: 'TOKEN_INVALID'
}
I have already recreated the token several times, changed everything and everything exactly gives an error
27 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 5/10/2024 in #djs-questions
This interaction failed
const handleTicketCloseButtonClick = async (interaction) => {
console.log('Нажата кнопка Закрыть тикет');
try {
const ticketChannelId = interaction.message.channel.id;

const ticketChannel = await interaction.guild.channels.cache.get(ticketChannelId);

if (ticketChannel) {
await ticketChannel.delete();
console.log('Секретный чат успешно удален');

} else {
console.error('Не удалось найти тикет-канал для удаления.');
}
} catch (error) {
console.error('Произошла ошибка при удалении секретного чата:', error);
}
};
const handleTicketCloseButtonClick = async (interaction) => {
console.log('Нажата кнопка Закрыть тикет');
try {
const ticketChannelId = interaction.message.channel.id;

const ticketChannel = await interaction.guild.channels.cache.get(ticketChannelId);

if (ticketChannel) {
await ticketChannel.delete();
console.log('Секретный чат успешно удален');

} else {
console.error('Не удалось найти тикет-канал для удаления.');
}
} catch (error) {
console.error('Произошла ошибка при удалении секретного чата:', error);
}
};
7 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 4/15/2024 in #djs-questions
pls help fix error
D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548
throw new TypeError('CLIENT_MISSING_INTENTS');
^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548:13)
at new Client (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:76:10)
at Object.<anonymous> (D:\mercury\discordBotv13test\event\voice.js:51:16)
at Module._compile (node:internal/modules/cjs/loader:1375:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1234:19)
at require (node:internal/modules/helpers:176:18)
at readCommands (D:\mercury\discordBotv13test\index.js:45:29) {
[Symbol(code)]: 'CLIENT_MISSING_INTENTS'
}

Node.js v21.5.0
D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548
throw new TypeError('CLIENT_MISSING_INTENTS');
^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548:13)
at new Client (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:76:10)
at Object.<anonymous> (D:\mercury\discordBotv13test\event\voice.js:51:16)
at Module._compile (node:internal/modules/cjs/loader:1375:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1234:19)
at require (node:internal/modules/helpers:176:18)
at readCommands (D:\mercury\discordBotv13test\index.js:45:29) {
[Symbol(code)]: 'CLIENT_MISSING_INTENTS'
}

Node.js v21.5.0
16 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 3/3/2024 in #djs-questions
embed
Is it possible to make a text with a link in the title, but so that it is not blue but white?
24 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 2/16/2024 in #djs-voice
for some reason, the commands stopped registering
today I decided to add commands to the bot , I wrote a command, I launch the bot to test it , I enter / and there is no command that I added, I tried to create a new bot on the portal, I changed the client id, token in the new bot, no commands are registered at all
17 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 1/27/2024 in #djs-voice
help fix error
my bot was working a couple of days ago, now I decided to try to run it to write code, but when I wrote the command / mute in the discord, it started to give this error, although nothing happened to the bot for a couple of days
3 replies
DIAdiscord.js - Imagine an app
Created by Martoz on 1/19/2024 in #djs-questions
how to create a system of roles that such and commands can useis it possible to write this in json
?
5 replies