Remove bing results from image

This commit is contained in:
Essem 2021-12-03 20:23:04 -06:00
parent fbefd0f10a
commit c4ac08f40a
No known key found for this signature in database
GPG Key ID: 7D497397CC3A2A8C
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ class ImageSearchCommand extends Command {
if (this.args.length === 0) return "You need to provide something to search for!";
this.client.sendChannelTyping(this.message.channel.id);
const embeds = [];
const rawImages = await fetch(`${random(searx)}/search?format=json&safesearch=2&categories=images&q=!goi%20!bii%20!ddi%20${encodeURIComponent(this.args.join(" "))}`).then(res => res.json());
const rawImages = await fetch(`${random(searx)}/search?format=json&safesearch=2&categories=images&q=!goi%20!ddi%20${encodeURIComponent(this.args.join(" "))}`).then(res => res.json());
if (rawImages.results.length === 0) return "I couldn't find any results!";
const images = rawImages.results.filter((val) => !val.img_src.startsWith("data:"));
for (const [i, value] of images.entries()) {