因此,我试图在不和谐的服务器上运行一些布尔图像搜索代码。我已经从npm下载了booru软件包,并且正在使用以下代码:
const Discord = require("discord.js")
const booru = require('booru');
var query = args.slice(0).join(" ");
booru.search('safebooru', [query], {
limit: 1,
random: true
})
.then(booru.commonfy)
.then(images => {
for (let image of images) {
const embed = new Discord.MessageEmbed()
.setAuthor(`safebooru ${query}`)
.setDescription(`[Image URL](${image.common.file_url})`)
.setImage(image.common.file_url)
.setColor('#E89F3E');
return message.channel.send({
embed
});
}
}).catch(err => {
if (err.name === 'booruError') {
return message.channel.send(`No results found for **${query}**!`);
} else {
return message.channel.send(`No results found for **${query}**!`);
}
})
但是,当我使用!booru happy
时,它将只返回No results found for happy!
。好像它甚至都没有搜索过该词。我是否正确使用booru?