operator [] method

  1. @override
PartialChannel operator [](
  1. Snowflake id
)
override

Return a partial instance of the entity with ID id containing no data.

This allows performing API operations without fetching an instance from the API.

Because this method doesn't perform any API checks, there might be no real entity with the correct id. In this case, the object returned may not work with the API correctly.

While this method's return type is PartialChannel, a PartialTextChannel is always returned. If you are sure the channel you are requesting is a text channel, the returned value can safely be cast to a PartialTextChannel to access the channel's messages.

Implementation

@override
PartialChannel operator [](Snowflake id) => PartialTextChannel(id: id, manager: this);