Use this Discord command '$cuddle <@user>' to send a cuddle GIF to someone.
// authenticates you with the API standard library
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const gifs = [
'https://media1.tenor.com/images/b0ee5dcaad65487caf02906b3409b699/tenor.gif?itemid=7454269',
'https://media1.tenor.com/images/d0c2e7382742f1faf8fcb44db268615f/tenor.gif?itemid=5853736',
'https://media1.tenor.com/images/c51d8a4505e1dfef709efd4739d09faa/tenor.gif?itemid=5754133',
];
const randomGif = gifs[Math.floor(Math.random() * gifs.length)];
if (
context.params.event.content.startsWith('$cuddle ') &&
context.params.event.mentions.length === 1
) {
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embed: {
type: 'rich',
title: `${context.params.event.author.username} cuddles ${context.params.event.mentions[0].username}`,
description: '',
color: 0x00ffff,
image: {
url: randomGif,
},
},
});
}
if (
context.params.event.content.startsWith('$cuddle ') &&
context.params.event.mentions.length !== 1
) {
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: `You need to mention **one** person`,
});
}