chore: v2.9.6
fix: guildMemberFetch (options.user)
This commit is contained in:
parent
ecc59912d0
commit
c62c25de53
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "discord.js-selfbot-v13",
|
"name": "discord.js-selfbot-v13",
|
||||||
"version": "2.9.5",
|
"version": "2.9.6",
|
||||||
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
|
"description": "A unofficial discord.js fork for creating selfbots [Based on discord.js v13]",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
"types": "./typings/index.d.ts",
|
"types": "./typings/index.d.ts",
|
||||||
|
@ -176,7 +176,7 @@ class GuildMemberManager extends CachedManager {
|
|||||||
* @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/FetchGuildMember.md}
|
* @see {@link https://github.com/aiko-chan-ai/discord.js-selfbot-v13/blob/main/Document/FetchGuildMember.md}
|
||||||
*/
|
*/
|
||||||
fetch(options) {
|
fetch(options) {
|
||||||
if (!options || !options?.query) {
|
if (!options || (!options?.query && !options?.user)) {
|
||||||
// Check Permissions
|
// Check Permissions
|
||||||
if (
|
if (
|
||||||
this.guild.me.permissions.has('KICK_MEMBERS') ||
|
this.guild.me.permissions.has('KICK_MEMBERS') ||
|
||||||
|
@ -86,9 +86,10 @@ class UserManager extends CachedManager {
|
|||||||
* Obtains a user from Discord, or the user cache if it's already available.
|
* Obtains a user from Discord, or the user cache if it's already available.
|
||||||
* @param {UserResolvable} user The user to fetch
|
* @param {UserResolvable} user The user to fetch
|
||||||
* @param {BaseFetchOptions} [options] Additional options for this fetch
|
* @param {BaseFetchOptions} [options] Additional options for this fetch
|
||||||
|
* @param {?Snowflake} [options.guildId] The guild ID to fetch the member for
|
||||||
* @returns {Promise<User>}
|
* @returns {Promise<User>}
|
||||||
*/
|
*/
|
||||||
async fetch(user, { cache = true, force = false } = {}) {
|
async fetch(user, { cache = true, force = false, guildId = null } = {}) {
|
||||||
const id = this.resolveId(user);
|
const id = this.resolveId(user);
|
||||||
if (!force) {
|
if (!force) {
|
||||||
const existing = this.cache.get(id);
|
const existing = this.cache.get(id);
|
||||||
@ -97,8 +98,7 @@ class UserManager extends CachedManager {
|
|||||||
|
|
||||||
const data = await this.client.api.users(id).get();
|
const data = await this.client.api.users(id).get();
|
||||||
const userObject = this._add(data, cache);
|
const userObject = this._add(data, cache);
|
||||||
await userObject.getProfile().catch(() => {});
|
await userObject.getProfile(guildId ?? null).catch(() => {});
|
||||||
// Clear not because event emitted .-. Bug report by https://github.com/aSashaaa
|
|
||||||
return userObject;
|
return userObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
typings/index.d.ts
vendored
2
typings/index.d.ts
vendored
@ -4093,7 +4093,7 @@ export class UserManager extends CachedManager<Snowflake, User, UserResolvable>
|
|||||||
private dmChannel(userId: Snowflake): DMChannel | null;
|
private dmChannel(userId: Snowflake): DMChannel | null;
|
||||||
public createDM(user: UserResolvable, options?: BaseFetchOptions): Promise<DMChannel>;
|
public createDM(user: UserResolvable, options?: BaseFetchOptions): Promise<DMChannel>;
|
||||||
public deleteDM(user: UserResolvable): Promise<DMChannel>;
|
public deleteDM(user: UserResolvable): Promise<DMChannel>;
|
||||||
public fetch(user: UserResolvable, options?: BaseFetchOptions): Promise<User>;
|
public fetch(user: UserResolvable, options?: BaseFetchOptions & { guildId?: Snowflake }): Promise<User>;
|
||||||
public fetchFlags(user: UserResolvable, options?: BaseFetchOptions): Promise<UserFlags>;
|
public fetchFlags(user: UserResolvable, options?: BaseFetchOptions): Promise<UserFlags>;
|
||||||
public send(user: UserResolvable, options: string | MessagePayload | MessageOptions): Promise<Message>;
|
public send(user: UserResolvable, options: string | MessagePayload | MessageOptions): Promise<Message>;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user