Send an image with clown background and avatar overlay makes the fun in your server. Set your favourite prefix of your bot. Do {PREFIX}clown <user> to make them clown!
// authenticates you with the API standard library
// type `await lib.` to display API autocomplete
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const ID = context.params.event.mentions.length
? context.params.event.mentions[0].id
: context.params.event.author.id;
const target = context.params.event.mentions[0]
? context.params.event.mentions[0].avatar
: context.params.event.author.avatar;
const avatarLink = `https://cdn.discordapp.com/avatars/${ID}/${target}.png`;
const Time = new Date().toISOString();
if (context.params.event.content.startsWith(`${process.env.PREFIX}clown`)) {
const msg = await lib.discord.channels['@0.2.2'].messages.create({
channel_id: `${context.params.event.channel_id}`,
content: '',
tts: false,
embeds: [
{
type: 'rich',
title: `Clown of the month 🤡`,
description: `<@${context.params.event.author.id}> is a clown!`,
color: 0xffffff,
timestamp: `${Time}`,
image: {
url: `https://api.popcat.xyz/clown?image=${avatarLink}`,
height: 0,
width: 0,
},
},
],
});
await lib.discord.channels['@0.2.2'].messages.reactions.create({
emoji: `🤡`,
message_id: `${msg.id}`,
channel_id: `${msg.channel_id}`,
});
}