djs-selfbot-v13 3.7.25 → 3.7.27

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 CHANGED
@@ -24,84 +24,6 @@
24
24
  </p>
25
25
  </div>
26
26
 
27
- <details>
28
- <summary><strong>New Features</strong></summary>
29
-
30
- ### Guild Management
31
- - `guild.mute(options?)` - Mute a guild completely (suppress all notifications)
32
- - `guild.unmute()` - Unmute a guild (restore all notifications)
33
- - `guild.markRead(readStates?)` - Mark all channels in a guild as read
34
-
35
- ### Developer Applications
36
- - `client.developers.get(withTeamApplications?)` - Fetch all developer applications owned by the user
37
- - `client.developers.list(withTeamApplications?)` - Alias for get() method
38
- - `client.developers.fetch(applicationId)` - Fetch a specific application by ID
39
- - `client.developers.edit(applicationId, data)` - Edit an application with custom data
40
- - `client.developers.setAvatar(applicationId, avatar)` - Set application avatar/icon
41
- - `client.developers.setName(applicationId, name)` - Set application name
42
- - `client.developers.setDescription(applicationId, description)` - Set application description
43
- - `client.developers.setTags(applicationId, tags)` - Set application tags (max 5)
44
- - `client.developers.addTag(applicationId, tag)` - Add a single tag to application
45
- - `client.developers.delTag(applicationId, tag)` - Remove a tag from application
46
- - `client.developers.enableIntents(applicationId)` - Enable bot intents for application
47
- - `client.developers.disableIntents(applicationId)` - Disable bot intents for application
48
-
49
- **Application Object Methods (Direct Usage):**
50
- - `application.edit(data)` - Edit the application
51
- - `application.setAvatar(avatar)` - Set application avatar/icon
52
- - `application.setName(name)` - Set application name
53
- - `application.setDescription(description)` - Set application description
54
- - `application.setTags(tags)` - Set application tags (max 5)
55
- - `application.addTag(tag)` - Add a single tag
56
- - `application.delTag(tag)` - Remove a tag
57
- - `application.enableIntents()` - Enable bot intents
58
- - `application.disableIntents()` - Disable bot intents
59
-
60
- ### RPC Enhancements
61
- - `rpc.setDetailsURL(url)` - Set a URL for RPC details (now fully functional)
62
- - `rpc.setStateURL(url)` - Set a URL for RPC state (now fully functional)
63
- - `rpc.details_url` - Property to access the details URL
64
- - `rpc.state_url` - Property to access the state URL
65
-
66
- ### User Profile Customization
67
- - `client.user.setNameStyle(fontName, effectName, color1, color2?)` - Set display name style with font, effect and colors
68
- - `client.user.setClan(GuildID)` - Change your server clan tag
69
- - `client.user.deleteClan()` - Remove server clan tag
70
-
71
- ### Profile Widgets
72
- - `client.user.addWidget(type, gameId, comment?, tags?)` - Add a game widget to profile
73
- - `client.user.delWidget(type, gameId?)` - Remove a widget or specific game
74
- - `client.user.widgetsList()` - Get list of all widgets
75
-
76
- ### Quest System
77
- - `client.quests.get()` - Fetch all available quests
78
- - `client.quests.orbs()` - Get virtual currency balance
79
- - `client.quests.acceptQuest(questId, options?)` - Accept a quest
80
- - `client.quests.doingQuest(quest)` - Auto-complete a quest
81
- - `client.quests.autoCompleteAll()` - Auto-complete all valid quests
82
- - `client.quests.getCompleted()` - Get completed quests
83
- - `client.quests.getClaimable()` - Get claimable quests
84
- - `client.quests.filterQuestsValid()` - Filter valid quests
85
-
86
- ### Message Search
87
- - `channel.search(options?)` - Search for messages in a channel with advanced filters
88
- - `authorId` - Search by specific author
89
- - `mentions` - Search for messages mentioning a user
90
- - `has` - Search for messages containing: `image`, `video`, `link`, `embed`, `sound`, `poll`, `sticker`, `snapshot`
91
- - `pinned` - Search only pinned messages
92
- - `sortBy` - Sort by `timestamp` or `relevance`
93
- - `sortOrder` - Sort order `desc` or `asc`
94
- - `offset` - Pagination offset
95
- - `limit` - Limit number of results
96
- - `maxTime` - Search for messages before a specific date/time
97
-
98
- - `guild.search(options?)` - Search for messages across the entire guild with advanced filters
99
- - `channelId` - Search in a specific channel within the guild
100
- - All other options same as `channel.search()`
101
-
102
-
103
- </details>
104
-
105
27
  > [!WARNING]
106
28
  > **I don't take any responsibility for blocked Discord accounts that used this module.**
107
29
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "djs-selfbot-v13",
3
- "version": "3.7.25",
3
+ "version": "3.7.27",
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,6 +29,8 @@ class ActionsManager {
29
29
  this.register(require('./GuildEmojiUpdate'));
30
30
  this.register(require('./GuildEmojisUpdate'));
31
31
  this.register(require('./GuildIntegrationsUpdate'));
32
+ this.register(require('./GuildJoinRequestCreate'));
33
+ this.register(require('./GuildJoinRequestDelete'));
32
34
  this.register(require('./GuildMemberRemove'));
33
35
  this.register(require('./GuildMemberUpdate'));
34
36
  this.register(require('./GuildRoleCreate'));
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ const Action = require('./Action');
4
+ const { Events } = require('../../util/Constants');
5
+
6
+ class GuildJoinRequestCreateAction extends Action {
7
+ handle(data) {
8
+ const client = this.client;
9
+ const guild = client.guilds.cache.get(data.guild_id);
10
+
11
+ if (guild) {
12
+ const requestData = data.request || data;
13
+ const joinRequest = guild.demandes._add(requestData);
14
+
15
+ /**
16
+ * Emitted whenever a join request is created.
17
+ * @event Client#guildJoinRequestCreate
18
+ * @param {GuildJoinRequest} joinRequest The created join request
19
+ */
20
+ client.emit(Events.GUILD_JOIN_REQUEST_CREATE, joinRequest);
21
+
22
+ return { joinRequest };
23
+ }
24
+
25
+ return {};
26
+ }
27
+ }
28
+
29
+ module.exports = GuildJoinRequestCreateAction;
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ const Action = require('./Action');
4
+ const { Events } = require('../../util/Constants');
5
+
6
+ class GuildJoinRequestDeleteAction extends Action {
7
+ handle(data) {
8
+ const client = this.client;
9
+ const guild = client.guilds.cache.get(data.guild_id);
10
+
11
+ if (guild) {
12
+ const joinRequest = guild.demandes.cache.get(data.user_id);
13
+ if (joinRequest) {
14
+ guild.demandes.cache.delete(data.user_id);
15
+
16
+ /**
17
+ * Emitted whenever a join request is deleted.
18
+ * @event Client#guildJoinRequestDelete
19
+ * @param {GuildJoinRequest} joinRequest The deleted join request
20
+ */
21
+ client.emit(Events.GUILD_JOIN_REQUEST_DELETE, joinRequest);
22
+
23
+ return { joinRequest };
24
+ }
25
+ }
26
+
27
+ return {};
28
+ }
29
+ }
30
+
31
+ module.exports = GuildJoinRequestDeleteAction;
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = (client, packet) => {
4
+ client.actions.GuildJoinRequestCreate.handle(packet.d);
5
+ };
@@ -0,0 +1,5 @@
1
+ 'use strict';
2
+
3
+ module.exports = (client, packet) => {
4
+ client.actions.GuildJoinRequestDelete.handle(packet.d);
5
+ };
@@ -21,6 +21,8 @@ const handlers = Object.fromEntries([
21
21
  ['GUILD_MEMBER_UPDATE', require('./GUILD_MEMBER_UPDATE')],
22
22
  ['GUILD_MEMBERS_CHUNK', require('./GUILD_MEMBERS_CHUNK')],
23
23
  ['GUILD_INTEGRATIONS_UPDATE', require('./GUILD_INTEGRATIONS_UPDATE')],
24
+ ['GUILD_JOIN_REQUEST_CREATE', require('./GUILD_JOIN_REQUEST_CREATE')],
25
+ ['GUILD_JOIN_REQUEST_DELETE', require('./GUILD_JOIN_REQUEST_DELETE')],
24
26
  ['GUILD_ROLE_CREATE', require('./GUILD_ROLE_CREATE')],
25
27
  ['GUILD_ROLE_DELETE', require('./GUILD_ROLE_DELETE')],
26
28
  ['GUILD_ROLE_UPDATE', require('./GUILD_ROLE_UPDATE')],
package/src/index.js CHANGED
@@ -53,6 +53,7 @@ exports.GuildChannelManager = require('./managers/GuildChannelManager');
53
53
  exports.GuildEmojiManager = require('./managers/GuildEmojiManager');
54
54
  exports.GuildEmojiRoleManager = require('./managers/GuildEmojiRoleManager');
55
55
  exports.GuildInviteManager = require('./managers/GuildInviteManager');
56
+ exports.GuildJoinRequestManager = require('./managers/GuildJoinRequestManager');
56
57
  exports.GuildManager = require('./managers/GuildManager');
57
58
  exports.GuildMemberManager = require('./managers/GuildMemberManager');
58
59
  exports.GuildMemberRoleManager = require('./managers/GuildMemberRoleManager');
@@ -99,6 +100,7 @@ exports.DMChannel = require('./structures/DMChannel');
99
100
  exports.Emoji = require('./structures/Emoji').Emoji;
100
101
  exports.ForumChannel = require('./structures/ForumChannel');
101
102
  exports.Guild = require('./structures/Guild').Guild;
103
+ exports.GuildJoinRequest = require('./structures/GuildJoinRequest');
102
104
  exports.GuildAuditLogs = require('./structures/GuildAuditLogs');
103
105
  exports.GuildAuditLogsEntry = require('./structures/GuildAuditLogs').Entry;
104
106
  exports.GuildBan = require('./structures/GuildBan');
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ const CachedManager = require('./CachedManager');
4
+ const GuildJoinRequest = require('../structures/GuildJoinRequest');
5
+
6
+ /**
7
+ * Manages API methods for Guild Join Requests and stores their cache.
8
+ * @extends {CachedManager}
9
+ */
10
+ class GuildJoinRequestManager extends CachedManager {
11
+ constructor(guild, iterable) {
12
+ super(guild.client, GuildJoinRequest, iterable);
13
+
14
+ /**
15
+ * The guild this manager belongs to
16
+ * @type {Guild}
17
+ */
18
+ this.guild = guild;
19
+ }
20
+
21
+ /**
22
+ * The cache of this Manager
23
+ * @type {Collection<Snowflake, GuildJoinRequest>}
24
+ * @name GuildJoinRequestManager#cache
25
+ */
26
+
27
+ _add(data, cache = true) {
28
+ return super._add(data, cache, { id: data.user_id || data.request?.user_id, extras: [this.guild] });
29
+ }
30
+
31
+ /**
32
+ * Resolves a {@link GuildJoinRequestResolvable} to a {@link GuildJoinRequest} object.
33
+ * @param {GuildJoinRequestResolvable} request The join request to resolve
34
+ * @returns {?GuildJoinRequest}
35
+ */
36
+ resolve(request) {
37
+ if (request instanceof GuildJoinRequest) return request;
38
+ if (typeof request === 'string') return this.cache.get(request) ?? null;
39
+ return null;
40
+ }
41
+
42
+ /**
43
+ * Resolves a {@link GuildJoinRequestResolvable} to a join request ID.
44
+ * @param {GuildJoinRequestResolvable} request The join request to resolve
45
+ * @returns {?Snowflake}
46
+ */
47
+ resolveId(request) {
48
+ if (request instanceof GuildJoinRequest) return request.id;
49
+ if (typeof request === 'string') return request;
50
+ return null;
51
+ }
52
+ }
53
+
54
+ module.exports = GuildJoinRequestManager;
@@ -15,6 +15,7 @@ const GuildBanManager = require('../managers/GuildBanManager');
15
15
  const GuildChannelManager = require('../managers/GuildChannelManager');
16
16
  const GuildEmojiManager = require('../managers/GuildEmojiManager');
17
17
  const GuildInviteManager = require('../managers/GuildInviteManager');
18
+ const GuildJoinRequestManager = require('../managers/GuildJoinRequestManager');
18
19
  const GuildMemberManager = require('../managers/GuildMemberManager');
19
20
  const GuildScheduledEventManager = require('../managers/GuildScheduledEventManager');
20
21
  const GuildSettingManager = require('../managers/GuildSettingManager');
@@ -124,6 +125,12 @@ class Guild extends AnonymousGuild {
124
125
  */
125
126
  this.settings = new GuildSettingManager(this);
126
127
 
128
+ /**
129
+ * A manager of the join requests of this guild
130
+ * @type {GuildJoinRequestManager}
131
+ */
132
+ this.demandes = new GuildJoinRequestManager(this);
133
+
127
134
  if (!data) return;
128
135
  if (data.unavailable) {
129
136
  /**
@@ -0,0 +1,127 @@
1
+ 'use strict';
2
+
3
+ const Base = require('./Base');
4
+
5
+ /**
6
+ * Represents a join request in a guild.
7
+ * @extends {Base}
8
+ */
9
+ class GuildJoinRequest extends Base {
10
+ constructor(client, data, guild) {
11
+ super(client);
12
+
13
+ /**
14
+ * The guild this join request belongs to
15
+ * @type {Guild}
16
+ */
17
+ this.guild = guild;
18
+
19
+ /**
20
+ * The ID of the guild this join request belongs to
21
+ * @type {Snowflake}
22
+ */
23
+ this.guildId = guild?.id ?? data.guild_id;
24
+
25
+ if (data) this._patch(data);
26
+ }
27
+
28
+ _patch(data) {
29
+ if ('id' in data) {
30
+ /**
31
+ * The ID of the join request
32
+ * @type {Snowflake}
33
+ */
34
+ this.id = data.id;
35
+ }
36
+
37
+ if ('user_id' in data) {
38
+ /**
39
+ * The ID of the user who made the join request
40
+ * @type {Snowflake}
41
+ */
42
+ this.userId = data.user_id;
43
+ }
44
+
45
+ if ('user' in data) {
46
+ /**
47
+ * The user who made the join request
48
+ * @type {?User}
49
+ */
50
+ this.user = this.client.users._add(data.user);
51
+ } else {
52
+ this.user ??= this.client.users.cache.get(this.userId) ?? null;
53
+ }
54
+
55
+ if ('application_status' in data) {
56
+ /**
57
+ * The status of the join request
58
+ * @type {string}
59
+ */
60
+ this.status = data.application_status;
61
+ } else if ('status' in data) {
62
+ this.status = data.status;
63
+ }
64
+
65
+ if ('form_responses' in data) {
66
+ /**
67
+ * The responses to the guild's join form questions
68
+ * @type {Array<{ question: string, answers: ?string }>}
69
+ */
70
+ this.responses = data.form_responses.map(r => ({
71
+ question: r.label,
72
+ answers: r.response ?? null,
73
+ }));
74
+ }
75
+
76
+ if ('created_at' in data) {
77
+ /**
78
+ * The timestamp when the join request was created
79
+ * @type {number}
80
+ */
81
+ this.createdTimestamp = new Date(data.created_at).getTime();
82
+ }
83
+ }
84
+
85
+ /**
86
+ * The date when the join request was created
87
+ * @type {Date}
88
+ * @readonly
89
+ */
90
+ get createdAt() {
91
+ return new Date(this.createdTimestamp);
92
+ }
93
+
94
+ /**
95
+ * Approves this join request.
96
+ * @returns {Promise<GuildJoinRequest>}
97
+ */
98
+ async approuve() {
99
+ await this.client.api.guilds(this.guildId).requests.id(this.id).patch({
100
+ data: { action: 'APPROVED' },
101
+ });
102
+ return this;
103
+ }
104
+
105
+ /**
106
+ * Rejects this join request.
107
+ * @param {string} [reason] The reason for rejecting the request
108
+ * @returns {Promise<GuildJoinRequest>}
109
+ */
110
+ async reject(reason) {
111
+ await this.client.api.guilds(this.guildId).requests.id(this.id).patch({
112
+ data: { action: 'REJECTED', rejection_reason: reason },
113
+ });
114
+ return this;
115
+ }
116
+
117
+ /**
118
+ * Starts an interview for this join request.
119
+ * @returns {Promise<GuildJoinRequest>}
120
+ */
121
+ async interview() {
122
+ await this.client.api['join-requests'](this.id).interview.post();
123
+ return this;
124
+ }
125
+ }
126
+
127
+ module.exports = GuildJoinRequest;
@@ -477,6 +477,8 @@ exports.Events = {
477
477
  MESSAGE_POLL_VOTE_ADD: 'messagePollVoteAdd',
478
478
  MESSAGE_POLL_VOTE_REMOVE: 'messagePollVoteRemove',
479
479
  VOICE_CHANNEL_EFFECT_SEND: 'voiceChannelEffectSend',
480
+ GUILD_JOIN_REQUEST_CREATE: 'guildJoinRequestCreate',
481
+ GUILD_JOIN_REQUEST_DELETE: 'guildJoinRequestDelete',
480
482
  // Djs v12
481
483
  VOICE_BROADCAST_SUBSCRIBE: 'subscribe',
482
484
  VOICE_BROADCAST_UNSUBSCRIBE: 'unsubscribe',
@@ -641,6 +643,8 @@ exports.WSEvents = keyMirror([
641
643
  'GUILD_SCHEDULED_EVENT_USER_ADD',
642
644
  'GUILD_SCHEDULED_EVENT_USER_REMOVE',
643
645
  'GUILD_AUDIT_LOG_ENTRY_CREATE',
646
+ 'GUILD_JOIN_REQUEST_CREATE',
647
+ 'GUILD_JOIN_REQUEST_DELETE',
644
648
  ]);
645
649
 
646
650
  /**
@@ -1683,6 +1683,7 @@ export class Guild extends AnonymousGuild {
1683
1683
  public safetyAlertsChannelId: Snowflake | null;
1684
1684
  public scheduledEvents: GuildScheduledEventManager;
1685
1685
  public settings: GuildSettingManager;
1686
+ public demandes: GuildJoinRequestManager;
1686
1687
  public profile: GuildProfile;
1687
1688
  public readonly shard: WebSocketShard;
1688
1689
  public shardId: number;
@@ -1778,6 +1779,34 @@ export interface UserMessageSearchTabOptions {
1778
1779
  trackExactTotal?: boolean;
1779
1780
  }
1780
1781
 
1782
+ export interface GuildJoinRequestResponse {
1783
+ question: string;
1784
+ answers: string | null;
1785
+ }
1786
+
1787
+ export type GuildJoinRequestResolvable = GuildJoinRequest | Snowflake;
1788
+
1789
+ export class GuildJoinRequest extends Base {
1790
+ private constructor(client: Client, data: object, guild: Guild);
1791
+ public guild: Guild;
1792
+ public guildId: Snowflake;
1793
+ public id: Snowflake;
1794
+ public userId: Snowflake;
1795
+ public user: User | null;
1796
+ public status: string;
1797
+ public responses: GuildJoinRequestResponse[];
1798
+ public createdTimestamp: number;
1799
+ public readonly createdAt: Date;
1800
+ public approuve(): Promise<this>;
1801
+ public reject(reason?: string): Promise<this>;
1802
+ public interview(): Promise<this>;
1803
+ }
1804
+
1805
+ export class GuildJoinRequestManager extends CachedManager<Snowflake, GuildJoinRequest, GuildJoinRequestResolvable> {
1806
+ private constructor(guild: Guild, iterable?: Iterable<object>);
1807
+ public guild: Guild;
1808
+ }
1809
+
1781
1810
  export class GuildAuditLogs<T extends GuildAuditLogsResolvable = 'ALL'> {
1782
1811
  private constructor(guild: Guild, data: RawGuildAuditLogData);
1783
1812
  private webhooks: Collection<Snowflake, Webhook>;
@@ -6333,6 +6362,8 @@ export interface ClientEvents extends BaseClientEvents {
6333
6362
  callDelete: [call: CallState];
6334
6363
  messagePollVoteAdd: [pollAnswer: PollAnswer, userId: Snowflake];
6335
6364
  messagePollVoteRemove: [pollAnswer: PollAnswer, userId: Snowflake];
6365
+ guildJoinRequestCreate: [joinRequest: GuildJoinRequest];
6366
+ guildJoinRequestDelete: [joinRequest: GuildJoinRequest];
6336
6367
  }
6337
6368
 
6338
6369
  export interface ClientFetchInviteOptions {
@@ -8565,7 +8596,9 @@ export type WSEventType =
8565
8596
  | 'STAGE_INSTANCE_CREATE'
8566
8597
  | 'STAGE_INSTANCE_UPDATE'
8567
8598
  | 'STAGE_INSTANCE_DELETE'
8568
- | 'GUILD_STICKERS_UPDATE';
8599
+ | 'GUILD_STICKERS_UPDATE'
8600
+ | 'GUILD_JOIN_REQUEST_CREATE'
8601
+ | 'GUILD_JOIN_REQUEST_DELETE';
8569
8602
 
8570
8603
  export type Serialized<T> = T extends symbol | bigint | (() => any)
8571
8604
  ? never