djs-selfbot-v13 3.7.18 → 3.7.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "djs-selfbot-v13",
3
- "version": "3.7.18",
3
+ "version": "3.7.19",
4
4
  "description": "An unofficial discord.js fork for creating selfbots",
5
5
  "main": "./src/index.js",
6
6
  "types": "./typings/index.d.ts",
@@ -780,23 +780,28 @@ class ClientUser extends User {
780
780
 
781
781
  const data = await this.client.api.users(userId).profile.get({ query });
782
782
 
783
+ // Résoudre l'objet User
784
+ const user = this.client.users._add(data.user);
785
+
786
+ // Résoudre le GuildMember si présent
787
+ let member = null;
788
+ if (data.guild_member) {
789
+ const resolvedGuildId = guildId ?? data.guild_member_profile?.guild_id;
790
+ const guild = resolvedGuildId ? this.client.guilds.cache.get(resolvedGuildId) : null;
791
+ if (guild) {
792
+ member = guild.members._add({
793
+ ...data.guild_member,
794
+ user: data.guild_member.user ?? data.user,
795
+ });
796
+ }
797
+ }
798
+
799
+ // Résoudre les mutual friends en vrais User
800
+ const mutualFriends = (data.mutual_friends ?? []).map(u => this.client.users._add(u));
801
+
783
802
  return {
784
- user: {
785
- id: data.user.id,
786
- username: data.user.username,
787
- globalName: data.user.global_name,
788
- avatar: data.user.avatar,
789
- avatarDecorationData: data.user.avatar_decoration_data ?? null,
790
- discriminator: data.user.discriminator,
791
- publicFlags: data.user.public_flags,
792
- primaryGuild: data.user.primary_guild ?? null,
793
- banner: data.user.banner ?? null,
794
- bannerColor: data.user.banner_color ?? null,
795
- accentColor: data.user.accent_color ?? null,
796
- bio: data.user.bio ?? null,
797
- displayNameStyles: data.user.display_name_styles ?? null,
798
- collectibles: data.user.collectibles ?? null,
799
- },
803
+ user,
804
+ member,
800
805
  profile: {
801
806
  bio: data.user_profile?.bio ?? null,
802
807
  accentColor: data.user_profile?.accent_color ?? null,
@@ -812,39 +817,14 @@ class ClientUser extends User {
812
817
  badges: data.badges ?? [],
813
818
  guildBadges: data.guild_badges ?? [],
814
819
  connectedAccounts: data.connected_accounts ?? [],
815
- mutualFriends: data.mutual_friends ?? [],
820
+ mutualFriends,
816
821
  mutualFriendsCount: data.mutual_friends_count ?? 0,
817
822
  mutualGuilds: data.mutual_guilds ?? [],
818
823
  widgets: data.widgets ?? [],
819
- guildMember: data.guild_member ? {
820
- avatar: data.guild_member.avatar ?? null,
821
- banner: data.guild_member.banner ?? null,
822
- nick: data.guild_member.nick ?? null,
823
- roles: data.guild_member.roles ?? [],
824
- joinedAt: data.guild_member.joined_at ? new Date(data.guild_member.joined_at) : null,
825
- premiumSince: data.guild_member.premium_since ? new Date(data.guild_member.premium_since) : null,
826
- pending: data.guild_member.pending ?? false,
827
- flags: data.guild_member.flags ?? 0,
828
- communicationDisabledUntil: data.guild_member.communication_disabled_until
829
- ? new Date(data.guild_member.communication_disabled_until)
830
- : null,
831
- bio: data.guild_member.bio ?? null,
832
- mute: data.guild_member.mute ?? false,
833
- deaf: data.guild_member.deaf ?? false,
834
- } : null,
835
- guildMemberProfile: data.guild_member_profile ? {
836
- guildId: data.guild_member_profile.guild_id,
837
- bio: data.guild_member_profile.bio ?? null,
838
- pronouns: data.guild_member_profile.pronouns ?? null,
839
- banner: data.guild_member_profile.banner ?? null,
840
- accentColor: data.guild_member_profile.accent_color ?? null,
841
- themeColors: data.guild_member_profile.theme_colors ?? null,
842
- profileEffect: data.guild_member_profile.profile_effect ?? null,
843
- emoji: data.guild_member_profile.emoji ?? null,
844
- } : null,
824
+ wishlistSettings: data.wishlist_settings ?? null,
825
+ guildMemberProfile: data.guild_member_profile ?? null,
845
826
  legacyUsername: data.legacy_username ?? null,
846
827
  };
847
828
  }
848
829
  }
849
-
850
830
  module.exports = ClientUser;