Skip to content

Commit

Permalink
Add support for stage channels in getChannel
Browse files Browse the repository at this point in the history
  • Loading branch information
bsian03 committed Aug 17, 2021
1 parent e7099fa commit b7ac7bd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ class Client extends EventEmitter {
/**
* Get a Channel object from a channel ID
* @arg {String} channelID The ID of the channel
* @returns {CategoryChannel | GroupChannel | PrivateChannel | TextChannel | VoiceChannel | NewsChannel}
* @returns {CategoryChannel | GroupChannel | PrivateChannel | TextChannel | VoiceChannel | NewsChannel | NewsThreadChannel | PrivateThreadChannel | PublicThreadChannel}
*/
getChannel(channelID) {
if(!channelID) {
Expand All @@ -1676,6 +1676,9 @@ class Client extends EventEmitter {
if(this.channelGuildMap[channelID] && this.guilds.get(this.channelGuildMap[channelID])) {
return this.guilds.get(this.channelGuildMap[channelID]).channels.get(channelID);
}
if(this.threadGuildMap[channelID] && this.guilds.get(this.threadGuildMap[channelID])) {
return this.guilds.get(this.threadGuildMap[channelID]).channels.get(channelID);
}
return this.privateChannels.get(channelID) || this.groupChannels.get(channelID);
}

Expand Down

0 comments on commit b7ac7bd

Please sign in to comment.