/** * Static accessor for retrieving a channel type based on its Discord id key. * * @param id * The id key of the requested channel type. * * @return The ChannelType that is referred to by the provided key. If the id key is unknown, {@link #UNKNOWN} is returned. */ public static ChannelType fromId(int id) { for (ChannelType type : values()) { if (type.id == id) return type; } return UNKNOWN; } }