This is a hug Discord prefix command. It will send a random GIF of a hug to the mentioned user when you type "!hug {user}" in your server.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const coolpics = require('cool-pics');
const huggif = coolpics.hug();
let user = context.params.event.content.split(' ')[1];
if (context.params.event.content.startsWith(`!hug`)) {
if (!user || !user.match(/<@.*>/)) {
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `Please provide a user to hug. We can't hug the air!`,
});
} else if (user) {
await lib.discord.channels['@0.2.0'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `<@${context.params.event.author.id}> has hugged ${user}\n> ${huggif}`,
});
}
}