fetch method

  1. @override
Future<CommandPermissions> fetch()
override

Fetch this entity from the API.

Implementation

@override
Future<CommandPermissions> fetch() async {
  if (command != null) {
    return await command!.fetchPermissions(guildId);
  }

  final permissions = await guild.commands.listPermissions();
  return permissions.firstWhere((element) => element.id == id);
}