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); |
Skyler Grey | 75ea917 | 2022-08-06 10:22:23 +0100 | [diff] [blame] | 9 | statsChannelAdd(_, member); |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 10 | const { log, NucleusColors, entry, renderUser, renderDelta } = member.client.logger; |
| 11 | await client.database.history.create("join", member.guild.id, member.user, null, null); |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 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)), |
Skyler Grey | 11236ba | 2022-08-08 21:13:33 +0100 | [diff] [blame] | 25 | accountCreated: entry(member.user.createdAt, renderDelta(member.user.createdAt)), |
pineafan | 63fc5e2 | 2022-08-04 22:04:10 +0100 | [diff] [blame] | 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 | } |