Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module.exports = {
- name: Events.GuildMemberAdd,
- once: false,
- async execute(interaction, client) {
- const member = interaction.member ?? interaction.user;
- const images = [];
- fs.readdirSync("./assets/welcomeimages/").forEach((file) => {
- let month = moment().month();
- if (month === 12) {
- if (file.includes("christmas")) {
- images.push(
- `https://sfmbot.simulator.fm/assets/welcomeimages/${file}`
- );
- }
- } else if (month === 11) {
- if (file.includes("halloween")) {
- images.push(
- `https://sfmbot.simulator.fm/assets/welcomeimages/${file}`
- );
- }
- } else {
- images.push(`https://sfmbot.simulator.fm/assets/welcomeimages/${file}`);
- }
- });
- const background = images[Math.floor(Math.random() * images.length)],
- avatar = member.displayAvatarURL(),
- color = "FFFFFF";
- let Image = await new noodles_api.welcomebanner()
- .setBackground(background)
- .setAvatar(avatar)
- .setTitle(member.username)
- .setSubtitle("Welcome to the server")
- .setTextColor(color)
- .build();
- const WImage = new AttachmentBuilder(Image);
- client.channels.cache.get("776056599177068560").send(
- `${client} Please read the rules found here <#776056599177068561>`,
- WImage
- );
- member.roles.add("776056599173267467");
- },
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement