djs-selfbot-v13 3.7.10 → 3.7.11

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.10",
3
+ "version": "3.7.11",
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/002-sans/djs-selfbot-v13.git"
32
+ "url": "git+https://github.com/aiko-chan-ai/djs-selfbot-v13.git"
33
33
  },
34
34
  "keywords": [
35
35
  "discord.js",
@@ -47,9 +47,9 @@
47
47
  "author": "aiko-chan-ai",
48
48
  "license": "GNU General Public License v3.0",
49
49
  "bugs": {
50
- "url": "https://github.com/002-sans/djs-selfbot-v13/issues"
50
+ "url": "https://github.com/aiko-chan-ai/djs-selfbot-v13/issues"
51
51
  },
52
- "homepage": "https://github.com/002-sans/djs-selfbot-v13#readme",
52
+ "homepage": "https://github.com/aiko-chan-ai/djs-selfbot-v13#readme",
53
53
  "dependencies": {
54
54
  "@discordjs/builders": "^1.6.3",
55
55
  "@discordjs/collection": "^2.1.1",
@@ -471,6 +471,35 @@ class Client extends BaseClient {
471
471
  return new Sticker(this, data);
472
472
  }
473
473
 
474
+ /**
475
+ * Fetches a user using a bot token.
476
+ * @param {UserResolvable} user The user to fetch
477
+ * @param {string} botToken The bot token to use for the request
478
+ * @returns {Promise<User>}
479
+ * @example
480
+ * client.fetchUserWithBot('123456789012345678', 'Bot YOUR_BOT_TOKEN')
481
+ * .then(user => console.log(`Fetched user: ${user.tag}`))
482
+ * .catch(console.error);
483
+ */
484
+ async fetchUserWithBot(user, botToken) {
485
+ const id = this.users.resolveId(user);
486
+ if (!id) throw new TypeError('INVALID_TYPE', 'user', 'UserResolvable');
487
+
488
+ // Clean the token (remove Bot prefix if present)
489
+ const cleanToken = botToken.replace(/^(Bot|Bearer)\s*/i, '');
490
+
491
+ // Make the API request with the provided bot token
492
+ const data = await this.api.users(id).get({
493
+ headers: {
494
+ Authorization: `Bot ${cleanToken}`
495
+ }
496
+ });
497
+
498
+ // Create and return the User object
499
+ const User = require('../structures/User');
500
+ return new User(this, data);
501
+ }
502
+
474
503
  /**
475
504
  * Obtains the list of sticker packs available to Nitro subscribers from Discord.
476
505
  * @returns {Promise<Collection<Snowflake, StickerPack>>}
@@ -19,7 +19,7 @@ class GuildMemberRemoveAction extends Action {
19
19
  * Emitted whenever a member leaves a guild, or is kicked.
20
20
  * @event Client#guildMemberRemove
21
21
  * @param {GuildMember} member The member that has left/been kicked from the guild
22
- * @deprecated See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information.
22
+ * @deprecated See {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/197 this issue} for more information.
23
23
  */
24
24
  if (shard.status === Status.READY) client.emit(Events.GUILD_MEMBER_REMOVE, member);
25
25
  }
@@ -25,7 +25,7 @@ class GuildMemberUpdateAction extends Action {
25
25
  * @event Client#guildMemberUpdate
26
26
  * @param {GuildMember} oldMember The member before the update
27
27
  * @param {GuildMember} newMember The member after the update
28
- * @deprecated See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information.
28
+ * @deprecated See {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/197 this issue} for more information.
29
29
  */
30
30
  if (shard.status === Status.READY && !member.equals(old)) client.emit(Events.GUILD_MEMBER_UPDATE, old, member);
31
31
  } else {
@@ -12,7 +12,7 @@ module.exports = (client, { d: data }, shard) => {
12
12
  * Emitted whenever a user joins a guild.
13
13
  * @event Client#guildMemberAdd
14
14
  * @param {GuildMember} member The member that has joined a guild
15
- * @deprecated See {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/197 this issue} for more information.
15
+ * @deprecated See {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/197 this issue} for more information.
16
16
  */
17
17
  client.emit(Events.GUILD_MEMBER_ADD, member);
18
18
  }
@@ -96,7 +96,7 @@ class QuestManager extends BaseManager {
96
96
  */
97
97
  async orbs() {
98
98
  const data = await this.client.api.users['@me']['virtual-currency'].balance.get();
99
- return data?.balance ?? null;
99
+ return data;
100
100
  }
101
101
 
102
102
  /**
@@ -161,7 +161,7 @@ class ThreadManager extends CachedManager {
161
161
  // Discord sends the thread id as id in this object
162
162
  for (const rawMember of rawThreads.members) client.channels.cache.get(rawMember.id)?.members._add(rawMember);
163
163
  // Patch firstMessage
164
- // According to https://github.com/aiko-chan-ai/discord.js-selfbot-v13/issues/1502, rawThreads.first_messages could be null.
164
+ // According to https://github.com/aiko-chan-ai/djs-selfbot-v13/issues/1502, rawThreads.first_messages could be null.
165
165
  for (const rawMessage of rawThreads?.first_messages || []) {
166
166
  client.channels.cache.get(rawMessage.id)?.messages._add(rawMessage);
167
167
  }
@@ -203,7 +203,7 @@ class ClientUser extends User {
203
203
  * @example
204
204
  * // Set the client user's presence
205
205
  * client.user.setPresence({ activities: [{ name: 'with discord.js' }], status: 'idle' });
206
- * @see {@link https://github.com/002-sans/djs-selfbot-v13/blob/main/Document/RichPresence.md}
206
+ * @see {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/blob/main/Document/RichPresence.md}
207
207
  */
208
208
  setPresence(data) {
209
209
  return this.client.presence.set(data);
@@ -248,7 +248,7 @@ class ClientUser extends User {
248
248
  * @example
249
249
  * // Set the client user's activity
250
250
  * client.user.setActivity('discord.js', { type: 'WATCHING' });
251
- * @see {@link https://github.com/002-sans/djs-selfbot-v13/blob/main/Document/RichPresence.md}
251
+ * @see {@link https://github.com/aiko-chan-ai/djs-selfbot-v13/blob/main/Document/RichPresence.md}
252
252
  */
253
253
  setActivity(name, options = {}) {
254
254
  if (!name) return this.setPresence({ activities: [], shardId: options.shardId });
@@ -635,7 +635,7 @@ class ClientUser extends User {
635
635
  * @returns {Promise<ClientUser>}
636
636
  */
637
637
  setClan(guild) {
638
- const id = this.client.guilds.resolveId(guild);
638
+ const id = this.guilds.resolveId(guild);
639
639
  if (!id) throw new TypeError('INVALID_TYPE', 'guild', 'GuildResolvable');
640
640
 
641
641
  return this.client.api.users['@me'].clan.put({ data: { identity_guild_id: id, identity_enabled: true } });
@@ -196,18 +196,18 @@ class Options extends null {
196
196
  os: 'Windows',
197
197
  browser: 'Discord Client',
198
198
  release_channel: 'stable',
199
- client_version: '1.0.9210',
200
- os_version: '10.0.19044',
199
+ client_version: '1.0.9215',
200
+ os_version: '10.0.19045',
201
201
  os_arch: 'x64',
202
202
  app_arch: 'x64',
203
203
  system_locale: 'en-US',
204
204
  has_client_mods: false,
205
205
  client_launch_id: randomUUID(),
206
206
  browser_user_agent: UserAgent,
207
- browser_version: '35.3.0',
208
- os_sdk_version: '19044',
209
- client_build_number: 455964,
210
- native_build_number: 69976,
207
+ browser_version: '37.6.0',
208
+ os_sdk_version: '19045',
209
+ client_build_number: 471091,
210
+ native_build_number: 72186,
211
211
  client_event_source: null,
212
212
  launch_signature: randomUUID(),
213
213
  client_heartbeat_session_id: randomUUID(),
@@ -883,6 +883,7 @@ export class Client<Ready extends boolean = boolean> extends BaseClient {
883
883
  public fetchGuildTemplate(template: GuildTemplateResolvable): Promise<GuildTemplate>;
884
884
  public fetchVoiceRegions(): Promise<Collection<string, VoiceRegion>>;
885
885
  public fetchSticker(id: Snowflake): Promise<Sticker>;
886
+ public fetchUserWithBot(user: UserResolvable, botToken: string): Promise<User>;
886
887
  public fetchPremiumStickerPacks(): Promise<Collection<Snowflake, StickerPack>>;
887
888
  public fetchWebhook(id: Snowflake, token?: string): Promise<Webhook>;
888
889
  public fetchGuildWidget(guild: GuildResolvable): Promise<Widget>;