JSPM

discord-welcome-image

1.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q72587F
  • License ISC

Generate custom welcome images for Discord bots.

Package Exports

  • discord-welcome-image
  • discord-welcome-image/index.js

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-image) 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-image

Generate custom welcome images for bots, servers or communities. This module allows you to create images with avatars, custom texts, borders and visual effects such as blur and gradients.



Discord



๐Ÿ“ฆ Installation

npm i discord-welcome-image



๐Ÿ“‹ Options

Option Type Description
member object The username to display, banner and avatar (OBLIGAORY).
backgroundURL string The URL of the background image.
circularAvatar boolean Whether the avatar should be displayed as a circle.
showDate boolean Whether to show the current date.
border boolean Whether to show a border around the image.
borderColor string or object The color of the border; can be a string or an array for gradient effects.
gradientDirection string The direction of the gradient (e.g., horizontal, vertical,diagonal).
maxNameLength number Maximum length for the username.
welcomeText string Text to display as a welcome message.
blurBackground boolean Whether to apply a blur effect to the background.



๐Ÿ›  Example

const generateWelcomeImage = require('discord-welcome-image')
const WELCOME_CHANNEL_ID = 'CHANNEL ID';

client.on('guildMemberAdd', async member => {

  const user = await member.user.fetch();

  const welcomeBuffer = await generateWelcomeImage({
  member, //Banner & Avatar & Name this is 100% OBLIGATORY
  circularAvatar: true, //Circular or square avatar display
  showDate: true, //Show date true or false
  border: true, //Border true or false
  borderColor: ['#00ff00', '#ff00ff'], //Array or String
  gradientDirection: 'horizontal', //horizontal, vertical, diagonal
  maxNameLength: 11, //Max lenght of username
  welcomeText: 'Welcome', //Custom message
  blurBackground: true, //Backgroun blur
  });

  const attachment = new AttachmentBuilder(welcomeBuffer, { name: 'welcome.png' });

  const channel = member.guild.channels.cache.get(WELCOME_CHANNEL_ID);
  if (channel) {
    channel.send({ files: [attachment], content: `๐ŸŽ‰ ยกBienvenido/a <@${member.id}>!` });
  }
});



Not BackgroundURL

Example

BackgroundURL & GradientColor

Example