discord-sb.js 1.0.3 → 1.0.5
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/README.md +19 -0
- package/package.json +5 -5
- package/src/managers/UserManager.js +23 -1
- package/src/structures/ClientUser.js +11 -0
- package/src/structures/User.js +20 -0
- package/typings/index.d.ts +5 -2
package/README.md
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
> [!IMPORTANT]
|
|
2
2
|
> **This project is a fork of the [discord.js-selfbot-v13](https://github.com/aiko-chan-ai/discord.js-selfbot-v13) an archived project.**
|
|
3
|
+
|
|
4
|
+
# discord.js-selfbot-v13 (fork)
|
|
5
|
+
|
|
6
|
+
Small additions focused on profile data and account integrations.
|
|
7
|
+
|
|
8
|
+
## Nouveautés
|
|
9
|
+
- Les fetchs de users remontent désormais la bio/pronoms quand disponible (via `/users/{id}/profile`).
|
|
10
|
+
- `client.user.fetchConnections({ includeMetadata })` pour récupérer vos connexions (Spotify, Steam, etc.) avec métadonnées quand l’API les expose.
|
|
11
|
+
|
|
12
|
+
## Exemples rapides
|
|
13
|
+
```js
|
|
14
|
+
// Récupérer la bio d'un user
|
|
15
|
+
const user = await client.users.fetch('123456789012345678');
|
|
16
|
+
console.log(user.bio, user.pronouns);
|
|
17
|
+
|
|
18
|
+
// Lister vos connexions avec métadonnées
|
|
19
|
+
const connections = await client.user.fetchConnections();
|
|
20
|
+
console.log(connections);
|
|
21
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "discord-sb.js",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "An unofficial discord.js fork for creating selfbots",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./typings/index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"repository": {
|
|
31
31
|
"type": "git",
|
|
32
|
-
"url": "git+https://github.com/
|
|
32
|
+
"url": "git+https://github.com/sqlu/discord-selfbot.js.git"
|
|
33
33
|
},
|
|
34
34
|
"keywords": [
|
|
35
35
|
"discord.js",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"client",
|
|
45
45
|
"discordapp"
|
|
46
46
|
],
|
|
47
|
-
"author": "
|
|
47
|
+
"author": "Snayz",
|
|
48
48
|
"license": "GNU General Public License v3.0",
|
|
49
49
|
"bugs": {
|
|
50
|
-
"url": "https://github.com/
|
|
50
|
+
"url": "https://github.com/sqlu/discord-selfbot.js/issues"
|
|
51
51
|
},
|
|
52
|
-
"homepage": "https://github.com/
|
|
52
|
+
"homepage": "https://github.com/sqlu/discord-selfbot.js#readme",
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@discordjs/builders": "^1.6.3",
|
|
55
55
|
"@discordjs/collection": "^2.1.1",
|
|
@@ -92,10 +92,32 @@ class UserManager extends CachedManager {
|
|
|
92
92
|
const id = this.resolveId(user);
|
|
93
93
|
if (!force) {
|
|
94
94
|
const existing = this.cache.get(id);
|
|
95
|
-
if (existing && !existing.partial) return existing;
|
|
95
|
+
if (existing && !existing.partial && typeof existing.bio !== 'undefined') return existing;
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
+
const profilePromise = this.client.api
|
|
99
|
+
.users(id)
|
|
100
|
+
.profile.get({
|
|
101
|
+
query: {
|
|
102
|
+
with_mutual_guilds: true,
|
|
103
|
+
with_mutual_friends: true,
|
|
104
|
+
with_mutual_friends_count: true,
|
|
105
|
+
},
|
|
106
|
+
})
|
|
107
|
+
.catch(() => null);
|
|
108
|
+
|
|
98
109
|
const data = await this.client.api.users(id).get();
|
|
110
|
+
const profile = await profilePromise;
|
|
111
|
+
if (profile?.user_profile) {
|
|
112
|
+
data.bio = profile.user_profile.bio ?? null;
|
|
113
|
+
if (typeof profile.user_profile.pronouns !== 'undefined') data.pronouns = profile.user_profile.pronouns;
|
|
114
|
+
if (typeof profile.user_profile.banner !== 'undefined' && typeof data.banner === 'undefined') {
|
|
115
|
+
data.banner = profile.user_profile.banner;
|
|
116
|
+
}
|
|
117
|
+
if (typeof profile.user_profile.accent_color !== 'undefined' && typeof data.accent_color === 'undefined') {
|
|
118
|
+
data.accent_color = profile.user_profile.accent_color;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
99
121
|
return this._add(data, cache);
|
|
100
122
|
}
|
|
101
123
|
|
|
@@ -486,6 +486,17 @@ class ClientUser extends User {
|
|
|
486
486
|
return this.edit({ pronouns });
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
+
/**
|
|
490
|
+
* Fetches all of the logged-in user's connected accounts (Spotify, Steam, etc.).
|
|
491
|
+
* @param {Object} [options] Options for fetching connections
|
|
492
|
+
* @param {boolean} [options.includeMetadata=true] Whether to include provider metadata when available
|
|
493
|
+
* @returns {Promise<Object[]>}
|
|
494
|
+
*/
|
|
495
|
+
async fetchConnections({ includeMetadata = true } = {}) {
|
|
496
|
+
const query = includeMetadata ? { include_metadata: true } : {};
|
|
497
|
+
return this.client.api.users['@me'].connections.get({ query });
|
|
498
|
+
}
|
|
499
|
+
|
|
489
500
|
/**
|
|
490
501
|
* Add a widget to the user's profile
|
|
491
502
|
* @param {string} type Widget type (favorite_games, current_games, played_games, want_to_play_games)
|
package/src/structures/User.js
CHANGED
|
@@ -118,6 +118,24 @@ class User extends Base {
|
|
|
118
118
|
this.accentColor ??= undefined;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
if ('bio' in data) {
|
|
122
|
+
/**
|
|
123
|
+
* The user's bio
|
|
124
|
+
* <info>The user must be force fetched for this property to be present or be updated</info>
|
|
125
|
+
* @type {?string}
|
|
126
|
+
*/
|
|
127
|
+
this.bio = data.bio;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if ('pronouns' in data) {
|
|
131
|
+
/**
|
|
132
|
+
* The user's pronouns
|
|
133
|
+
* <info>The user must be force fetched for this property to be present or be updated</info>
|
|
134
|
+
* @type {?string}
|
|
135
|
+
*/
|
|
136
|
+
this.pronouns = data.pronouns;
|
|
137
|
+
}
|
|
138
|
+
|
|
121
139
|
if ('system' in data) {
|
|
122
140
|
/**
|
|
123
141
|
* Whether the user is an Official Discord System user (part of the urgent message system)
|
|
@@ -437,6 +455,8 @@ class User extends Base {
|
|
|
437
455
|
this.flags?.bitfield === user.flags?.bitfield &&
|
|
438
456
|
this.banner === user.banner &&
|
|
439
457
|
this.accentColor === user.accentColor &&
|
|
458
|
+
this.bio === user.bio &&
|
|
459
|
+
this.pronouns === user.pronouns &&
|
|
440
460
|
this.avatarDecorationData?.asset === user.avatarDecorationData?.asset &&
|
|
441
461
|
this.avatarDecorationData?.skuId === user.avatarDecorationData?.skuId &&
|
|
442
462
|
this.collectibles?.nameplate?.skuId === user.collectibles?.nameplate?.skuId &&
|
package/typings/index.d.ts
CHANGED
|
@@ -1019,8 +1019,8 @@ export class ClientUser extends User {
|
|
|
1019
1019
|
public phone: string | null;
|
|
1020
1020
|
public nsfwAllowed?: boolean;
|
|
1021
1021
|
public email: string | null;
|
|
1022
|
-
public bio?: string;
|
|
1023
|
-
public pronouns?: string;
|
|
1022
|
+
public bio?: string | null;
|
|
1023
|
+
public pronouns?: string | null;
|
|
1024
1024
|
public premiumType: number;
|
|
1025
1025
|
public setBanner(banner: BufferResolvable | Base64Resolvable | null): Promise<this>;
|
|
1026
1026
|
public setHypeSquad(
|
|
@@ -1032,6 +1032,7 @@ export class ClientUser extends User {
|
|
|
1032
1032
|
public getAllFriendInvites(): Promise<Collection<string, Invite>>;
|
|
1033
1033
|
public revokeAllFriendInvites(): Promise<void>;
|
|
1034
1034
|
public setSamsungActivity(packageName: string, type: 'START' | 'UPDATE' | 'STOP'): Promise<this>;
|
|
1035
|
+
public fetchConnections(options?: { includeMetadata?: boolean }): Promise<any[]>;
|
|
1035
1036
|
public stopRinging(channel: ChannelResolvable): Promise<void>;
|
|
1036
1037
|
public fetchBurstCredit(): Promise<number>;
|
|
1037
1038
|
public setPronouns(pronouns?: string | null): Promise<this>;
|
|
@@ -3991,6 +3992,7 @@ export class User extends PartialTextBasedChannel(Base) {
|
|
|
3991
3992
|
private _equals(user: APIUser): boolean;
|
|
3992
3993
|
|
|
3993
3994
|
public accentColor: number | null | undefined;
|
|
3995
|
+
public bio?: string | null;
|
|
3994
3996
|
public avatar: string | null;
|
|
3995
3997
|
/** @deprecated Use {@link User.avatarDecorationData} instead */
|
|
3996
3998
|
public readonly avatarDecoration: string | null;
|
|
@@ -4002,6 +4004,7 @@ export class User extends PartialTextBasedChannel(Base) {
|
|
|
4002
4004
|
public readonly createdTimestamp: number;
|
|
4003
4005
|
public collectibles: Collectibles | null;
|
|
4004
4006
|
public discriminator: string;
|
|
4007
|
+
public pronouns?: string | null;
|
|
4005
4008
|
public readonly displayName: string;
|
|
4006
4009
|
public readonly defaultAvatarURL: string;
|
|
4007
4010
|
public readonly dmChannel: DMChannel | null;
|