mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Fix
This commit is contained in:
@@ -28,7 +28,8 @@ module.exports = class NsfwCommand extends Command {
|
||||
try {
|
||||
const { body } = await request.get(image);
|
||||
const prediction = await isImageNSFW(this.client.nsfwModel, body, false);
|
||||
return msg.reply(`I'm **${prediction.probability}%** sure this image is: **${prediction.className}**.`);
|
||||
const prob = Math.round(prediction.probability * 100);
|
||||
return msg.reply(`I'm **${prob}%** sure this image is: **${prediction.className}**.`);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user