pineafan | 3276721 | 2022-03-14 21:27:39 +0000 | [diff] [blame^] | 1 | import { callback as statsChannelAdd } from '../automations/statsChannelAdd.js'; |
| 2 | import { callback as welcome } from '../automations/welcome.js'; |
| 3 | import log from '../utils/log.js'; |
| 4 | export const event = 'guildMemberAdd' |
| 5 | |
| 6 | export async function callback(_, member) { |
| 7 | try { welcome(_, member); } catch {} |
| 8 | try { statsChannelAdd(_, member); } catch {} |
| 9 | try { |
| 10 | const { log, NucleusColors, entry, renderUser, renderDelta } = member.client.logger |
| 11 | let data = { |
| 12 | meta: { |
| 13 | type: 'memberJoin', |
| 14 | displayName: 'Member Joined', |
| 15 | calculateType: 'guildMemberUpdate', |
| 16 | color: NucleusColors.green, |
| 17 | emoji: "MEMBER" + (member.user.bot ? ".BOT" : "") + ".JOIN", |
| 18 | timestamp: member.joinedTimestamp |
| 19 | }, |
| 20 | list: { |
| 21 | id: entry(member.id, `\`${member.id}\``), |
| 22 | name: entry(member.id, renderUser(member.user)), |
| 23 | joined: entry(member.joinedAt, renderDelta(member.joinedAt)), |
| 24 | accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)), |
| 25 | serverMemberCount: member.guild.memberCount, |
| 26 | }, |
| 27 | hidden: { |
| 28 | guild: member.guild.id |
| 29 | } |
| 30 | } |
| 31 | log(data, member.client); |
| 32 | } catch {} |
| 33 | } |