necord 6.11.1-dev.1761741493.4936e2e → 6.11.2-dev.1761827818.fa52a10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [6.11.2](https://github.com/necordjs/necord/compare/v6.11.1...v6.11.2) (2025-10-30)
4
+
5
+ ### Features
6
+
7
+ * **CustomEventHandlers:** handleUserPrimaryGuildUpdate handler ([#1684](https://github.com/necordjs/necord/issues/1684)) ([e486e5e](https://github.com/necordjs/necord/commit/e486e5ef3ba290303293c3da4a4019cb77899df4))
8
+
3
9
  ## [6.11.1](https://github.com/necordjs/necord/compare/v6.11.0...v6.11.1) (2025-09-04)
4
10
 
5
11
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  import { BaseHandler } from './base.handler';
2
2
  import { ContextOf } from '../../context';
3
- import { User, UserFlagsBitField } from 'discord.js';
3
+ import { UserPrimaryGuild, User, UserFlagsBitField } from 'discord.js';
4
4
  export type CustomUserUpdateEvents = {
5
5
  userAvatarUpdate: [user: User, oldAvatar: string, newAvatar: string];
6
6
  userUsernameUpdate: [user: User, oldUsername: string, newUsername: string];
@@ -10,10 +10,16 @@ export type CustomUserUpdateEvents = {
10
10
  oldFlags: Readonly<UserFlagsBitField>,
11
11
  newFlags: Readonly<UserFlagsBitField>
12
12
  ];
13
+ userPrimaryGuildUpdate: [
14
+ user: User,
15
+ oldPrimaryGuild: UserPrimaryGuild,
16
+ newPrimaryGuild: UserPrimaryGuild
17
+ ];
13
18
  };
14
19
  export declare class UserUpdateHandler extends BaseHandler<CustomUserUpdateEvents> {
15
20
  handleUserAvatarUpdate([oldUser, newUser]: ContextOf<'userUpdate'>): void;
16
21
  handleUserUsernameUpdate([oldUser, newUser]: ContextOf<'userUpdate'>): void;
17
22
  handleUserDiscriminatorUpdate([oldUser, newUser]: ContextOf<'userUpdate'>): void;
18
23
  handleUserFlagsUpdate([oldUser, newUser]: ContextOf<'userUpdate'>): void;
24
+ handleUserPrimaryGuildUpdate([oldUser, newUser]: ContextOf<'userUpdate'>): void;
19
25
  }
@@ -34,6 +34,15 @@ let UserUpdateHandler = class UserUpdateHandler extends base_handler_1.BaseHandl
34
34
  this.emit('userFlagsUpdate', newUser, oldUser.flags, newUser.flags);
35
35
  }
36
36
  }
37
+ handleUserPrimaryGuildUpdate([oldUser, newUser]) {
38
+ if (oldUser.partial)
39
+ return;
40
+ const oldPrimaryGuild = JSON.stringify(oldUser.primaryGuild);
41
+ const newPrimaryGuild = JSON.stringify(newUser.primaryGuild);
42
+ if (oldPrimaryGuild !== newPrimaryGuild) {
43
+ this.emit('userPrimaryGuildUpdate', newUser, oldUser.primaryGuild, newUser.primaryGuild);
44
+ }
45
+ }
37
46
  };
38
47
  exports.UserUpdateHandler = UserUpdateHandler;
39
48
  tslib_1.__decorate([
@@ -60,6 +69,12 @@ tslib_1.__decorate([
60
69
  tslib_1.__metadata("design:paramtypes", [Object]),
61
70
  tslib_1.__metadata("design:returntype", void 0)
62
71
  ], UserUpdateHandler.prototype, "handleUserFlagsUpdate", null);
72
+ tslib_1.__decorate([
73
+ (0, decorators_1.CustomListenerHandler)(),
74
+ tslib_1.__metadata("design:type", Function),
75
+ tslib_1.__metadata("design:paramtypes", [Object]),
76
+ tslib_1.__metadata("design:returntype", void 0)
77
+ ], UserUpdateHandler.prototype, "handleUserPrimaryGuildUpdate", null);
63
78
  exports.UserUpdateHandler = UserUpdateHandler = tslib_1.__decorate([
64
79
  (0, common_1.Injectable)(),
65
80
  (0, decorators_1.CustomListener)('userUpdate')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "necord",
3
3
  "description": "A module for creating Discord bots using NestJS, based on Discord.js",
4
- "version": "6.11.1-dev.1761741493.4936e2e",
4
+ "version": "6.11.2-dev.1761827818.fa52a10",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && tsc -p tsconfig.build.json",
7
7
  "prepublish:npm": "npm run build",