diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2022-01-23 18:13:05 -0500 |
commit | a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a (patch) | |
tree | 9b0f8ed8a93c22c90512751e3f2f5937e1925760 /src/lib/extensions/discord.js/BushChannelManager.ts | |
parent | 5557677f1570eb564a30cfcebb6030235dc84d47 (diff) | |
download | tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.gz tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.tar.bz2 tanzanite-a3f8d3884a1deca5eccfb6d990e2a7b42fbbe08a.zip |
fix discord.js breaking changes, some other stuff
Diffstat (limited to 'src/lib/extensions/discord.js/BushChannelManager.ts')
-rw-r--r-- | src/lib/extensions/discord.js/BushChannelManager.ts | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/extensions/discord.js/BushChannelManager.ts b/src/lib/extensions/discord.js/BushChannelManager.ts new file mode 100644 index 0000000..ff93209 --- /dev/null +++ b/src/lib/extensions/discord.js/BushChannelManager.ts @@ -0,0 +1,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>; +} |