update method
Update the role.
await role.update(
name: 'New Role Name',
color: Color.blue_400,
reason: 'Testing');
Implementation
Future<void> update(
{String? name,
Color? color,
bool? hoist,
String? emoji,
bool? mentionable,
String? reason}) async {
await _datastore.role.update(
id: id.value,
serverId: serverId.value,
reason: reason,
payload: {
if (name != null) 'name': name,
if (color != null) 'color': color.toInt(),
if (hoist != null) 'hoist': hoist,
if (emoji != null) 'unicode_emoji': emoji,
if (mentionable != null) 'mentionable': mentionable,
},
);
}