djs-selfbot-v13 3.7.18 → 3.7.20

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.20",
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;
@@ -1003,22 +1003,9 @@ export interface FetchUserProfileOptions {
1003
1003
  }
1004
1004
 
1005
1005
  export interface UserProfile {
1006
- user: {
1007
- id: Snowflake;
1008
- username: string;
1009
- globalName: string | null;
1010
- avatar: string | null;
1011
- avatarDecorationData: AvatarDecorationData | null;
1012
- discriminator: string;
1013
- publicFlags: number;
1014
- primaryGuild: UserPrimaryGuild | null;
1015
- banner: string | null;
1016
- bannerColor: string | null;
1017
- accentColor: number | null;
1018
- bio: string | null;
1019
- displayNameStyles: { font_id: number; effect_id: number; colors: number[] } | null;
1020
- collectibles: Collectibles | null;
1021
- };
1006
+ user: User;
1007
+ member: GuildMember | null;
1008
+ mutualFriends: User[];
1022
1009
  profile: {
1023
1010
  bio: string | null;
1024
1011
  accentColor: number | null;
@@ -1034,24 +1021,9 @@ export interface UserProfile {
1034
1021
  badges: { id: string; description: string; icon: string; link?: string }[];
1035
1022
  guildBadges: unknown[];
1036
1023
  connectedAccounts: { type: string; id: string; name: string; verified: boolean }[];
1037
- mutualFriends: unknown[];
1038
1024
  mutualFriendsCount: number;
1039
1025
  mutualGuilds: { id: Snowflake; nick: string | null }[];
1040
1026
  widgets: unknown[];
1041
- guildMember: {
1042
- avatar: string | null;
1043
- banner: string | null;
1044
- nick: string | null;
1045
- roles: Snowflake[];
1046
- joinedAt: Date | null;
1047
- premiumSince: Date | null;
1048
- pending: boolean;
1049
- flags: number;
1050
- communicationDisabledUntil: Date | null;
1051
- bio: string | null;
1052
- mute: boolean;
1053
- deaf: boolean;
1054
- } | null;
1055
1027
  guildMemberProfile: {
1056
1028
  guildId: Snowflake;
1057
1029
  bio: string | null;