
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
welcome-canvas
Advanced tools
welcome-canvas is a powerful canvas project with high-quality design
Welcome-Canvas is a Node.js module for creating customized welcome images for Discord servers. It allows you to generate beautiful welcome images with user avatars, usernames, and a custom message.
You can install Welcome-Canvas via npm:
npm install welcome-canvas
Here's an example of how to use Welcome-Canvas in your Discord bot:
const { Client, GatewayIntentBits } = require('discord.js');
const { Welcome } = require('welcome-canvas');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
],
});
// Remove "//" if you need multiple backgrounds
// const backgroundImages = [
// 'your png background link here',
// 'your png background link here',
// 'your png background link here',
// 'your png background link here',
// ];
// let currentBackgroundIndex = 0;
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});
client.on('guildMemberAdd', async (member) => {
const channelId = '1157243263728762900'; // Replace with the desired channel ID
const channel = await client.channels.fetch(channelId); // Fetch the channel by ID
if (channel) {
const welcomeCard = new Welcome()
.setName(member.user.username) // To change the color of the text, use this .setName(member.user.username , '#FFFFFF') You can replace with your own hex code
.setAvatar(member.user.displayAvatarURL({ format: 'png' }))
.setTitle('Welcome') // To change the color of the text, use this .setTitle('Welcome`, '#FFFFFF') You can replace with your own hex code
.setMessage(`You are our ${member.guild.memberCount} Member`) // To change the color of the text, use this .setMessage(`You are our ${member.guild.memberCount} Member`, '#FFFFFF') You can replace with your own hex code
// Remove "//" if you have added background
// .setBackground(backgroundImages[currentBackgroundIndex]);
const welcomeImageBuffer = await welcomeCard.build();
channel.send({ files: [welcomeImageBuffer] });
// Remove "//" if you have multiple backgrounds and want a different background every time
// currentBackgroundIndex = (currentBackgroundIndex + 1) % backgroundImages.length;
}
});
client.login("Bot_Token_Here")
options
(Object) - An object with the following optional properties:
username
(String) - The username to display on the welcome card.avatar
(String) - The URL of the user's avatar.title
(String) - The title text on the welcome card.message
(String) - The message to display on the welcome card.background
(String) - The background to display on the welcome card.usernameColor
(String) - (Optional) The color for the username text (default is #FFD700).titleColor
(String) - (Optional) The color for the title text (default is #00BFFF).messageColor
(String) - (Optional) The color for the message text (default is #FFFFFF).This project is licensed under the MIT License - see the LICENSE file for details.
This module is based on napi-rs/canvas for canvas rendering.
If you have any questions or suggestions, feel free to contact us.
FAQs
welcome-canvas is a powerful canvas project with high-quality design
The npm package welcome-canvas receives a total of 0 weekly downloads. As such, welcome-canvas popularity was classified as not popular.
We found that welcome-canvas demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.