createRole method

Future<Role> createRole(
  1. String guildId, {
  2. String? name,
  3. String? permissions,
  4. int? color,
  5. bool? hoist,
  6. bool? mentionable,
})

Implementation

Future<Role> createRole(
  String guildId, {
  String? name,
  String? permissions,
  int? color,
  bool? hoist,
  bool? mentionable,
}) {
  var endpoint = '/guilds/$guildId/roles';
  return _http.request(
    endpoint,
    converter: Role.fromJson,
    method: 'post',
    body: {
      ...insertNotNull('name', name),
      ...insertNotNull('permissions', permissions),
      ...insertNotNull('color', color),
      ...insertNotNull('hoist', hoist),
      ...insertNotNull('mentionable', mentionable),
    },
  );
}