Search on google via Discord. The bot will return a link to google. To search with multiple words use a hyphen in between like (billie eilish).
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let search = context.params.event.content.split(' ').slice(1).join(' ');
if (context.params.event.content.startsWith(`search`)) {
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
components: [
{
type: 1,
components: [
{
style: 5,
label: `Ur Google Result`,
url: `https://www.google.com/search?q=${search}&oq=${search}&aqs=chrome..69i57.1069j0j1&sourceid=chrome&ie=UTF-8`,
disabled: false,
type: 2,
},
],
},
],
embed: {
type: 'rich',
title: `Here U Go, Ur Search Result Of <${search}>`,
description: ``,
color: 0x62ff00,
},
});
}