mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 00:23:30 +01:00
committed by
Schuyler Cebulskie
parent
f0adf8f122
commit
beffb390e6
@@ -123,6 +123,19 @@ class ClientDataResolver {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves a ChannelResolvable to a Channel object
|
||||
* @param {ChannelResolvable} channel The channel resolvable to resolve
|
||||
* @returns {?string}
|
||||
*/
|
||||
resolveChannelID(channel) {
|
||||
if (channel instanceof Channel) return channel.id;
|
||||
if (typeof channel === 'string') return channel;
|
||||
if (channel instanceof Message) return channel.channel.id;
|
||||
if (channel instanceof Guild) return channel.defaultChannel.id;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Data that can be resolved to give an invite code. This can be:
|
||||
* * An invite code
|
||||
|
||||
Reference in New Issue
Block a user