Get the real drip for your avatar
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
// Check if message starts with the right prefix command
if (context.params.event.content.startsWith(`${process.env.PREFIX}drip`)) {
const avatar = context.params.event.mentions.length
? context.params.event.mentions[0].avatar
: context.params.event.author.avatar;
const ID = context.params.event.mentions.length
? context.params.event.mentions[0].id
: context.params.event.author.id;
// Create avatar link
let avatarLink = `https://cdn.discordapp.com/avatars/${ID}/${avatar}`;
// Get drip image from API
let dripImg = await lib.http.request['@1.1.5']({
method: 'GET',
url: `https://api.popcat.xyz/drip?image=${avatarLink}`,
}).then((result) => {
return result.body;
});
// Post message with image in channel
return lib.discord.channels['@0.1.0'].messages.create({
channel_id: context.params.event.channel_id,
content: '',
file: dripImg,
filename: 'drip.png',
});
}