Package Exports
- discord-welcome-card
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (discord-welcome-card) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Discord Welcome Card
Simple easy-to-use Goodbye and welcome cards for your discord Bot.
Features
- âŠī¸ 5 default themes (circuit, code, sakura, dark, colorsplash)
- đ gradient color support
- đŧī¸ custom background support
- đ customizable cards (blur, rounded edges)
- đ multiple font support
(Note that all example codes below are for discord.js Version 12. Example usage code in Version 13 or higher, is provided at Usage.md)
Examples
Welcome Card
const Discord = require("discord.js");
const { welcomeImage } = require('discord-welcome-card');
const client = new Discord.Client();
client.on("message", async message => {
if(message.author.bot) return
//Generating the actual welcome Card
const image = await welcomeImage(message.member);
message.channel.send(new Discord.MessageAttachment(image, 'welcome.png'))
});
client.login('Your-Bot-Token');
Goodbye Card
const Discord = require("discord.js");
const { goodbyeImage } = require('discord-welcome-card');
const client = new Discord.Client();
client.on("message", async message => {
if(message.author.bot) return
//Generating the actual goodbye Card
const image = await goodbyeImage(message.member, 'code');
message.channel.send(new Discord.MessageAttachment(image, 'goodbye.png'))
});
client.login('Your-Bot-Token');
Custom Card
const Discord = require("discord.js");
const { drawCard } = require('discord-welcome-card');
const client = new Discord.Client();
client.on("message", async message => {
if(message.author.bot) return
//Generating the actual custom Card
const image = await drawCard({
blur: true,
title: 'Title',
theme: 'dark',
text: 'Text',
subtitle: 'Subtitle',
rounded: true,
border: true,
avatar: message.member.user.avatarURL({ format: 'png' })
})
message.channel.send(new Discord.MessageAttachment(image, 'custom.png'))
});
client.login('Your-Bot-Token');
Custom Card (custom Background)
folder strcuture:folder
|-index.js
|-image.png
const Discord = require("discord.js");
const { drawCard } = require('discord-welcome-card');
const client = new Discord.Client();
client.on("message", async message => {
if(message.author.bot) return
//Generating the actual custom Card
const image = await drawCard({
blur: true,
title: 'Title',
theme: {
image: "./image.png",
color: new Gradient("linear", {
color: "#4287f5",
offset: 1
}, {
color: "#f5426f",
offset: 0
})
},
text: 'Text',
subtitle: 'Subtitle',
rounded: true,
border: true,
avatar: message.member.user.avatarURL({ format: 'png' })
})
message.channel.send(new Discord.MessageAttachment(image, 'custom.png'))
});
client.login('Your-Bot-Token');
Example projects
Some projects written with this package
- Miyuki (discord.js V13)