getChannelOfOrNull

inline suspend fun <T : GuildChannel> GuildBehavior.getChannelOfOrNull(channelId: Snowflake): T?(source)

Requests to get the GuildChannel represented by the channelId as type T, returns null if the GuildChannel isn't present.

Throws

if anything went wrong during the request.

if the channel is not of type T.

if the channel is not part of this guild.