aboutsummaryrefslogtreecommitdiff
path: root/src/lib/extensions/discord.js/BushChannelManager.ts
blob: ff932094f8f9a4038808c1f45b6f5e2d3811c864 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import type { BushAnyChannel, BushChannelResolvable } from '#lib';
import { CachedManager, ChannelManager, type Client, type FetchChannelOptions, type Snowflake } from 'discord.js';
import type { RawChannelData } from 'discord.js/typings/rawDataTypes';

/**
 * A manager of channels belonging to a client
 */
export declare class BushChannelManager
	extends CachedManager<Snowflake, BushAnyChannel, BushChannelResolvable>
	implements ChannelManager
{
	public constructor(client: Client, iterable: Iterable<RawChannelData>);

	/**
	 * Obtains a channel from Discord, or the channel cache if it's already available.
	 * @param id The channel's id
	 * @param options Additional options for this fetch
	 * @example
	 * // Fetch a channel by its id
	 * client.channels.fetch('222109930545610754')
	 *   .then(channel => console.log(channel.name))
	 *   .catch(console.error);
	 */
	public fetch(id: Snowflake, options?: FetchChannelOptions): Promise<BushAnyChannel | null>;
}