welcomify
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Welcomify

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

🏠 Homepage

Install

npm i welcomify

Usage

This example code will create a welcome card and save it as a png.

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

  // Card details here
  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"); // without #

  // Building process
  const cardoutput = await card.build();

  // Save as image
  fs.writeFileSync("cardout.png", cardoutput);
  console.log("Done");
})();

Example For Discord.js Bot Used

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

// Make sure to define client
client.on("guildMemberAdd", async (member) => {
  // Card details here
  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"); // without #

  // Building process
  const cardoutput = await card.build();

  // Fetch channel from members guild using ID
  const channel = member.guild.channels.cache.get("0000000000000000000");

  // Sends card to the "channel"
  await channel.send({
    files: [
      {
        attachment: cardoutput,
        name: `${member.id}.png`,
      },
    ],
  });
});

Output

Sample Welcome Message

Methods

Sample Welcome Message

  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 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!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a ⭐️ if this project helped you!

📝 License

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

Package Sidebar

Install

npm i welcomify

Weekly Downloads

4

Version

1.0.5

License

GPL-3.0

Unpacked Size

444 kB

Total Files

8

Last publish

Collaborators

  • zensuki
  • karisuu