Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- client.on("guildMemberAdd", async (member) => {
- var botCount=0;
- var userCount=0;
- client.guilds.find("id",config.guildID).members.forEach((member) => {
- if(member.user.bot) botCount++;
- if(!member.user.bot) userCount++;
- });
- client.guilds.find("id",config.guildID).channels.find("id",config.memberCountStatsChannel).edit({name:`Member Count: ${client.guilds.find("id",config.guildID).memberCount}`}, "stats");
- client.guilds.find("id",config.guildID).channels.find("id",config.botCountStatsChannel).edit({name:`Bot Count: ${botCount}`}, "stats");
- client.guilds.find("id",config.guildID).channels.find("id",config.userCountStatsChannel).edit({name:`User Count: ${userCount}`}, "stats");
- if(member.user.bot) return;
- changeNames();
- var look=await client.guilds.find("id",config.guildID).channels.find("name",member.id);
- if(!look) {
- var ch = await client.guilds.find("id",config.guildID).createChannel(member.id,"text",[{allow:"379968",deny:"805449745",id:member.id},{allow:"0",deny:"1024",id:config.roles.everyone.id},{allow:"805829713",deny:0,id:client.user.id},{allow:"519248",deny:"805310465",id:config.roles.staff.id}],`Registration: ${member.user.tag}`);
- ch.setParent(config.registrationCategory);
- var a = await ch.send(`<@!${member.id}>, Welcome to your registration channel! Please use the command **$register** to begin the registration process!\n\nIf the registration stops working, or times out, start over!`);
- a.pin();
- member.send(`Welcome to **${member.guild.name}**! Please go to the channel <#${ch.id}> to register!`);
- } else {
- look.overwritePermissions(member.id, {
- CREATE_INSTANT_INVITE: false,
- MANAGE_CHANNELS: false,
- MANAGE_ROLES: false,
- MANAGE_WEBHOOKS: false,
- VIEW_CHANNEL: true,
- SEND_MESSAGES: true,
- SEND_TTS_MESSAGES: false,
- MANAGE_MESSAGES: false,
- EMBED_LINKS: true,
- ATTACH_FILES: true,
- READ_MESSAGE_HISTORY: true,
- MENTION_EVERYONE: false,
- USE_EXTERNAL_EMOJIS: true,
- ADD_REACTIONS: true
- }, `Registration: ${member.user.tag}`);
- look.overwritePermissions(config.roles.everyone.id, {READ_MESSAGES: false}, `Registration: ${member.user.tag}`);
- look.overwritePermissions(client.user.id, {
- CREATE_INSTANT_INVITE: true,
- MANAGE_CHANNELS: true,
- MANAGE_ROLES: true,
- MANAGE_WEBHOOKS: true,
- VIEW_CHANNEL: true,
- SEND_MESSAGES: true,
- SEND_TTS_MESSAGES: true,
- MANAGE_MESSAGES: true,
- EMBED_LINKS: true,
- ATTACH_FILES: true,
- READ_MESSAGE_HISTORY: true,
- MENTION_EVERYONE: true,
- USE_EXTERNAL_EMOJIS: true,
- ADD_REACTIONS: true
- }, `Registration: ${member.user.tag}`);
- look.overwritePermissions(config.roles.staff.id, {
- CREATE_INSTANT_INVITE: false,
- MANAGE_CHANNELS: true,
- MANAGE_ROLES: false,
- MANAGE_WEBHOOKS: false,
- VIEW_CHANNEL: true,
- SEND_MESSAGES: true,
- SEND_TTS_MESSAGES: false,
- MANAGE_MESSAGES: true,
- EMBED_LINKS: true,
- ATTACH_FILES: true,
- READ_MESSAGE_HISTORY: true,
- MENTION_EVERYONE: true,
- USE_EXTERNAL_EMOJIS: true,
- ADD_REACTIONS: true
- }, `Registration: ${member.user.tag}`);
- var a = await look.send("Welcome to your registration channel! This is currently a work in progress, so please go to <#452586108556017704>!");
- a.pin();
- member.send(`Welcome to **${member.guild.name}**! Please go to the channel <#${look.id}> to register!`);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement