Çözüldü Discord Bot Müzik Sisteminde Hata

Bu konu çözüldü olarak işaretlenmiştir. Çözülmediğini düşünüyorsanız konuyu rapor edebilirsiniz.

296822

Gigapat
İlk 5 Haneli Mesajınız!
Katılım
11 Ocak 2020
Mesajlar
11.747
Makaleler
19
Çözümler
69
NPMJS sitesinde gezerken bu modülü kurdum ve kendi botumdaki müzik sisteminde ufak modifikasyonlar yaptım. Fakat böyle hata aldım.

Şu anki komutlar:

[CODE lang="javascript" title="çal.js"]const player = require('discordjs-ytdl-advanced')
const { MessageEmbed } = require('discord.js')
module.exports = {
kod: "çal",
async run (client, message, args){
if (!args[0]) return message.channel.send('Lütfen bir kelime girin.');
if (message.member.voice.channel){
const connection = await message.member.voice.channel.join()
const şarkı = await player(args.join(" "))
şarkı.play(connection)
const embed = new MessageEmbed()
.setTitle('Şarkı Bulundu: ' + şarkı.title)
.setDescription(`Video: [${şarkı.title}](${şarkı.url})`)
.setThumbnail(şarkı.thumbnail)
.addField('Video Açıklaması ', `${şarkı.description}`)
.addField('Video ID', `${şarkı.id}`)
.addField('Video Süresi',`${şarkı.time}`)
.addField('Video Tarihi', `${şarkı.date}`)
.addField('Videoyu yükleyen kanal', `${şarkı.channel}`)
.setColor('BLUE')
message.channel.send(embed)
} else {
message.reply('Bir ses kanalına katılın.')
}
}
}[/CODE]


Aldığım hata:



[CODE title="Hata:"]SyntaxError: Unexpected token 'export'
←[90m at wrapSafe (internal/modules/cjs/loader.js:1060:16)←[39m
←[90m at Module._compile (internal/modules/cjs/loader.js:1108:27)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:1
0)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:993:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:892:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:1033:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:72:18)←[39m
at Object.<anonymous> (C:\diskotekbot\node_modules\←[4mdiscordjs-ytdl-advanc
ed←[24m\search\execute.js:10:11)
←[90m at Module._compile (internal/modules/cjs/loader.js:1144:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:1
0)←[39m
C:\diskotekbot\node_modules\jsonpath-plus\dist\index-browser-esm.js:1056
export { JSONPath };
^^^^^^[/CODE]
 
Çözüm
Orada embedler boş olamaz diyor.
Şunu silip deneyin bir.
JavaScript:
.addField('Video Açıklaması ', `${şarkı.description}`)
Son düzenleme:

Hocam hatayı sizin kodda vermiyor, hataya bakarsanız bir modülde veriyor muhtemelen modülde sorun var. Node JS sürümünüz ve NPM surumunuzun güncel olduğundan emin olun, modülü yeniden kurun.
 
Hocam hatayı sizin kodda vermiyor, hataya bakarsanız bir modülde veriyor muhtemelen modülde sorun var. Node JS sürümünüz ve NPM surumunuzun güncel olduğundan emin olun, modülü yeniden kurun.
Kod:
(node:29916) UnhandledPromiseRejectionWarning: RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values may not be empty.
    at Function.normalizeField (C:\diskotekbot\diskotekbot\node_modules\discord.js\src\structures\MessageEmbed.js:432:23)
    at C:\diskotekbot\diskotekbot\node_modules\discord.js\src\structures\MessageEmbed.js:452:14
    at Array.map (<anonymous>)
    at Function.normalizeFields (C:\diskotekbot\diskotekbot\node_modules\discord.js\src\structures\MessageEmbed.js:451:8)
    at MessageEmbed.addFields (C:\diskotekbot\diskotekbot\node_modules\discord.js\src\structures\MessageEmbed.js:266:42)    at MessageEmbed.addField (C:\diskotekbot\diskotekbot\node_modules\discord.js\src\structures\MessageEmbed.js:257:17)
    at Object.run (C:\diskotekbot\diskotekbot\komutlar\çal.js:15:3)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:29916) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:29916) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Böyle bir hata aldım, şarkıyı çalıyor fakat şarkı infosunu vermiyor embed şeklinde.
 
Orada embedler boş olamaz diyor.
Şunu silip deneyin bir.
JavaScript:
.addField('Video Açıklaması ', `${şarkı.description}`)
 
Çözüm
.addField() değer kısmı boş olduğundan bu hatayı alıyorsunuz. addField() de yazdığınız değerleri kontrol edin. Muhtemelen biri boş.
Kontrol etmek için kanala değerleri mesaj attırabilir veya konsola yazdırabilirsiniz.
 
Son düzenleme:
Bu siteyi kullanmak için çerezler gereklidir. Siteyi kullanmaya devam etmek için çerezleri kabul etmelisiniz. Daha Fazlasını Öğren.…