djs-selfbot-v13 3.7.16 → 3.7.17
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 +1 -1
- package/src/structures/Guild.js +43 -0
- package/src/structures/User.js +1 -0
- package/typings/index.d.ts +3 -0
package/package.json
CHANGED
package/src/structures/Guild.js
CHANGED
|
@@ -1752,6 +1752,49 @@ class Guild extends AnonymousGuild {
|
|
|
1752
1752
|
return data;
|
|
1753
1753
|
}
|
|
1754
1754
|
|
|
1755
|
+
/**
|
|
1756
|
+
* Get the number of members that would be pruned
|
|
1757
|
+
* @param {number} [days=7] Number of days of inactivity
|
|
1758
|
+
* @param {string[]} [includeRoles=[]] Role IDs to include in the prune
|
|
1759
|
+
* @returns {Promise<number>} The number of members that would be pruned
|
|
1760
|
+
*/
|
|
1761
|
+
async pruneCount(days = 7, includeRoles = []) {
|
|
1762
|
+
const query = { days };
|
|
1763
|
+
|
|
1764
|
+
if (includeRoles.length > 0) {
|
|
1765
|
+
query.include_roles = includeRoles.join('&include_roles=');
|
|
1766
|
+
}
|
|
1767
|
+
|
|
1768
|
+
const params = new URLSearchParams({ days: days.toString() });
|
|
1769
|
+
if (includeRoles.length > 0) {
|
|
1770
|
+
for (const roleId of includeRoles) {
|
|
1771
|
+
params.append('include_roles', roleId);
|
|
1772
|
+
}
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
const data = await this.client.api.guilds(this.id)['prune/v2'].get({ query: Object.fromEntries(params) });
|
|
1776
|
+
return data.pruned;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* Prune inactive members from the guild
|
|
1781
|
+
* @param {number} [days=7] Number of days of inactivity
|
|
1782
|
+
* @param {string[]} [includeRoles=[]] Role IDs to include in the prune
|
|
1783
|
+
* @param {boolean} [computePruneCount=false] Whether to return the number of pruned members
|
|
1784
|
+
* @returns {Promise<number|null>} The number of pruned members, or null if computePruneCount is false
|
|
1785
|
+
*/
|
|
1786
|
+
async pruneMembers(days = 7, includeRoles = [], computePruneCount = false) {
|
|
1787
|
+
const data = await this.client.api.guilds(this.id).prune.post({
|
|
1788
|
+
data: {
|
|
1789
|
+
days,
|
|
1790
|
+
compute_prune_count: computePruneCount,
|
|
1791
|
+
include_roles: includeRoles
|
|
1792
|
+
}
|
|
1793
|
+
});
|
|
1794
|
+
return data.pruned ?? null;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1797
|
+
|
|
1755
1798
|
/**
|
|
1756
1799
|
* Creates a collection of this guild's roles, sorted by their position and ids.
|
|
1757
1800
|
* @returns {Collection<Snowflake, Role>}
|
package/src/structures/User.js
CHANGED
|
@@ -465,6 +465,7 @@ class User extends Base {
|
|
|
465
465
|
this.globalName === user.global_name &&
|
|
466
466
|
this.avatar === user.avatar &&
|
|
467
467
|
this.flags?.bitfield === user.public_flags &&
|
|
468
|
+
('bio' in data ? this.bio = data.bio : true)
|
|
468
469
|
('banner' in user ? this.banner === user.banner : true) &&
|
|
469
470
|
('accent_color' in user ? this.accentColor === user.accent_color : true) &&
|
|
470
471
|
('avatar_decoration_data' in user
|
package/typings/index.d.ts
CHANGED
|
@@ -1716,6 +1716,8 @@ export class Guild extends AnonymousGuild {
|
|
|
1716
1716
|
rulesChannel?: GuildTextChannelResolvable,
|
|
1717
1717
|
reason?: string,
|
|
1718
1718
|
): Promise<this>;
|
|
1719
|
+
public pruneMembers(days?: number, includeRoles?: string[], computePruneCount?: boolean): Promise<number | null>;
|
|
1720
|
+
public pruneCount(days?: number, includeRoles?: string[]): Promise<number>;
|
|
1719
1721
|
public topEmojis(): Promise<Collection<number, GuildEmoji>>;
|
|
1720
1722
|
public setVanityCode(code?: string): Promise<this>;
|
|
1721
1723
|
public mute(options?: GuildMuteOptions): Promise<any>;
|
|
@@ -3994,6 +3996,7 @@ export class User extends PartialTextBasedChannel(Base) {
|
|
|
3994
3996
|
public readonly avatarDecoration: string | null;
|
|
3995
3997
|
public avatarDecorationData: AvatarDecorationData | null;
|
|
3996
3998
|
public banner: string | null | undefined;
|
|
3999
|
+
public bio?: string | null;
|
|
3997
4000
|
public bannerColor: string | null | undefined;
|
|
3998
4001
|
public bot: boolean;
|
|
3999
4002
|
public readonly createdAt: Date;
|