mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-18 12:33:30 +01:00
feat(RoleStore, ChannelStore): fetch() method (#3071)
* feat({Role,Channel}Store): fetch method
* docs: Add usage examples to the new methods
* misc: Add note of why we are fetching all roles even for a single one
This commit is contained in:
3
typings/index.d.ts
vendored
3
typings/index.d.ts
vendored
@@ -1320,6 +1320,7 @@ declare module 'discord.js' {
|
||||
export class ChannelStore extends DataStore<Snowflake, Channel, typeof Channel, ChannelResolvable> {
|
||||
constructor(client: Client, iterable: Iterable<any>, options?: { lru: boolean });
|
||||
constructor(client: Client, options?: { lru: boolean });
|
||||
public fetch(id: Snowflake, cache?: boolean): Promise<Channel>;
|
||||
}
|
||||
|
||||
export class DataStore<K, V, VConstructor = Constructable<V>, R = any> extends Collection<K, V> {
|
||||
@@ -1410,6 +1411,8 @@ declare module 'discord.js' {
|
||||
public readonly highest: Role;
|
||||
|
||||
public create(options?: { data?: RoleData, reason?: string }): Promise<Role>;
|
||||
public fetch(id?: Snowflake, cache?: boolean): Promise<this>;
|
||||
public fetch(id: Snowflake, cache?: boolean): Promise<Role | null>;
|
||||
}
|
||||
|
||||
export class UserStore extends DataStore<Snowflake, User, typeof User, UserResolvable> {
|
||||
|
||||
Reference in New Issue
Block a user