setIcon method

Future<void> setIcon(
  1. File icon, {
  2. String? reason,
})

Set the server's icon.

await server.assets.setIcon(File('icon.png'), reason: 'Testing');

Implementation

Future<void> setIcon(File icon, {String? reason}) async {
  final iconAsset = ImageAsset.makeAsset(icon);
  await _serverPart.updateServer(
      serverId, {'icon': iconAsset.makeUrl()}, reason);
}