fix(RoleManager): Fetching roles is not nullable (#10629)

fix(RoleManager): `fetch()` not nullable

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Jiralite
2024-11-29 18:40:12 +00:00
committed by GitHub
parent a69600546a
commit f5445c8104
3 changed files with 3 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ class RoleManager extends CachedManager {
* Obtains a role from Discord, or the role cache if they're already available.
* @param {Snowflake} [id] The role's id
* @param {BaseFetchOptions} [options] Additional options for this fetch
* @returns {Promise<?Role|Collection<Snowflake, Role>>}
* @returns {Promise<Role|Collection<Snowflake, Role>>}
* @example
* // Fetch all roles from the guild
* message.guild.roles.fetch()

View File

@@ -4491,7 +4491,7 @@ export class RoleManager extends CachedManager<Snowflake, Role, RoleResolvable>
public guild: Guild;
public get premiumSubscriberRole(): Role | null;
public botRoleFor(user: UserResolvable): Role | null;
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<Role | null>;
public fetch(id: Snowflake, options?: BaseFetchOptions): Promise<Role>;
public fetch(id?: undefined, options?: BaseFetchOptions): Promise<Collection<Snowflake, Role>>;
public create(options?: RoleCreateOptions): Promise<Role>;
public edit(role: RoleResolvable, options: RoleEditOptions): Promise<Role>;

View File

@@ -1700,7 +1700,7 @@ declare const messageManager: MessageManager;
declare const roleManager: RoleManager;
expectType<Promise<Collection<Snowflake, Role>>>(roleManager.fetch());
expectType<Promise<Collection<Snowflake, Role>>>(roleManager.fetch(undefined, {}));
expectType<Promise<Role | null>>(roleManager.fetch('0'));
expectType<Promise<Role>>(roleManager.fetch('0'));
declare const guildEmojiManager: GuildEmojiManager;
expectType<Promise<Collection<Snowflake, GuildEmoji>>>(guildEmojiManager.fetch());