mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 10:19:11 +02:00
Fix
This commit is contained in:
@@ -39,13 +39,14 @@ module.exports = class WikipediaCommand extends Command {
|
|||||||
exintro: '',
|
exintro: '',
|
||||||
explaintext: '',
|
explaintext: '',
|
||||||
pllimit: 15,
|
pllimit: 15,
|
||||||
piprop: 'original',
|
piprop: 'thumbnail',
|
||||||
|
pithumbsize: 1000,
|
||||||
redirects: '',
|
redirects: '',
|
||||||
formatversion: 2
|
formatversion: 2
|
||||||
});
|
});
|
||||||
const data = body.query.pages[0];
|
const data = body.query.pages[0];
|
||||||
if (data.missing) return msg.say('Could not find any results.');
|
if (data.missing) return msg.say('Could not find any results.');
|
||||||
let thumbnail = data.original ? data.original.source : null;
|
let thumbnail = data.thumbnail ? data.thumbnail.source : null;
|
||||||
if (!msg.channel.nsfw && thumbnail) {
|
if (!msg.channel.nsfw && thumbnail) {
|
||||||
const img = await request.get(thumbnail);
|
const img = await request.get(thumbnail);
|
||||||
const nsfw = await this.client.tensorflow.isImageNSFW(img.body);
|
const nsfw = await this.client.tensorflow.isImageNSFW(img.body);
|
||||||
|
|||||||
Reference in New Issue
Block a user