diff --git a/package-lock.json b/package-lock.json index f17cb0d2..b5ac7183 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@sentry/node": "^7.51.2", - "@togethercrew.dev/db": "^2.4.93", + "@togethercrew.dev/db": "^2.4.95", "@togethercrew.dev/tc-messagebroker": "^0.0.40", "babel-jest": "^29.5.0", "bullmq": "^3.14.0", @@ -2993,9 +2993,9 @@ } }, "node_modules/@togethercrew.dev/db": { - "version": "2.4.93", - "resolved": "https://registry.npmjs.org/@togethercrew.dev/db/-/db-2.4.93.tgz", - "integrity": "sha512-rFtByGDsfFJzflVol80osMPNY3wPMEUz9LRZd0Y6TBYrGlFa7aHXzkaQq286Wrr7Ff1eZtVxlo920VeXy0e7qg==", + "version": "2.4.95", + "resolved": "https://registry.npmjs.org/@togethercrew.dev/db/-/db-2.4.95.tgz", + "integrity": "sha512-aMOFGnL0dK3YZU/Ha5FfyJvp25yexqWlUmS4v8CB+IzAq8V1RdtZK5vdVx+lDz9XUL40hlMLQzNRfDoJiqMv8w==", "dependencies": { "discord.js": "^14.7.1", "joi": "^17.7.0", diff --git a/package.json b/package.json index 5de15984..26316bd6 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "homepage": "https://github.com/Behzad-rabiei/tc-discordBot#readme", "dependencies": { "@sentry/node": "^7.51.2", - "@togethercrew.dev/db": "^2.4.93", + "@togethercrew.dev/db": "^2.4.95", "@togethercrew.dev/tc-messagebroker": "^0.0.40", "babel-jest": "^29.5.0", "bullmq": "^3.14.0", diff --git a/src/events/member/guildMemberAdd.ts b/src/events/member/guildMemberAdd.ts index af68d0db..0415b960 100644 --- a/src/events/member/guildMemberAdd.ts +++ b/src/events/member/guildMemberAdd.ts @@ -21,7 +21,9 @@ export default { joinedAt: member.joinedAt, roles: member.roles.cache.map(role => role.id), discriminator: member.user.discriminator, - deletedAt: null + deletedAt: null, + permissions: member.permissions.bitfield.toString(), + nickname: member.nickname } ); } @@ -34,7 +36,8 @@ export default { roles: member.roles.cache.map(role => role.id), isBot: member.user.bot, discriminator: member.user.discriminator, - permissions: member.permissions.bitfield.toString() + permissions: member.permissions.bitfield.toString(), + nickname: member.nickname }); } await closeConnection(connection) diff --git a/src/events/member/guildMemberUpdate.ts b/src/events/member/guildMemberUpdate.ts index 53343c99..a36edfad 100644 --- a/src/events/member/guildMemberUpdate.ts +++ b/src/events/member/guildMemberUpdate.ts @@ -19,6 +19,8 @@ export default { joinedAt: newMember.joinedAt, roles: newMember.roles.cache.map(role => role.id), discriminator: newMember.user.discriminator, + nickname: newMember.nickname, + permissions: newMember.permissions.bitfield.toString(), } ); if (!guildMember) { @@ -30,6 +32,8 @@ export default { roles: newMember.roles.cache.map(role => role.id), isBot: newMember.user.bot, discriminator: newMember.user.discriminator, + nickname: newMember.nickname, + permissions: newMember.permissions.bitfield.toString(), }); } await closeConnection(connection) diff --git a/src/functions/fetchMembers.ts b/src/functions/fetchMembers.ts index e1a64d0c..1eae8b85 100644 --- a/src/functions/fetchMembers.ts +++ b/src/functions/fetchMembers.ts @@ -17,7 +17,8 @@ function getNeedDataFromGuildMember(guildMember: GuildMember): IGuildMember { roles: guildMember.roles.cache.map(role => role.id), isBot: guildMember.user.bot, discriminator: guildMember.user.discriminator, - permissions: guildMember.permissions.bitfield.toString() + permissions: guildMember.permissions.bitfield.toString(), + nickname: guildMember.nickname }; }