Just do !driverlicense to get your very own Discord Drivers License. There is no set up have fun :)
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const jimp = require('jimp');
const moment = require('moment-timezone');
module.exports = async (event, context) => {
if (context.params.event.content.startsWith(`!driverlicense`)) {
const ID = context.params.event.mentions[0]
? context.params.event.mentions[0].id
: context.params.event.author.id;
const joined = await lib.discord.guilds['@0.1.0'].members.retrieve({
user_id: ID, // required
guild_id: context.params.event.guild_id,
});
let retrieve = await lib.discord.guilds['@0.1.1'].retrieve({
guild_id: `${context.params.event.guild_id}`,
});
let timeout = await lib.utils.kv['@0.1.16'].get({
key: `timeout`,
defaultValue: false,
});
let member = event.author.id;
if (event.mentions.length >= 1) {
member = event.mentions[0].id;
}
let user = await lib.discord.users['@0.1.4'].retrieve({
user_id: member,
});
let img = await jimp.read(
'https://cdn.discordapp.com/attachments/897689463692599340/903167247772713000/driverslisenssssss.jpg'
);
let avatar_jimp = await jimp.read(user.avatar_url);
avatar_jimp;
avatar_jimp.resize(275, 275);
img.composite(avatar_jimp, 125, 200);
let date = moment(joined.joined_at);
let formattedTime = date.tz('Asia/Calcutta').format('DD/MM/YYYY');
await jimp.loadFont(jimp.FONT_SANS_16_BLACK).then((font) => {
img.print(
font,
470,
302,
{
text: `${user.username}`,
},
300,
2
);
});
await jimp.loadFont(jimp.FONT_SANS_16_BLACK).then((font) => {
img.print(
font,
470,
272,
{
text: `Discorder`,
},
300,
2
);
});
await jimp.loadFont(jimp.FONT_SANS_16_BLACK).then((font) => {
img.print(
font,
470,
192,
{
text: `${user.id}`,
},
300,
2
);
});
await jimp.loadFont(jimp.FONT_SANS_32_BLACK).then((font) => {
img.print(
font,
435,
325,
{
text: `1234 Discord Boulevard, ${retrieve.name}`,
},
400,
10
);
});
await jimp.loadFont(jimp.FONT_SANS_16_BLACK).then((font) => {
img.print(
font,
485,
415,
{
text: formattedTime,
},
300,
2
);
});
await jimp.loadFont(jimp.FONT_SANS_16_BLACK).then((font) => {
img.print(
font,
485,
228,
{
text: `11/26/2025`,
},
300,
2
);
});
let buffer = await img.getBufferAsync(jimp.MIME_PNG);
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: event.channel_id,
content: ``,
filename: 'driverlicense.png',
file: buffer,
});
}
};