Skip to content

a cutting-edge canvas library for creating futuristic welcome cards.

License

Notifications You must be signed in to change notification settings

koimoee/Welcomify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcomify

A cutting-edge canvas library for creating futuristic welcome cards.

Documentation Maintenance License: GPL--3.0 NPM Version NPM Downloads

Install

npm i welcomify

Usage

Creating a Welcome Card and Saving it as a PNG

(async () => {
  const { Card } = require("welcomify");
  const fs = require("fs");

  const card = new Card()
    .setTitle("Welcome")
    .setName("Remii")
    .setAvatar("https://raw.githubusercontent.com/Shiioriii/Welcomify/main/assets/avatar.png")
    .setMessage("YOU ARE 300 MEMBERS!")
    .setBackground('https://raw.githubusercontent.com/Shiioriii/Welcomify/main/assets/background.jpg')
    .setColor("00FF38");

  const cardOutput = await card.build();

  fs.writeFileSync("cardout.png", cardOutput);
  console.log("Done");
})();

Example for Discord.js Bot

const { Card } = require("welcomify");
const { AttachmentBuilder } = require("discord.js");

client.on("guildMemberAdd", async (member) => {
  const card = new Card()
    .setTitle("Welcome")
    .setName(member.user.username)
    .setAvatar(member.user.displayAvatarURL({ format: 'png', dynamic: true }))
    .setMessage("YOU ARE 300 MEMBER!")
    .setBackground('https://raw.githubusercontent.com/oneofremii/Welcomify/main/assets/background.jpg')
    .setColor("00FF38");

  const cardOutput = await card.build();
  const channel = member.guild.channels.cache.get("0000000000000000000"); // channels id

  await channel.send({
    files: [
      {
        attachment: cardOutput,
        name: `${member.id}.png`,
      },
    ],
  });
});

Output

Sample Welcome Message

Methods

Methods Illustration

  1. .setTitle(title: string) (optional)

    • Sets the title of the welcome card.
  2. .setName(username: string) (optional)

    • Dynamically fetches the username into the welcome card.
  3. .setAvatar(avatarURL: string) (required)

    • Sets the display avatar in the welcome card.
  4. .setMessage(message: string) (optional)

    • Specifies a custom message into the welcome card.
  5. .setBackground(backgroundURL: string) (optional)

    • Sets a custom background image for the welcome card.
  6. .setColor(colorCode: string) (optional)

    • Defines the color scheme of the .setName, use the format without the # symbol.

Author

👤 Remii

🤝 Contributing

Contributions, issues, and feature requests are welcome! Check the issues page and contributing guide.

Show your support

Give a ⭐️ if this project helped you!

Support on Patreon

📝 License

Copyright © 2024 Remii. This project is GPL-3.0 licensed.