андреас (kanye's version)
андреас (kanye's version)
DIAdiscord.js - Imagine an app
Created by андреас (kanye's version) on 1/30/2024 in #djs-questions
DiscordAPIError[50006]: Cannot send an empty message
thanks
10 replies
DIAdiscord.js - Imagine an app
Created by андреас (kanye's version) on 1/30/2024 in #djs-questions
DiscordAPIError[50006]: Cannot send an empty message
nvm, already fixed it
10 replies
DIAdiscord.js - Imagine an app
Created by андреас (kanye's version) on 1/30/2024 in #djs-questions
DiscordAPIError[50006]: Cannot send an empty message
good info
10 replies
DIAdiscord.js - Imagine an app
Created by андреас (kanye's version) on 1/30/2024 in #djs-questions
DiscordAPIError[50006]: Cannot send an empty message
so what am i supposed to do?
10 replies
DIAdiscord.js - Imagine an app
Created by андреас (kanye's version) on 1/30/2024 in #djs-questions
DiscordAPIError[50006]: Cannot send an empty message
Here's the error message:
/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:722
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50006]: Cannot send an empty message
at handleErrors (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:1120:23)
at async SequentialHandler.queueRequest (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:953:14)
at async _REST.request (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async TextChannel.send (/home/andreas/Documentos/maskeys/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:155:15) {
requestBody: {
files: [],
json: {
content: '',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: [],
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Cannot send an empty message', code: 50006 },
code: 50006,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1199200226880266250/messages'
}
/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:722
throw new DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50006]: Cannot send an empty message
at handleErrors (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:722:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:1120:23)
at async SequentialHandler.queueRequest (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:953:14)
at async _REST.request (/home/andreas/Documentos/maskeys/node_modules/@discordjs/rest/dist/index.js:1266:22)
at async TextChannel.send (/home/andreas/Documentos/maskeys/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:155:15) {
requestBody: {
files: [],
json: {
content: '',
tts: false,
nonce: undefined,
embeds: undefined,
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: [],
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Cannot send an empty message', code: 50006 },
code: 50006,
status: 400,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1199200226880266250/messages'
}
10 replies
DIAdiscord.js - Imagine an app
Created by андреас (kanye's version) on 1/26/2024 in #djs-questions
Help with !play song command.
Here is my code:
const { joinVoiceChannel, getVoiceConnection, createAudioPlayer, createAudioResource } = require('@discordjs/voice');

module.exports = {
name: "play",
description: "Toca música do YouTube.",
async execute(bot, message, args) {
const url = args.join(" ");
const voiceChannel = message.member.voice.channel;

if(!url) return message.reply("Envie o comando com URL do YouTube!");
if (!voiceChannel) {
return message.reply("Entre em um canal de voz para executar este comando.");
}

const permissions = voiceChannel.permissionsFor(message.client.user);
if (!permissions.has("CONNECT") || !permissions.has("SPEAK")) {
return message.reply("Eu preciso das permissões adequadas para entrar e falar no canal de voz.");
}

try {
if (!voiceChannel.guild.voiceConnection) {

} else {
message.reply("O bot já está em um canal de voz.");
}
} catch (error) {
console.error(error);
message.reply("Ocorreu um erro ao tentar tocar a música.");
}
}
};
const { joinVoiceChannel, getVoiceConnection, createAudioPlayer, createAudioResource } = require('@discordjs/voice');

module.exports = {
name: "play",
description: "Toca música do YouTube.",
async execute(bot, message, args) {
const url = args.join(" ");
const voiceChannel = message.member.voice.channel;

if(!url) return message.reply("Envie o comando com URL do YouTube!");
if (!voiceChannel) {
return message.reply("Entre em um canal de voz para executar este comando.");
}

const permissions = voiceChannel.permissionsFor(message.client.user);
if (!permissions.has("CONNECT") || !permissions.has("SPEAK")) {
return message.reply("Eu preciso das permissões adequadas para entrar e falar no canal de voz.");
}

try {
if (!voiceChannel.guild.voiceConnection) {

} else {
message.reply("O bot já está em um canal de voz.");
}
} catch (error) {
console.error(error);
message.reply("Ocorreu um erro ao tentar tocar a música.");
}
}
};
3 replies