props: `content, files`'} 和 Unhanled Rejection at Promise Promise"/>
{'DisallowedError props: `content, files`'} 和 Unhanled Rejection at Promise Promise
const config = {
name: "itunes",
description: "search info music in iTunes",
usage: "itunes [name]",
version: "1.0.0-endupdate",
cooldown: 5,
credits: "Xavia Team"
};
const langData = {
"vi_VN": {
"missingInput": "Vui lòng nhập tên bài hát",
"notFound": "Không tìm thấy bài hát",
"results": "Tên bài hát: {name}\nNghệ sĩ: {artist}\nAlbum: {album}\nNgày xuất bản: {release_date}\nGiá tiền: {price}\nThời lượng: {length}\nThể loại: {genre}\n",
"error": "Đã có lỗi xảy ra!"
},
"en_US": {
"missingInput": "Please enter the name of a song",
"notFound": "Song not found",
"results": "Song title: {name}\nArtist: {artist}\nAlbum: {album}\nRelease date: {release_date}\nPrice: {price}\nLength: {length}\nGenre: {genre}\n",
"error": "An error occurred!"
},
"ar_SA": {
"missingInput": "يرجى إدخال اسم الأغنية",
"notFound": "لم يتم العثور على الأغنية",
"results": "عنوان الأغنية: {name}\nالفنان: {artist}\nالألبوم: {album}\nتاريخ الإصدار: {release_date}\nالسعر: {price}\nالمدة: {length}\nالنوع: {genre}\n",
"error": "حدث خطأ!"
}
};
async function onCall({ message, args, getLang }) {
try {
const input = args.join("+").toLowerCase();
if (!input) return message.reply(getLang("missingInput"));
const encodedInput = encodeURIComponent(input);
const res = await global.GET(`/itunes?q=${encodedInput}`);
const musicData = res.data;
if (!musicData) return message.reply(getLang("notFound"));
const thumbnailStream = await global.getStream(musicData.thumbnail);
return message.reply({
content: getLang("results", {
url: musicData.url,
name: musicData.name,
artist: musicData.artist,
album: musicData.album,
release_date: musicData.release_date,
price: musicData.price,
length: musicData.length,
genre: musicData.genre
}),
files: [{
attachment: thumbnailStream
}]
});
} catch (e) {
console.error(e);
message.reply(getLang("error"));
}
}
export default {
config,
langData,
onCall
}
// ThuHang:))
帮帮我:(
回答如下:更多推荐
{'DisallowedError props: `content, files`'} 和 Unhanled Rejection at Prom
发布评论