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