Searches google for images based on what you ask it to search. For example '-img happy' returns and image realted to the word 'happy'.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const gis = require('g-i-s');
if (context.params.event.content.startsWith('-img')) {
let imageQuery = context.params.event.content.split(' ').slice(1).join(' ');
await new Promise((resolve, reject) => {
gis(`${imageQuery}`, async function findImage(err, res) {
await lib.discord.channels['@0.1.0'].messages.create({
channel_id: context.params.event.channel_id,
content: `${res[0].url}`
});
})
});
}