resolveChannel<T extends Channel> method

Future<T> resolveChannel<T extends Channel>({
  1. bool force = false,
})

Resolves the channel where the typing occurred.

Example:

client.events.typing((Typing typing) async {
  final channel = await typing.resolveChannel<TextChannel>();
  print('Someone is typing in #${channel?.name}');
});

Parameters:

  • force Whether to force fetch the channel from the API instead of cache. Defaults to false.
  • T The type of channel to resolve. Must extend Channel.

Implementation

Future<T> resolveChannel<T extends Channel>({bool force = false}) async {
  final channel = await _datastore.channel.get<T>(channelId.value, force);
  return channel!;
}