@ienznotfound/welcomeandgoodbyegenerator
v1.0.2
Published
A simple and highly customizable Welcome and Goodbye image generator for your Discord / WhatsApp / Telegram bots using native Canvas.
Readme
@ienznotfound/welcomeandgoodbyegenerator
A simple and highly customizable Welcome and Goodbye image generator for your Discord / WhatsApp / Telegram bots using native Canvas.
✨ Features
- Auto Circular Avatar: Profile pictures are automatically masked into perfect circles.
- Stackable Text: Stack as many text lines as you want seamlessly.
- Auto Emoji Support: Full support for emojis natively (
Segoe UI Emoji,Apple Color Emoji, etc.). - Custom Backgrounds & Avatars: Supports URL downloading out-of-the-box (no need to download images manually).
📦 Installation
npm install @ienznotfound/welcomeandgoodbyegenerator🚀 Usage
1. Welcome Card
const fs = require('fs');
const { welcome } = require('@ienznotfound/welcomeandgoodbyegenerator');
async function createWelcome() {
const bgUrl = 'https://preview.redd.it/evanescia-custom-wallpaper-v0-9xhkoww6hl2h1.png?auto=webp&s=cc95461c57fa14d1f47af182cd7f96abe0b25efe';
const avatarUrl = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEbbS8aFOWJiN4UPQcNAVMbH2-UbpZZxFbcI12T9uW_PjWHZhwupf1Vcvv&s=10';
const welcBuffer = await new welcome()
.addBackground(bgUrl)
.addProfilePicture(avatarUrl)
.addWelcomeText('Welcome To Our Server!')
.makeNewText('Member ke 224 🎉')
.makeNewText('Have fun and read the rules')
.addDescriptionText('Semoga Betah Disini :)')
.generate();
fs.writeFileSync('welcome.png', welcBuffer);
}
createWelcome();2. Goodbye Card
const fs = require('fs');
const { goodbye } = require('@ienznotfound/welcomeandgoodbyegenerator');
async function createGoodbye() {
const bgUrl = 'https://preview.redd.it/evanescia-custom-wallpaper-v0-9xhkoww6hl2h1.png?auto=webp&s=cc95461c57fa14d1f47af182cd7f96abe0b25efe';
const avatarUrl = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTEbbS8aFOWJiN4UPQcNAVMbH2-UbpZZxFbcI12T9uW_PjWHZhwupf1Vcvv&s=10';
const gbBuffer = await new goodbye()
.addBackground(bgUrl)
.addProfilePicture(avatarUrl)
.addGoodbyeText('Goodbye from Our Server!')
.makeNewText('We will miss you 😢')
.addDescriptionText('See you next time!')
.generate();
fs.writeFileSync('goodbye.png', gbBuffer);
}
createGoodbye();📝 API Reference
Core Methods (Shared by both welcome and goodbye)
.addBackground(path_or_url): URL or local file path to the background image..addProfilePicture(path_or_url): URL or local file path to the user's avatar..makeNewText(text): Creates a new line of text below the main heading. You can call this multiple times to stack texts!.addDescriptionText(text): Adds a smaller, italicized footer text at the bottom..generate(): Renders the image and returns a PNGBuffer.
Class Specific Methods
new welcome().addWelcomeText(text): Sets the main, large heading text for Welcome cards.new goodbye().addGoodbyeText(text): Sets the main, large heading text for Goodbye cards.
